Wednesday, October 28, 2015

Can Python Replace Perl In Most Cases?

Python application development
Perl and Python are both scripting languages with object oriented programming capabilities and are available in most platforms and as such they target similar if not the same pool of developers world-wide which brings up the comparison and the competition. Now the question is, can Python upstage Perl and take its place in most cases? To answer this question, it would be necessary to look at the strengths and weaknesses of both Perl and Python, evolution of the two languages and the emerging indicators of preference in the developer community.

Perl
Perl was originally developed by in 1987 by Larry Wall as a Unix scripting language and has since evolved, developing capabilities for graphics programming, system administration and network programming among others. Perl was initially used for its powerful text processing capability but in the late 90s it gained popularity as a CGI (Common Gateway Interface) scripting language as the Internet began to grow exponentially. According to Wikipedia1, “in 1998, it was also referred to as the duct tape that holds the Internet together, in reference to both its ubiquitous use as a glue language and its perceived inelegance”. The “perceived inelegance” here refers to the fact that Perl is bit too flexible when it comes to syntax and code structuring which in turn arises from the Perl dictum (articulated by Larry Wall ) “ There is more than one way to do it” , abbreviated to TMTOWTDI. However, Perl's popularity was so immense that it spawned a culture and a community, members of which contribute code, participated in discussions and development and worked as Perl evangelists. CPAN or Comprehensive Perl Archive Network is one of the largest repository of code and one of the major advantages in using Perl. But, the fact remains that Perl is no longer as popular after it started facing competition from new languages such as Ruby and of course Python.

Python
Python was first implemented by in 1989 by Guido Van Rossum but became more popular after the release of the second version Python 2.0 in 2000. Van Rossum named the language Python as homage to Monty Python's Flying Circus2, of which he was a great fan but it also implied that the language was meant to bring fun to programming, something which echoes Perl's philosophy too. However, the aphorisms listed in the Zen of Python encapsulating core Python philosophy are clearly opposed to Perl's motto and philosophy. For instance, while Perl motto says “There is more than one way to do it”, Python philosophy emphatically rejects it, stating “There should be one-- and preferably only one --obvious way to do it.” Nearly all aphorisms in PEP 20 document are in stark opposition to Perl paradigm and conventions. After all, Python is known for being highly readable language with clearer syntax and coding convention and requiring lot fewer lines of code to create applications as compared to other popular programming languages. For instance, use of whitespace indentation instead of syntactic symbols like curly braces or semi-colon to indicate scope reads more like human language rather than programming language. This is especially important in contrast to Perl which is known for syntax that makes its code difficult to read. With a host of good libraries Python is now equipped with, it can perform nearly every task that Perl has been used to accomplish. Python application development also supports a number of GUI cross-platform frameworks, something which Perl is not really known for.

However, it is not really the difference in languages but adoption by developers that would decide if Python is gaining popularity at the cost of Perl. Currently, Python ranks on the 5th position in TIOBE Index4 while Perl ranks at 11th position clearly indicating a consistent decline in popularity over the decade. Also web search by users in context to programming languages in case of Perl has dwindled from 10% in 2005 to 2% from 2011 onward. A number of reasons could be attributed  to decline of Perl starting with the fact that the way companies do business has changed significantly since the days, Perl was considered the duct tape that holds Internet together. But more importantly there are strong indications that developers, mostly new but also older ones are choosing Python over Perl both for the former's neater structure and powerful capabilities. Python syntax and language structure makes it easier for new developers to pick it up faster than they would when learning Perl. Further, when working with existing codebase it becomes difficult to understand because of Perl code's notorious “line noise” complicated by the fact that since there are more than one ways to do it, the person reading the code may face difficulty understanding why a certain block has been coded in a certain way. This can be quite taxing in maintenance and upgrading projects. 
Python doesn't have a huge centralized repository like CPAN but it has spawned communities of users who are more or less contributing in a similar manner to provide support to users taking up Python as their language of choice. Already a number of GUI libraries and frameworks are being used extensively for rapidly prototyping and developing applications, an area where Perl seems to be lagging behind. Ironically, Python's popularity may be one of the factors drawing more developers towards it, especially young, enthusiastic programmers who can in the long run enrich the Python ecosystem. Further, Python being included in Linux distributions and supported by nearly all operating systems exposes the language to students at a very early stage. However, Perl does have a core userbase that is loyal to the language almost religiously and some continue to evangelize on community website such as PerlMonks, while others simply find Perl superior to other languages and are unlikely to switch over.  So, while it is unlikely that Perl would entirely be replaced by Python, the latter is most likely to become the dominant language in most cases where traditionally Perl occupied the top position.      
 
Mindfire Solutions has rich experience in developing dynamic websites, custom web applications and Desktop Applications in Python and Django. With an 8 year track record of consistently wowing customers hailing from various industries and geographies, Mindfire Solutions isthe Python development company, you were searching for.

Tuesday, October 13, 2015

7 weaknesses of Python as a programming language

Python app development project
Python the most influential technology of the industry comes with many shortcomings! It’s absolutely true and obvious! Also this happens with every technology including Java, .Net or PHP. Let’s check out what are those weaknesses, especially from a developer’s point of view.”

Hard to learn and implement: Any programming language can never touch every one’s heart unless until found as a simple and practical language. Easy to learn, ease of use and ease of implementation are the three basic success pillars for any software language. Though industry respects the power and potential of any language, at the same time it also emphasizes on the acceptable level of the language. That is the reason why technologies like PHP, Ruby on Rails and many JS frameworks are gaining tremendous popularity in the industry within a very short span of time. When we look at Python, an old era language, it seems to be much more dominant than any other language. But at the same time it also reminds us about its difficulties that start with the learning of this technology. Due to an ancient technology, it has many glitches and loopholes within the language. It is not as easy as any other programming language, especially web domain specific languages. Things become worse, when we find it really difficult to implement Python syntax to our application. It could have simpler and well organized for a better implementation. Fresher usually hesitates to kick start their career with Python. So it needs to be improved in the future to gain more acceptances from the industry.

No proper scopes for Python variables: No matter how much you are inspired from your big brother, it is useless until we find you as helpful and as useful as your big brother! It is always told about Python that it is highly inspired from C++ and Java especially the object oriented approach of C++ and Java are heavily implemented within Python. But it is already discovered by experts and Python developers that there is a terrific issue with the approach of handling reusability in Python. Reusability concept makes the maximum use of resources in an iterative manner to improve the speed and performance of the application. There are basically three types of scope concepts to implement reusability and those are public, private and protected. These three scopes vary in their approach to handle the application resources like variables, methods and classes. Now the problem with Python is that it has a confused approach for handling the scopes of the application variables and functions. It is discovered that public class’s variables are not accessed by other functions within their scope. In fact, with nested loop, the scopes of the variables are highly demoralized by the language. It creates unnecessary complexity and confusion in the mind of the Python developer.

It takes lots of memory: Since Python has the industry leading volume of libraries and modules; it is obvious to allocate a good amount of memory to the language. Larger memory is considered as a fatal concern for the modern browsers like Smartphone and tablet browsers. So, it creates troubles for the Python developer in crafting industry standard light weight web applications with such huge volume of libraries on the shoulder.

It is Virtual Compiled language! Many believe that Python is a compiled language due to its higher tempo and performance that it has gained from its revival through Google’s Unladen Swallow project. But, the fact is that Python is an Interpreted language; it never gets compiled to machine level byte codes directly rather the source codes gets converted to an INTERMEDIATE byte code and then get converted to Machine Level code through an Interpreter! As a result, it can only be treated as a Virtual Compiled language and it hampers the performance level of the language. We are not saying that, Python has any performance issues; we just want to make it clear that it could have even better if it would have a Compiled language like Java or C++.

White space is discouraged in Python: This is yet another issue with the Python programming language. Indentation is always given priority in every language; but what about if there is NO punctuation like a curly braces as we find with other programming languages. Just imagine a case like:

If 1+1 == 2
Print “true”;
Print “false”;

You see, there are NO braces at all; this makes the code look ugly, at least to them who used to put “{“, and “}” into the codes. But, Python never allows any such possessions; it has a pioneering notion that, with these unnecessary stuffs or whitespaces the code length gets augmented and hence it makes the application weighty which is not at all a good observation.

Without a support from Framework, Python is like a mesh of everything: Python comes to your system with a tagline “Batteries included!” That means you need not to worry about anything; because everything is preloaded! But, are you qualified enough to take the benefit of those preloaded stuffs? I am sure majority falls behind the line. It is really difficult to memorize each and every library, module and methods of Python for any skilled Python developer. It can only be resolved with an IDE, i.e. integrated into the framework itself. The IDE will help as a personal guide for the developer with features like “Suggestions” and “AutoComplete” to make the best use of internal methods and libraries. So, you MUST take the help of a Python framework like Django, PyPy etc. for the benefit of your application.

Lack of proper Documentation: This seems to be highly unprofessional for any software developer; but this is absolutely true about Python. Though, the language is full of libraries, classes and methods; but the documentation is pathetic. Anyone, who has genuine intentions to learn Python from its core, will get frustrated within no time when he checks out for its documentation. The documentation severely lacks the comprehensive information about the language and this is highly sceptical for any enterprise standard language like Python. So, it needs to be enhanced enough in order to afford accurate and thorough information about the language.

So, all in all there are many loopholes in Python; at least from the developer’s point of view. Though, Python manages the loopholes with its unmatched potential and speed that it has gained from Google, it is left to you to decide whether it is really a good idea. In case you would like to go ahead with Python and are looking for an offshore software development partner, look no further than Mindfire Solutions which would be your best choice for any Python app development project.