When planning the application you have to choose the right programming language to make your application work appropriate. The choice depends on many factors you need to consider. Such as but not limited: you need to think over on what platform the application will run, how easily new features would be added to the existing platform, the code size, performance, support and community etc.
There are various web programming languages and selecting the right one makes a website function properly. In my article I would like to focus on three of them, so called three “P”: PHP, Perl and Python to answer which of these languages is the best one.
Let’s have a look at them and try to make a comparison analysis
PHP – is free of charge open source scripting language and widely used in web environment. The best advantage of PHP is that it is easy to learn and easy to use. It is flexible and used for developing from small websites to giant business and organizational websites. Most common are informative forums, chatting platforms, CRM solutions, e-commerce shopping carts, community websites, e-business, shopping carts.
In terms of efficiency it is executed by the server and server parses the code at its source, executes and send properly formatted html to the client computer. Therefore it increases the speed of PHP applications.
What concerns the advantage of running, PHP is multiplatform language and compatible with all operating systems and platforms.
Being open source language, a large group of PHP developers help in creating a support community, so it’s maintained and when bugs are found, it can be quickly fixed.
A lot of websites including such giants as Wikipedia, Yahoo!, Facebiook, Digg, WordPress and Youtube are written in PHP. The popularity of PHP is based on its simplicity and coding style that is quiet easy to understand.
Nevertheless, the simplicity in developing, precisely principle so called «structure is not important» in PHP has its reverse side, precisely it’s hard to maintain for large applications since it is not very modular.
Also it’s weak in terms of security since its open source, all people can see the source code, and if there are any bugs it could be used to explore the weakness. About 30% of all vulnerabilities listed on the National Vulnerability Database are linked to PHP. The last summary on vulnerabilities you may find following the link: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-0427
Perl –refer to all purpose languages. Perl was developed as a text editor for converting or processing large amounts of data for tasks such as creating reports. Nowadays it intended improvements and suited for web development, game programming, GUI development, popular among system administrators etc.
The Perl reusable code structure provides flexibility in apps development and at the same time creates the problem of code reading after. As there are so many ways to do, there are a lot more ways to mess up in what you’ve done. If the code was written without proper care, the reading could even take 6 months.
So from one hand Perl is a good language for small programs because of its messy syntax structure it’s hard to write and maintain large programs. On the other hand if you’re planning to develop big web application you need to consider good coordination between developers work on discussing the code stile, mentoring and managing work in the team.
In terms of portability Perl code doesn’t use system specific features, so can be run on any platform.
Among popular websites created on Perl could be named bbc.co.uk, Amazon.com, LiveJournal.
In respect of vulnerability Perl takes the second place – 9.4%. I assume that it’s not bad taking into consideration its complexity and its long history.
It has fallen out of popularity lately a bit because of the slow development of Perl 6. Most people still use Perl 5.
Python – is considered to be very elegant programming language. It’s general purpose, high level programming language. On the one hand Python’s syntax and semantics are minimal; on the other it has complex standard libraries.
Python supports multiple paradigms: object-oriented, imperative and functional programming styles and has features including fully dynamic type system and automatic memory management.
In comparison with Perl Python is easy to read language. And its key idea is vice versa “there should be one—and preferably only one—obvious way to do it”. It means that the code written by one developer could be easily developed and supported by the others. Besides to delimit blocks Python uses whitespace indentation, rather than curly braces (C, C++, ….) or keywords (Delphi).
Python is often used as a scripting language, but is also used in 3D animation (Maya, Softimage XSI, Blender) and image editors (GIMP, Inkscape, Scribus, Paint Shop Pro). It was also used for writing several video games.
Python is actively used by Google, Yahoo!, CERN and NASA. But it has problems with popularity, precisely with spreading. The reason is that it’s less simple than PHP. Working with Python you need to learn numerical libraries. So that’s why some people prefer choosing PHP instead of Python. But only the betrayed ones could explain why they choose Python, the answer is easy the development on Python is faster on 30% and his vulnerability consists only 0.67% against 36% of PHP.
PHP at first sight seems to be a leader in this so called comparison race. It’s simple, easy to learn and efficient for building small and middle size websites. Going further with analysis in terms of scalable large system it turns out that here Python will perform better than PHP. The reason is in readability that makes Python easier to maintain and extend. Besides, Python is object-oriented. PHP is not. Moreover, Google supports Python with its Google App Engine where web sites can be hosted on Google’s server for free. What concerns Perl, analysis showed that it’s simple programming language with cross platform running and open source modular architecture that provides to develop interesting things. If the task is to perform administration scripts Perl is much better to use here than PHP.
After the analysis it follows that the choice any of three P is a good choice. Also it means that for a certain purpose there is a right tool to choose. Besides the analysis showed that all three “P” have in common the following:
• are cross platform;
• have open source code;
• have well written documentation;
• have large user communities;
• extend libraries and big amount of code written;
• have high-level frameworks (PHP – Symfony, php.MVC; Python-Django, CherryPy, Pylons; Perl -Catalyst, CGI::Application, Gantry);
So I hope that summary based on technical analysis we made could help to make a right decision in future web projects you might have.
Thank you for your attention and if you have anything to add, please feel free to leave a comment.
> Besides, Python is object-oriented. PHP is not.
You might argue about its implementation, but PHP now supports object-oriented programming, and has done for a while.
The langs mentioned in the article are for a simple programming, used basically for dirty scripting, OOP features are mostly simulated, no strong types, thus these langs should not be considered a a serious choice for software development. .NET , java or c++ will bring a real OOP, resources control and makes the solution scalable and maintainable.
Pretty! This was an incredibly wonderful post. Thanks for providing this info.
I need to to thank you for this very good read!!
I definitely loved every bit of it. I have you book
marked to check out new stuff you post…
Amazing things here. I’m very satisfied to look your post. Thanks so much and I’m
looking forward to contact you. Will you kindly drop me a e-mail?
Thank you for your comments!
You may contact me at email@example.com
> Working with Python you need to learn numerical libraries
I don’t get why you mean by that. I aint necessary to lear numerical libraries to work with python. Maybe you meant to said another thing.
“Also it’s weak in terms of security since its open source,”
You didn’t go into any depth in your comparison, which is what I am looking for, because I am a programmer and am considering to pick up PHP. So that was a disappointing read. However, this one little line just makes me stare at my monitor in disbelieve.
If anything then it is closed source, which is weak. There are too many reasons to list them all, but the believe of closed source being save, because ordinary users couldn’t look into the source would make it somehow save or saver, is an old and quite naive believe. Hackers often don’t read the source. Vulnerabilities are often found by accident and passed on by hackers, or worse, the binaries gets disassembled, which makes it all the more challenging for hackers. Just because the source is not accessible doesn’t mean the binary is somehow protected. This part is what hackers cherish the most, because it shows how weak the believes of some people are.
The openness of open source is it’s strength. The willingness to let others take a look inside and have them find errors is what makes it strong and saver than closed source.
So why is PHP so insecure? The two main factors here are age and popularity. The older a software is the more bugs got fixed and less new bugs get introduced, because people usually learn from old mistakes and get better in avoiding bugs. The popularity is then what brings the attention to the software. The more eyes are looking at it, closed or open source doesn’t matter, the more likely issues can be found. PHP is quite popular, but also young, which explains its high number of vulnerabilities. On the bright side, PHP’s test suite already checks against 10,000+ known issues and they seem to be hard at work in making it more save.
Anyhow, rest assured, closed source is written by humans, too, just like any other software and therefore has just as many issues. It’s only not ordinary people who are interested in finding bugs in closed source. They don’t talk about it, because they can’t fix them anyway and the chance to get the right people to listen are diminishing small. So people tend to just move on and work-around issues, knowing that if or when something happens they at least have a good excuse for not doing anything about it. For hackers is closed source an all-you-can-eat buffet.
“Also it’s weak in terms of security since its open source,”
I stopped reading there. Please do some reading in basic security theory.
If you continue reading, you can understand what he ment.
So from one hand Perl is a good language for small programs because of its messy syntax structure it’s hard to write and maintain large programs.
Well, one of the most popular 2001 opinion, but in 2017? With perlcritics, Modern::Perl, perltidy, Function::Parameters, etc, not anymore.