Categories
Technology

What’s New in Python 3.10?

 

Python 3.10 is the latest version of Python and has been released in its first beta version. With the release of the beta version, the set of features for Python 3.10 has been finalized and the audacious Python developers are encouraged to examine their code with their latest builds. There are some interesting additions in Python which we are going to cover – structural pattern matching, more precise error reporting, parameter specification variables and other major changes.

Here’s a synopsis of all the major new features in Python 3.10 and how they can help your code.

Structural Pattern Matching: There were many failed attempts to add a case-like or switch syntax to Python and structural pattern matching is the outcome of such attempts. It enables you to match variables with one set of possible values with case/switch in other languages. It also enables you to match with the patterns of values like an object to set a certain value with a certain property. This enhances the range of possibilities to a great extent and makes it possible to write a code that quickly includes various scenarios. One of the examples is shown below –

command = input()

match command.split():

case [“quit”]:

quit()

case [“load”, filename]:

load_from(filename)

case [“save”, filename]:

save_to(filename)

case _:

print (f”Command ‘{command}’ not understood”)

Precise Error Reporting: The error reporting with Python was dependent on the impulse of the parser for so long. Python 3.9 has unfolded an entirely new parser that is more robust, faster and easier for the team of Python to maintain and be less corrupted with internal hacks. The biggest advantage of the new parser is that it offers the developers far more useful error messages which are also more precise. In the 3.8 version of Python, the following code would generate a syntax error.

print (“Hello”

print (“What’s going on?”)

File “.\test.py”, line 2

print (“What’s going on?”)

^

SyntaxError: invalid syntax

The error message is not so helpful as the real problem lies in an earlier line. The latest version of Python generates a much more useful error.

File “.\test.py”, line 1

print (“Hello”

^

SyntaxError: ‘(‘ was never closed

In this vein, most of the errors produced by the parser have been improved, they not only deliver accurate information about the error but more precisely talk about where the error occurred.

Parameter Specification Variables: The typing module of Python is used to illustrate the code with type information and lets you outline the type of callable like a function. That type of information cannot be spread across all the callable which makes it difficult to illustrate things like function decorators. There are two new additions to typing typing.Concatenate and typing.ParamSpec makes it possible to explain callable with more abridged type definition information. Here is an example of this new feature –

from typing import Awaitable, Callable, TypeVar

R = TypeVar(“R”)

def add_logging(f: Callable[…, R]) -> Callable[…, Awaitable[R]]:

async def inner(*args: object, **kwargs: object) -> R:

await log_to_database()

return f(*args, **kwargs)

return inner

@add_logging

def takes_int_str(x: int, y: str) -> int:

return x + 7

await takes_int_str(1, “A”)

await takes_int_str(“B”, 2) # fails at runtime

As it is not possible to specify the liner with proper details regarding what kind of types are being passed to the functions that are handled by the decorator, the liner is not able to catch the invalid types in the second occurrence of takes_int_str. Below is shown how the code would look with the latest parameter specification variable syntax.

from typing import Awaitable, Callable, ParamSpec, TypeVar

P = ParamSpec(“P”)

R = TypeVar(“R”)

def add_logging(f: Callable[P, R]) -> Callable[P, Awaitable[R]]:

async def inner(*args: P.args, **kwargs: P.kwargs) -> R:

await log_to_database()

return f(*args, **kwargs)

return inner

@add_logging

def takes_int_str(x: int, y: str) -> int:

return x + 7

await takes_int_str(1, “A”) # Accepted

await takes_int_str(“B”, 2) # Correctly rejected by the type checker

ParamSpec enables us to indicate where to capture positional and keyword arguments. Concatenate can be used to pinpoint how arguments are removed or added.

Other Major Changes:

  • Instead of Union [X, Y], Union types can now be expressed as X|Y for brevity.
  • The built-in zip has now a strict keyword that puts together the results of various iterables. When True is set, the zip raises an exception if any one of the iterable is used up before the others.
  • Parenthetical syntax and multi-line now support
  • Variables are now stated as type aliases, they enable forward references, the better difference between type declaration in scopes and more robust errors which involve types.
  • To build CPython, SSL 1.1.1 or a newer version is now required which revamps one of the key dependencies of CPython.

Final Words

These were some of the important new features introduced with Python 3.10. The full release of this version is expected in October 2021 between which the Python developers will be working on enhancing what has been added. It is still in the alpha version and still far away from being fully tested and ready to use.

About Digital Crafters

Being a leading Python web and software development company, we deliver best-in-class web applications using outstanding Python development frameworks, programming language, Databases like Django and other advanced tools. The dedicated full-stack Python developers with us work exceptionally to give amazing results for the client’s Python application development project. We perceive the business of the client as our own and transform the out of the box ideas into profitable web applications and websites.

Write to us at info@digitalcrafters.tech for more details about our services.

Categories
Technology

Magento Vs Shopify – Which is the Best?

 

Choosing the right platform to start an online business has never been easy especially when you are new to E-commerce. The most common questions arise regarding the open-source platforms against the hosted carts. Magento and Shopify are the two best-in-class platforms that are the choice of thousands of merchants to settle in. Both the platforms have gained popularity as they offer superior functionalities for a feature-rich online store. In this blog, we will provide you with a comprehensive comparison of Shopify and Magento that helps you in figuring out which one is most appropriate for your business. 

Below we have mentioned some of the important criteria on which these two platforms can be compared – 

  • Pricing:

    Pricing is a very important factor to consider while choosing a shopping cart. For Magento, you need not take a monthly subscription, you can download, install and set up your store for free. To publish your website, you just need to pay for the domain and a hosting provider and the price depends on your selection. There are several apps available on the Magento store that enhance your store’s capabilities and the price can cost up to $15000.

    The pricing of Shopify is subscription-based, there are 5 tiers ranging from $9 to $2000 per month. This plan includes both hosting fees and domain so you don’t need to purchase these elements separately. There is a more affordable set of website templates and themes with only $180 for the best website template in the market. Whereas, the maximum price for a theme on Magento can go up to $499. 

  • Themes and Templates:

    After budget and ease-of-use, the next thing companies care about is how their platform will look like. Shopify offers a wide range of themes including 9 free and 64 premium themes. The Shopify store owners need to pay around $100-$180 to purchase a theme for their attractive storefronts. The features of Shopify themes are –

  • Drag and Drop editor that enables you to add, switch, remove and resize the elements.
  • The themes are mobile-optimized.
  • You can easily create and add new pages.
  • The color palette and images can be changed accordingly.
  • Social media feeds can be added easily.

Magento has 11 mobile responsive themes with charges up to $499 for 10 premium options. With appropriate coding knowledge, the themes can also be created from scratch. The features which Magento themes offers are – 

  • More flexible customization.
  • Makes your store more engaging by adding animations.
  • A featured product slider can also be added to your home page.
  • Newsletters can also be incorporated in the footer of the webpage. 
  • Cross-selling blocks can also be placed on the product pages. 
  • Ease of Use:

    Shopify is clearly very easy to use against Magento, this E-commerce solution is easy to use because of the nature of a hosted platform. This E-commerce platform is built for everyone including tech-savvy and also people with only little technical background. The merchants will not face any difficulty while building their store.

    Magento is not as easy and user-friendly as Shopify, especially for people with a non-technical background. This platform gives the user complete control over their website but it requires an all-inclusive knowledge of technology to install and set up their online store.

  • Add-ons and Apps:

    Themes give the look and feel to your website but for the additional functionality, you need to add the extensions. App stores and extensions are offered by all the systems and most of the apps are just a click away that enable you to add multiple features to your E-commerce store. Magento provides around 4000 extensions and no comprehensive coding knowledge is required to install and implement these. There are some important and helpful extensions like Mage plaza which enable you to promote the products by giving custom discount options etc.

    The Shopify app store provides 4200+ free and paid apps to take control of the store, add features and boost sales. There are some popular apps like Trust Hero which enable you to show the trust icons to your visitors and potential customers to reduce the cart abandonment rate.

  • Search Engine Optimization:

    SEO allows you to optimize your E-commerce website SEO which affects your store ranking. In this aspect, Shopify and Magento both offer similar options. On both platforms, you can easily edit the title and description of a page to define how the store will be displayed in the search results. You can also add alt text to the images which help the search engines to understand what they are all about. In the Shopify app store and Magento’s marketplace, you can buy SEO apps. One of the examples is the SEO booster for Shopify which helps in finding issues related to SEO so that problems can be solved on time. 

Which is the Best?

Both Magento and Shopify are fairly powerful platforms but Shopify offers greater ease of use as it is a hosted platform. Magento is free but requires purchasing hosting and the setup and installation procedures yourself which can only be done by tech-savvy people. But at the same time, Magento offers more opportunities for customization, feature expansion and scalability. You can have add-ons and payment gateways without any extra fees. You should use Shopify if you want your store to get up and run quickly or you are just starting out on E-commerce but want a full-fledged E-commerce store. You should use Magento if you have the required coding skills and want to build the store for your large-sized or medium-sized business. 

About Digital Crafters

Digital Crafters is a well-known Shopify as well as Magento Development company offering professional and efficient E-commerce development services across the globe. Our services include launching new E-commerce stores, creating brand experiences, experimenting with new models of business, expanding into new geographies and more. Whether you are a startup, small business or an enterprise, we offer highly customizable E-commerce services and even migrate your existing store. Digital Crafters has got your back for all your requirements.

Categories
Digital Marketing

How SEO is Relevant to the Developers for Building Better Apps?

 

The job and responsibility of a web developer is much more than just designing and developing an application. Along with adding right set of features in the app, they also need to take proactive actions that makes sure to enhance the user experience. SEO and its relevance also fall under this category and incorporating its techniques is very necessary while developing the application if you want the app to perform well in the search engine rankings. This blog is a guide for the web developers to keep them updated on the latest techniques of SEO which they should be using while developing a web app.

Let’s go through the basics of SEO first –

What is SEO and Why is it Needed?

It stands for Search Engine Optimization, when any keyword is typed on browser, the search engine decides how to display the results i.e. which web pages will come in the first 10 results and which comes next. The algorithms of search engine use the stored data about each webpage and decides which webpage offer the closest content regarding the keywords of the user. You just need to convince the algorithms that your web page is the one that has the most relevant content the user is looking for.

In addition to the content, the algorithms display the website with best user experiences and as a developer, your accountability lies in the technical side of SEO. This requires some code additions, changes and tweaks for optimization. Now let’s go through the essential tips of SEO for the web developers. A web developer should keep these things in mind for SEO while developing an app –

  • Relevant HTML Meta Tags:

    The crawlers of search engine look for certain HTML tags on the web page to determine the type of content it is offering. The most important tags are the title and meta description tags. If the meta tags of a website are written by yourself, you also need to consider the relevance of keywords.

    • Keywords:

      In the terms of search engine, keywords are the short or long phrases users type in the search box. First, you need to identify the relevant keywords that will drive the users to your web page. Use those keywords in the most important places like web page’s title tag and H1 tag. They can also be used in other headlines and paragraphs.

    • Title Tag:

      The most effective position to place a keyword in a title tag is its beginning. It can also be used anywhere inside the title and it should not be longer than 60 characters including special characters and spaces.

    • Meta Description Tag:

      Meta description weigh less on the outcome of the ranking algorithm. Since it is displayed on the SERP and users get an idea about the content on the web page, it should be written in the way that the user clicks on the link to your web page.

  • Robots.txt File and Robots Meta Tags:

    The web developers should use robots.txt file to intimate the search engines to not crawl the pages specified in a file. If the crawlers are blocked from particular web page, this stops the requests of crawlers from overwhelming the server of app. The robot.txt file can also be used to prevent web pages from being indexed on Google or other search engines. The page could still get indexed if any other page is linked to the current page. You can add the noindex robots meta tag to the HTML code of the page to remove the indexing once and for all.

  • Follow and No Follow Links:

    A search engine crawler crawls the linked pages inside a page that it is already visiting. If you want to prevent a linked web page from getting associated with your site, then you can pass nofollow as the value of the rel attribute. If you want the crawler to now follow any of your links then instruct them in a single line on your meta robots tag.

  • Page Load Speed:

    This is one of the main aspects for providing an enhanced user experience to the users. As per a survey conducted by Google, the chances of bounce increase by 32% when page load time goes from 1 second to 3 second and increases by 90% when page load time goes to 5 second. Google made it as a ranking factor use in the ranking algorithm as page speed is very relevant in user experience. Google’s Lighthouse is an amazing tool to measure the performance of your site. It tells the accurate page speed in perfect network conditions and even in crappy connections.

  • Mobile Friendliness:

    Google took the mobile friendliness factor into its ranking algorithm as a mobile-friendly website offers an enhanced user experience. When the number of users accessing the web through mobile phones are all time high then no second thoughts should be given to transform your web app to serve the mobile users in a better way. The points you should keep in mind during this transformation are –

    • Responsive and Dynamic Design:

      A responsive design of the web app would have the minimum impact on the existing codebase. New viewport meta tags can be set for more flexibility for different screen resolutions. Using a dynamic design helps in serving different HTML content to desktop and mobile users after detecting the user-agent type requesting the content.

    • Mobile Subdomain:

      Generally, the subdomain has a similar name to m.example.com or mobile.example.com but it takes lot of effort and time in implementation. You should use a separate subdomain for the mobile users.

To Conclude

A web developer’s job description never includes SEO practices but considering SEO is a must to deliver a complete web app to the client. You have read the most important aspects of SEO on which web developers should focus. There are many technical SEO practices which impacts the ranking algorithm’s decision and these should be used by the developers to rank their website on the top of search result page.

About Digital Crafters

Digital Crafters is the leading digital marketing SEO company who have happy customers as their real asset. With our advanced technologies and proficient SEO team, we can help you in enhancing your bottom line with an SEO campaign specially designed for your business needs. At Digital Crafters, we offer the most effective and affordable Search Engine Optimization services and actively work with the clients in India and beyond. With our integrated strategy for SEO, you can get an edge over competition combining SEO, research, content marketing, social media and other marketing services.

Write to us at info@digitalcrafters.tech for more details about our services.