Comparison and selection of mainstream scripting programming languages in the programming world-Other integrated

Source: Internet
Author: User

In the past year's time, I bought a lot of books, looked up a lot of information, can be considered a serious study of several mainstream scripting language, because I have been trying to get a good use of automation tools to facilitate our system maintenance. Although this wish has not been achieved, but in the process, still learned a lot of things. This afternoon, when chatting with colleagues, speaking of scripting language, this is relatively rare, but also just take this opportunity to put some of my views to say that there are wrong and wrong place, please more correct.

Why choose a scripting language

Why choose a scripting language, it's possible that everyone faces a different reality. The language itself is not good or bad, only appropriate or inappropriate. Therefore, my so-called choice is mainly based on the application needs to choose, not according to the quality of the language or the user's habits. In my own case, for a long time, I would choose Java if I needed a program to help me complete my work.

First of all, Java,java is a worthy ruler of enterprise application. However, in recent years, with the change in the development of language knowledge, Java has made more and more people dissatisfied, replaced by the rapid rise of scripting language. One example is that Java 7, in its initial functional planning, has the highest voice in "closures", and "closures" are one of the most distinctive features of scripting languages. When using languages such as java,c, we have to face a variety of complex data types, design patterns, and a large number of seemingly useless but not-missing code. For scripting languages, these problems are inherently non-existent. Now, the development of attention to agile, pay attention to efficiency, for an enterprise, the first consideration of development work is cost, agile development is the most effective means to reduce costs, and scripting language, is to achieve the agile development of a feasible way.

Some people say that Java is out, but I don't think so, I personally think Java is still the best cross-platform solution. Now we can not simply think of Java as a language, it has become a de facto platform. The excellent Java alternatives built on top of the Java platform have been widely supported and recognized, such as groovy, Scala, and so on. I believe that Java still has its vitality, and its vitality may also benefit from scripting languages.

Say a long time nonsense, or to return to my choice of scripting language topic. My original intention is very simple, I want to find a non-Java platform, C language alternatives. Why? First, Java is not omnipotent, such as it can not do ICMP Ping, the second, C language learning curve is too long, C program deployment is more difficult; third, all the advantages of the scripting language above.

With the above principles, I've learned a few popular scripting languages: Perl, Python, Ruby, and, of course, I also learned scripting languages on the Java platform, such as Jython (Python's Java Implementation), JRuby (Java implementation of Ruby), Groovy. I would like to make a simple comparison of these scripting languages, I hope you can have more references when choosing the scripting language.

Comparison of scripting languages

Scripting language comparisons may be messy, but I want to focus on the following: learning curve, the language itself, cross-platform capabilities, internationalization, and its share in the application field.

Unix/linux Shell

The first choice is to mention the Unix/linux Shell (including awk, SED), which is also a scripting language, and may be the most commonly used in our daily life. I personally feel that the shell is more suitable for the process of system management, and the logic of more complex application-level products, shell development and maintenance is very difficult. With personal emotion, the shell is more difficult to learn than most of the mainstream scripting language, which is related to its grammatical features, debugging, running environment and so on. Therefore, the day-to-day process of system management, Shell is still a good tool, in addition, I believe we have a better choice.

Python/jython

One of the greatest charms of Python is that it's easy to learn that a novice can write high quality and practical programs in the short term (some say 10 minutes, I think a few days is entirely possible), and it's even known as the best choice for non-computer professionals to learn programming. Python is powerful, and the standard library is rich, and it's estimated that even Java is in the way. Python is good for system management, but that's not to say it can't do large applications. The success stories of Python applications are numerous and unique, especially in the field of scientific computing. Python is an excellent object-oriented language, but more Python programmers like Python's process-oriented parts. I personally feel that Python oo is not as good as Ruby because it's not thorough enough, but that's where Python supporters love it.

Sadly, Python has not been able to make a bigger breakthrough in enterprise applications, and has been left behind by the Up-and-comer rails (Ruby's web framework) in recent years. But that doesn't mean Python is immature in enterprise apps (Douban is the latest Python case), and if you're interested, you can learn about the most popular web frame django in the Python community, or look at the simple, incredibly web framework webpy. Python has been one of the six major development languages in just a few years and is definitely not a cover!

Jython is the Java implementation of Python, which is the official administration language of IBM WebSphere server. I choose Jython is the convenience of JDBC access to the database. But unfortunately, Jython support for Chinese is very bad, may be python itself is relatively high complexity, Jython team activity is also relatively low, in short Jython to go the road is still very long, at least I think the current version, still do not have the ability to put into production and development.

Ruby/jruby

Ruby is an Up-and-comer of the scripting language, and its success has benefited from the killer framework Rails,rails community has long shouted out the Java slogan, although this slogan has no practical significance, but rails has indeed become the hottest enterprise application framework. I personally spent a few months learning about rails, and although there is no real development experience, the highlight of the rails agile development is really the right thing to do, and that's the main reason it can quickly get red.

Throw away the rails framework, or Ruby. Ruby's language features are purely object-oriented, and syntax is known as magic (it absorbs a great deal of good elements from scripting languages like Perl and Python). So it has a higher learning curve than Python, but may write very elegant code after the study. The drawback is that Ruby is still young, its standard library is not rich enough, and the number of mature third-party libraries is relatively small, but these situations will gradually change as time progresses.

Ruby is perfectly capable of system management, and of course, if you are developing a Web application, rails is not the second choice.

JRuby is the Java implementation of Ruby and the Java Platform scripting language (later Jython), which was first received by Sun officially. JRuby and Ruby are very compatible and the team is very active. If you want to use the scripting language on the Java platform, I recommend JRuby in addition to Java native Groovy, which is also my choice.

Perl
When it comes to Perl, it may be that many people think of CGI, and I personally may be more likely to associate it with text processing, in fact, the primary purpose of Perl design is indeed to extract information from the text. Perl, like Python, is one of the most time-tested and mature scripting languages, with a large user base and loyal fans, so I'm a bit more diffident about saying bad things about Perl:

Frankly, I don't like Perl very much, probably like most people who don't like Perl, the Perl syntax is not very accustomed, some people say that Perl's syntax is ugly, may be exaggerated, but this can explain some problems. The Perl community should at least acknowledge one point: Perl is a more difficult language to start with. This is not to say that you won't be able to master Perl in the short term, but you can't write anything really presentable in the short term. In addition, Perl is not an object-oriented language, of course, many people do not value this, but this is not an advantage.

Perl is good for system management and I think it looks like a shell. In other areas of application, especially the Internet,

Perl has a decent performance. Perl is excellent, or that sentence, the language is not good or bad, only appropriate inappropriate.

Groovy

If you're struggling with the "love of Java Platform" and "hate Java syntax," Groovy may be the best choice. Groovy can be said to be the Java platform's native scripting language, a perfect combination of Java, which itself does not provide a standard library, full use of Java API Library. After rails was successful, the groovy community also showed a grails framework to contend with rails. Groovy itself absorbs a lot of Ruby's classic syntax, and Java-loving people can choose groovy.

The shortcomings and future of scripting languages

It is generally accepted that the main flaw in scripting languages is performance problems, which may depend on a number of factors, and the question is how often the performance problem is fatal. From the crash of EJBs, the rise of spring to Java, and the success of rails, it all shows that we are very sensible when it comes to different sizes of applications. I believe that can truly serve our technology, in order to have a good future, scripting language tomorrow is infinitely bright!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.