Ruby contrasts Python's strengths and weaknesses _ruby topics

Source: Internet
Author: User
Tags in python

Ruby and Python are too similar, and most of the trade-offs are a reason for personal preference. For example, I feel that Python's "There is" just one way to do it. "Better than Ruby's There are many to do it." It's not just about teamwork, it's about being able to understand yourself very quickly. The code written three months ago without any annotation is doing. Of course, there are a lot of people who feel that freedom and flexibility are more important than readability, so I say it's a matter of personal preference.

Objectively Ruby's advantage over Python is that I think of a few:

Block should be the language level where Ruby is cooler than python, and Python's anonymous functions (lambda function) are too restrictive, which is a bit of a chicken (BFDL GVR does not recognize many aspects of functional programming).

On OS X, Ruby's most important advantage over Python may be the presence of Macruby (http://www.macruby.org/). I venture to speculate that later Macruby will become the official language of Apple beyond objective-c, if not entirely replaced. Macruby In addition to making it easier and faster to create Cocoa applications, the Ruby block makes it easy to make use of the Grand Central Dispatch of OS X, which is important in later multicore, hybrid kernel (CPU+GPU) applications.

Disadvantage:

One of Ruby's mishap is performance. The official realization Ruby 1.9 is much inferior to CPython. Python also has a number of ways to multiply performance, such as NumPy, Psyco, PyPy, Cython, and Ruby's approach to high performance is limited.

The second of the

Ruby's mishap is the Third-party package. Ruby has been introduced into the English-speaking world and has not been popular for a long time, and most of the Third-party packages are web-related, and the number of packages outside the web is far less than Python. In particular, the distinction between scientific research and so on is very obvious, many areas of science are based on Python mature applications, and almost no Ruby related packages found. This is in addition to the historical origins, and Python's more concise syntax (many people who do research in Python is not computer professional) and the aforementioned performance multiplier (mainly NumPy and scipy) have 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.