Ruby vs Python advantages and disadvantages, ruby vs python

Source: Internet
Author: User

Ruby vs Python advantages and disadvantages, ruby vs python

Ruby and Python are too similar, and most of the trade-offs are personal preferences. For example, I think Python's "There is only one way to do it. "than Ruby's" There are always ways to do it. "Well, it's not just about team collaboration. More importantly, you can quickly understand what code you wrote three months ago without any comments is. Of course, many people think that freedom and flexibility are more important than readability, so I say this is my personal preference.

Objectively speaking, Ruby has the following advantages over Python:

Block should be a cooler part of Ruby than Python in terms of language. There are too many restrictions on lambda functions in Python (BFDL GvR does not recognize many aspects of functional programming ).

On OS X, the most important advantage of Ruby over Python may be the presence of MacRuby (http://www.macruby.org. I am bold enough to guess that MacRuby will become an official language outside Objective-C (if not completely replaced. In addition to convenient and quick Cocoa application creation, MacRuby block makes it easy to use the Grand Central Dispatch of OS X. In the future, MacRuby will support multi-core and hybrid cores (CPU + GPU) application is very important.

Disadvantages:

One of Ruby's major challenges is performance. The official implementation of Ruby 1.9 is inferior to that of CPython. In addition, Python has many ways to multiply performance, such as Numpy, Psyco, PyPy, and Cython. In contrast, Ruby has limited ways to improve performance.

The second major injury to Ruby lies in a third-party package. Ruby has not been popular in the English world for a long time. Most third-party packages are related to the Web, and the number of packages outside the Web field is far smaller than that of Python. Especially in scientific research and other aspects, the difference is very obvious. Many disciplines and fields have mature Python-based applications, and almost cannot find Ruby-related packages. In addition to the historical origins, this is also a more concise syntax with Python (many people who use Python for research are not computer-specialized) and the aforementioned performance multiplier (mainly Numpy and Scipy) there is a close relationship.

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.