Ruby 1.9 does not kill Python

Source: Internet
Author: User
Tags ruby on rails
Songben launched Ruby 1.9 on Christmas Day. According to Ruby's convention, if the first digit after the decimal point is a singular number, it indicates that this is an experimental version and is not recommended for product environments. The so-called "product environment" is basically Ruby on Rails for the current Ruby. According to the current reflection of the ROR community, some people are trying to use Ruby 1.9 With Ror, but it is still a ticket. I asked some ror teams in real projects, and no one is planning to use Ruby 1.9 in their own projects.

Mauricio Fernandez, a half-fairy character in the Ruby community, summarizes the main new features of Ruby 1.9. It is a huge addition, full of syntactic sugar. I have read it for a long time, there are only a few things with special significance. In fact, the most significant change to Ruby 1.9 Is not included. The new Virtual Machine yarv greatly improves Ruby performance. In a reprinted report on csdn, we mentioned that Ruby 1.9's performance is twice faster than Python 2.5.1 in the evaluation and comparison of a Fibonacci sequence. Of course, it is naive to conclude that Ruby 1.9 is faster than python in just one test, but now I can say for sure, the "slowest Dynamic Language" on Ruby's head must be removed.

Some people think that Ruby is going to dominate the dynamic language. You can think about it. Ruby already has almost all the Fantastic language features, magical dynamic capabilities, powerful support libraries, and built-in regular expressions that match Perl, smalltalk-level pure and pure object-oriented features, simple and bright style, cross-language integration is also very easy, the only drawback is slow. Now this shortcoming has been rectified. Can Ruby still block it? Other dynamic languages should be closed.

Although I am also a supporter of the Ruby language, I do not think so. In particular, I don't think Ruby 1.9 can pose a real threat to Python, let alone "Never let it go ". The reason is simple. Ruby is a magic language, while python is a simple language, and most of Python's supporters are followers of minimalism. For them, the more magical a language is, the more unable to gain their trust.

What is magic language? This is what I wrote. There are many methods to classify programming languages, such as "Procedural Language", "object-oriented language", and "functional language, this is based on the original way in which the program is viewed. There are also "compiled language" and "interpreted language", which are divided by the time when language translation occurs, and there are some other methods. However, I have always felt that the language can be divided into "Magic language" and "simple language" based on the design style of the language and the temperament of its advocates.

The so-called "Magic language" mainly represents the works of C ++, Perl, JavaScript and Ruby. These languages have rich features, smart skills, and unexpected miraculous effects. They can always find the incredible "yet another way ". In turn, the "simple language" advocates clarity and directness. It is enough to make it easy to understand the code. It is better to be stupid, tired, and write more code to oppose unexpected techniques and be confused. C, PHP, Python, and Lua. Java and C # Are simple at the beginning in terms of language design, but they have become more and more magical recently, and the standard library design is quite complicated. However, I tend to classify them as simple languages, because although there are many skills in them, the overall style of the two language communities is relatively simple. The tradition of VB is typical minimalism. The old VB6 and VBA are both typical minimalism. Although the new VB. NET can also be used with magic, it is basically closer to the simple language.

The magic language is usually more fascinating and can do a lot of stunned things. Fans of magic language are usually keen on this kind of intellectual competition. They explore every dead corner of the language, find interesting combinations of skills, and search for better methods and ideas over and over again, i'm so bored with language skills. In the community of magic language, "language experts" are highly respected. They may not know how to respond to an HTTP request, however, we can write a For Loop in at least six ways. The code they write is a riddle-like art. People who come out of the riddle and guess the riddle can enjoy great spiritual satisfaction.

Simple language is too much. There is usually one or two ways to do one thing. You really don't have much to worry about. Simply looking at the code doesn't tell you how to do it. Anyone who has been professionally trained can see what medicine you sell in the gourd, and find a sense of accomplishment in the code. Of course, this does not mean that the "power" of a simple language is worse than that of a magic language, or it may limit your thinking. On the contrary, simple language enables you to focus on what is really related to the problem, rather than the way the language is expressed. Therefore, from the perspective of engineering, simple language is more suitable for large-scale and collaborative software development.
From a long comparison, simple languages are undoubtedly more widely supported.

If the magic language is effectively controlled, it can also be used in a simple way. There are two ways to implement this. One is to make the application of the language simple through effective restrictions. For example, Java and C # have many magical features and are qualified to be called a magic language. However, the community culture is simple, and few people like to be cool, the application style of a language is effectively limited to a "simple subset. The second path is simple by magic. Master C ++ Andrew Koenig once used this idea to defend the complexity of C ++, but C ++ is not doing well in this regard. Ruby on Rails is a successful case. Ror uses many tricks in its implementation. However, developing Web applications on this framework is simpler and more intuitive than PHP. This is an example of achieving simplicity through magic.

Back to the topic at the beginning, Ruby is a typical magic language, while python is represented by the simple school. There is a big gap between the two language support groups in aesthetic concepts and development styles. People who are new to Ruby and python will be excited and excited for a different reason. Ruby learners will be pleasantly surprised by many new expressions, such as attr_accessor and other magical features, while Python learners will be pleasantly surprised by the simplicity of specific functions. From the very beginning, they are pursuing different things. With the deepening of learning, Python developers will certainly find many in-depth features in Python, but they do not tend to abuse them. For a long time, the python crowd had a sense of dislike for the magic of any language. One Django developer I know makes it clear that even if ror is a little more efficient than Django, it will never use ruby, because Ruby is full of "No need for cleverness ".

In terms of performance, there is not much opportunity for a substantial improvement in Python's performance, but I don't believe yarv can really make Ruby enjoy a significant advantage over python in terms of speed, the running timeliness of the two depends on the same order of magnitude. Therefore, the choice of language mainly depends on the style and aesthetic tendency. Based on this, I have determined that python developers will not switch to Ruby on a large scale, nor will Ruby's development have a substantial impact on python. Both languages will become the most popular application development language.

Related Article

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.