Even now, I would like to make a comparison or give an opinion. Just self-satisfaction and personal views.
I think it is important to know the background and purpose of each language in terms of using that language.
In the pre-Perl era, there were only compiled languages like C in the world, and only shells, sed, and awk could process without compiling. When I wanted to process a little text automatically, but it wasn't something that I would create in earnest in C, everyone would process UNIX commands side by side as a shell script. Convenient commands such as sort and test were provided in UNIX, and even a little complicated processing could be managed by making full use of sed and awk.
However, there are two types of shells, Bourne Shell type and C Shell type, and even if the same UNIX command has different options depending on the OS, the portability is low. In the first place, the processing is continuous because the command execution is continuous. It had the drawback of being heavy.
Meanwhile, Perl was born to solve the dissatisfaction of shell scripts. It included the functions of shell, sed, and awk, and implemented powerful regular expressions in addition to the functions required for text processing. In text processing, it is much more powerful and faster than the combination of commands by the shell. Also, because of the high portability that the same Perl works in the same way, everyone started using Perl.
Then, the Internet has spread to the general public, and it has become an era in which many people create websites. More and more people want to put not only static HTML but also dynamic pages (CGI) such as counters and bulletin boards. At that time, Perl was a reasonable option to implement CGI. Since it is a script language, it can be used just by placing it, powerful text processing such as regular expressions is possible (text processing if HTML spitting is exhausted with CGI), and it is installed as standard on UNIX / Linux, so support and provision are easy. For that reason, there was a time when CGI was called Perl.
In this way, Perl became very popular and built an era, but there were three major problems.
If you do it in one way, everyone will write the algorithm the same way, which will make the code cleaner and easier to read. And maintainability also improves. Python was created based on the idea of reversal. Indentation is sometimes used in a style that is not often found in other languages, and the readability is outstanding. It has become the supreme language for well-behaved programming.
PHP was created with the idea that if you embed the code in HTML instead of creating HTML with code, redundant print statements will not be necessary. Also, by compiling and installing the Apache module called mod_php together, I was able to eliminate the slow process startup peculiar to CGI. It has become the perfect language for creating small web dynamic pages.
Ruby was designed and created as a pure object-oriented language from the beginning. Not to mention Perl, Python was also object-oriented, so I was dissatisfied with the language specifications as object-oriented (PHP is also object-oriented). Since Ruby is a full-fledged object-oriented language that makes everything an object from the beginning, it has become a language that can be written very straightforwardly when doing object-oriented programming.
Perl has a long history and has a long day, and initially it is more than others in terms of the number of libraries, the number of reference codes, the number of Japanese information sites and books, whether OS standards are available, etc. It was superior. However, in modern times, all the necessary libraries for other languages are available, there are many reference codes, many Japanese information sites and books, and packages are prepared for each on Linux. Of course, the latest Mac OS X has all four languages installed from the beginning. In other words, it can be said that the environmental difference has completely disappeared.
It is best to make a choice that suits each purpose because it is such an era. If you want to keep the old code alive, you can leave Perl as it is, if you want to emphasize maintainability, you can use Python, PHP is the best for a little web dynamic page, and if you want to write object-oriented and honestly, Ruby is used. You can use it.
It's boring when it's over, so I'll turn my point of view to the future.
It can be said that the current Perl 5 is already dead. It does not mean that it will not develop any further, but that it is stable. As long as it's Perl5, the code I just wrote will work in the future, and the code I wrote 10 years ago will work fine.
However, Perl 6 will be released in the future. Perl 6 has been cut off backwards compatibility and is even said to be a completely different language. Perl 6 may be accepted as another language, but it is unlikely that it will be seen as the next version of Perl 5. However, it is certain that Perl 5 will be taken over by the successor language that has taken advantage of it. Will it continue its gradual decline, or will it be reborn as Perl 6, and can it be called Perl? The invisible future continues.
The current Python is maintained in Python 2 and Python 3. Python2 and Python3 have some incompatibilities, and rewriting is almost essential. There are plenty of migration tools available, but they don't seem to be moving forward. That's because many operating systems still use Python 2. There are many auxiliary tools that form the basis of an OS made in Python. And it's made in Python2. It is necessary to rewrite to change to Python3, and it is necessary to check from the beginning what is currently operating stably. It's better to keep it running on Python2, which is currently running. After all, Python installed as an OS standard will remain Python2, and the tools created accordingly will be Python2. Yes, there will never be a move to Python3.
This may be ironic because Python has succeeded in Python 2. Linguistically, Python3 should be much cleaner, but will the day come when Python3 will become mainstream?
PHP compatibility truncation may be famous. Language compatibility truncation usually occurs in major versions. Perl changes a lot at 5-> 6, and Python truncates some at 2-> 3. Ruby also cuts off some compatibility with 1.8-> 1.9 (1.9 was originally positioned as a development version of 2.0). However, PHP is truncated in the minor version. It will be deprecated at first, but an error will occur in the next version. In other words, there are a lot of codes that don't work just by changing two minor versions. And PHP only supports up to two minor versions. If developers don't maintain old code indefinitely, they will only work with vulnerable versions.
And, after PHP5, PHP7 is not known. In this way, PHP development guidelines have been criticized in various ways. The PHP you wrote will probably stop working after a few years. There is no choice but to maintain it forever, and the dilemma continues.
Ruby also had some compatibility truncation with 1.8-> 1.9, but since I haven't used it so much in the first place, the latest OS has started to adopt 1.9 or later (1.8 is no longer supported). (Although there is). Since 1.9 and later, compatibility is almost maintained, so there is no worry about compatibility like other languages.
But how many people are using Ruby after all? It became famous for Ruby on Rails, but the benefits of Rails are being lost as more and more similar frameworks emerge. A simple web application can't match PHP, and readability and maintainability can't match Python. The drawbacks of being slow, having a small environment, and having a small number of libraries have disappeared, but they do not have the advantages that other languages do not have. After all, I feel that object-oriented enthusiasts will use it for a long time.
Finally, now that JavaScript is being used beyond just a web language. There is also a server-side node.js, which may break Perl and its derived Python, PHP, and Ruby strongholds in the future. However, the language specification of JavaScript itself is too bad to be used as it is. How will the language that compiles to JavaScript called Alt JS and the next ECMAScript 6 evolve, and will they surpass the former Perl? The future remains uncertain.
Recommended Posts