Which one should ruby and python learn?

Source: Internet
Author: User
Tags learn perl
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: Let's talk about your point of view: you must first understand what the goals of these script languages are, and the answers to different goals are different.

Let's talk about my personal experience (perl ruby python) for your reference:
0.) at school, I learned about perl ruby and python.
Perl is a bunch of weeds, and the impression is like a village girl on a construction site (no discriminatory meaning, just talk about the image)
The impression of python is that it is a dull, cool pair of engineering glasses.
Ruby feels like a combination of talent, school flowers, and hot girls.

1.) The first job of graduation is mainly about backend, and C ++ also uses some Java.
I wrote some scripts to automate some manual work, starting with bash,
Later, bash was a little more complicated. For this reason, I also played bashdb. later, I really couldn't stand it.
I decided to change the script. based on the impression mentioned in "0", I decided to use ruby as the first choice of script. I learned and used it at work,
Ruby is very high.

2) later, he participated in the integration of a product line, cross-department cooperation, involving multiple bus and various Unix/Linux environments.
In many cases, these environments have both product standards and are not allowed to install other software.
Most of them do not install ruby, and shell is different. some python do not.
However, perl is available on every machine !! Even the hardware-based BU uses embedded Linux with perl.
To facilitate some auxiliary work, you have to learn perl for a while.
The goal at that time was to use a better shell script.
Here we recommend a book: Manning: Minimal Perl is very good.
Sometimes it works very well to combine shell with pipeline command with perl to form a command line string.
If perl is used as a better shell script, write 30 ~ If there are 50 rows of temporary scripts, perl is really good.

3.) with the adjustment of work and the constant expansion of their contact scope, we found that very open-source programs mainly support scripts.
Python: vim, gdb, protocol buffer, opencv, and rabbitmq ), even the script interface provided by C ++'s most persistent boost community is also python. In short, python is the first choice for script support by most software. Gradually, I feel that python is the most mainstream choice of scripts.

4. I have been working on backend development. I want to play with the web and access php. rails doesn't like it all the way down. I feel like flask is the best taste.
After using ipython, I felt python was really convenient. But I still remember ruby. However, after I got started with data processing, I got started with numpy, scipy, scikit-learn, scikit-image, ipython-notebook, cython, and other tools, and I felt like I had put ruby down. If data processing is involved, it is difficult for ruby to catch up with python because of the Matthew effect caused by the current advantages of python in data processing. In the future, we will take python as the main scripting language and prepare to learn it carefully.

The above is about the entire tossing process. Back to the problem itself, you must first understand what the goal is.

If dozens of rows of small scripts are used to process temporary auxiliary tasks, and the command line is also used in combination with the shell, perl is also good, and ruby seems to be fine. search for one line perl or one line ruby.

If you want to write a script to process the task, and the script is not temporary, the environment can also be controlled, like the coding feeling, and like to play with meta programming, then definitely choose ruby.

In addition, you can choose python. python is a vast ocean :)
This is a speech this year. the speaker emphasized ruby's creativity, which is more flexible.

Python is less difficult to learn, but it is not difficult to learn ruby if you have a teacher.
There are many ruby syntaxes, but few are commonly used. I think there will be some learning troubles, because beginners do not know where to focus.

It may take a week to learn for three days. after all, you only know the taste. Ruby is more creative, that is, more flexible.

Python is less difficult to learn, but it is not difficult to learn ruby if you have a teacher.

If there are no acquaintances, you can go to a training institution to learn ruby,

As a ruby engineer, I still recommend learning ruby. this is a very creative and free programming language. it is easier to write and more fun, and B is more loaded. Python has only one or two ways to do this, and most people write almost the same code.
Ruby does one thing, depending entirely on the size of your brain holes.
--------
Ruby bypasses many of python syntax designs that do not mean failures but are uncomfortable.
For example, python uses indentation to arrange code blocks. it is easy to develop bugs in the complex nested if statements. There are also class attributes that cannot be completely hidden from the outside, which can easily lead to security problems, and may cause others to accidentally modify your attributes, resulting in bugs. you also spent half a day checking your code, I have encountered this problem several times.
The other thing is that ruby code can be written very well. it is very mysterious, although it may not be a good thing under any circumstances. It is best to learn both. Required. Choose which ruby gives you the first impression to learn, and the difference between the two languages is not as big as you think. O & M or gui for python
For ruby in web development, I personally think that Ruby is very powerful in web openness, and can be quickly used with the Rails framework, and JRuby can also be used to support performance later. Python only plays a role as a helper tool in my previous work, but now I can also use Ruby to do some auxiliary tasks,
In addition, Ruby is purely object-oriented, and it also contains some important elements of FP, as well as a lot of eye-catching syntactic sugar. Using these features, Ruby can help you focus more on solving actual problems, without worrying about language details.

Finally, I chose Ruby because of my hobbies and work needs. You can feel the two languages before making a decision. You can take a look at it and decide which one to focus on.
This question is useless. Rubyist certainly recommends you to learn Ruby, and Pythoner also recommends you to learn Python. what is the difference between this question and the question. Duxue

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.