Let's talk about PHP, Python, and Ruby.

Source: Internet
Author: User
This article is an example of self-knowledge. Summary: If you want to help him find a job as soon as possible, make money, and recommend PHP. If you want to make him an efficient engineer, we recommend Python. If you want him to fall in love with his job, we recommend Ruby. Language selection programming languages are very important. do not think they are all Turing-equivalent. In fact, good language brings you something that is super

This article is an example of self-knowledge.

Summary in one sentence

Summary:

  • If you want to help him find a job as soon as possible, make money, and recommend PHP.
  • If you want to make him an efficient engineer, we recommend Python.
  • If you want him to fall in love with his job, we recommend Ruby.
Language selection

Programming languages are very important. do not think they are all Turing equivalent. In fact, good language brings you something beyond imagination.

The following are some opinions:

  1. The programmer's time is far more valuable than the machine's time: choose the language with the highest development efficiency, and don't care too much about the running performance. if you don't develop anything, it's useless to run much faster.
  2. Elegant abstraction is better than simple stacking: this means that your code is the most concise and full of design, object-oriented, easy closures, and expressions, the best abstraction is that the language itself can be layered, that is, the language that can be written. for example, the strength of DSL is an indicator.
  3. Talented communities are better than difficult recruitment: this language must have an active and talented community. if you use her, you will have a sense of pride and elites, everyone in the community thinks they are better than others. Even if you are not so easy to recruit programmers, we do not know that a talented programmer is better than 100 mediocre programmers? Using this language ensures that everyone in the team is a master.
  4. It is also the most important thing. fun is better than everything: flexibility, fun, and there will always be new magic-like languages that you can't think of, but what you can't do without. for a real hacker, this is the only reason for choosing a language. This is why Perl remains alive for a long time, because it was created by hacker.

After reading these ideas, I believe you can guess my choice ?? Yes, Ruby is one of the mainstream languages I think is the best, the most efficient development, the most elegant and concise abstract capabilities, the most talented community (GitHub-centered), and the greatest pleasure.

As a programmer, we should select languages with different ideas to learn, and of course we must select the most representative language. in the programming world, there are actually two mainstream ideas, one is structured programming, and the other is functional programming. object-oriented programming is only a stage in the evolution of structured programming. most of the other ideas are the two branches.

 

Community creativity

Choosing a language depends on the temperament of the language community and what you want to do with it.

The Mac can run in so many languages that many people use git. However, only Ruby users have developed a great package management system like homebrew, making full use of many github features and truly turning every user into a potential repo contributor. I believe this is no coincidence. If the same conditions are in front of you, you make a brand new thing without others, it means that your creativity is higher than others.

As a Python user, I think the advantages and disadvantages of Ruby syntax are not very important. However, from the external perspective, the Ruby community has been exporting some ideas from technology to development in recent years, and there have been many cool projects from the Ruby community. I think the Ruby community is a very innovative community. Therefore, if you want to develop something cool, I strongly recommend that you study Ruby directly.

 

Comparison from Web development

These three languages are competent for Web development, but there are still many differences:

  • Ruby's rails framework is indeed a model of rapid development, but Ruby's syntax is too flexible. sometimes there are many different ways to write the same process.
  • PHP is a well-established web scripting language, which is more mature than the other two. Although PHP is quickly formed, it is easy to get out of control, especially when the project is a little large.
  • For Python, due to its simple design, there may be more application aspects, and almost all IT aspects can be involved. Web is just one of them, in addition, there are relatively successful killer applications. Youtube is developed using Python, and various scripts on the server that used to use shell or perl, scientific computing, and games, even on the desktop client, you can see the Python masterpiece, such as UliPad. for beginners, Python is a good choice. among the three, its syntax is the most concise and clear, suitable for beginners.

The entry-level language should still be relatively rigorous. it is suitable for languages like Java and Python. it is not easy to learn OO ideas and design patterns from the PHP language, these are also necessary for a good PHP programmer. This is not a black PHP, and each language has its own advantages. for example, PHP is quick to get started, which can increase programming confidence. after knowing the point of programming, you can access other languages by analogy. Many programmers get started with PHP.

There is such a phenomenon in programming: people who directly recommend Python have not thoroughly studied Ruby. People who have studied Python and Ruby basically like Ruby.

The specific language is not unique. Based on the scenario. A person must learn at least three languages:

  • One is a working language, such as C ++, Java, and PHP. these three languages are the panacea for the Internet. as long as they do, they will never worry about work, large companies generally use it to develop large projects.
  • One is your own language, such as Python and Ruby. of course, I also recommend Ruby. I also used python. later, I gave up Python because of my work needs. Finally, I really liked Ruby. Then I will not look back. for personal use, I need to pay great attention to the development efficiency. a language can be used for at least 10 years. if I select a language, it can surpass other languages in terms of development efficiency, so this benefit is very huge within ten years.
  • There is also a new language, which does not need to be used in depth, but must be understood. This helps to compare the shortcomings of different languages, so that it will not become a slot. For example, Nodejs and Scala.
Ruby

I think it is also a good choice to learn Ruby directly.

  1. Originally, the rails framework came with the server and WEBrick. The efficiency of Log development is very high.
  2. If you want to deploy it, it is absolutely convenient to use passenger.
  3. In the view-layer template system, ERB should be more elegant and simpler than Python. Used before? Django, I think it is too heavy.
  4. Rails can keep you Surprised. this is the first time I saw 7. days. ago.
  5. Rails emphasizes a DSL that conforms to people's language habits and I think it is a subversive programming language. we are not using a specific language (such as Ruby) to implement a function (just like using C or Java to write a compiler). Instead, I can define a new language based on these languages (similar to lex, syntax generator like yacc ). Let's take a look at the routes. rb settings. how surprised we can be. Is this a program? it's just a poem. The beauty lies not only in content, but also in form.

The disadvantage of Ruby or Rails may be that the learning curve is too steep. I have had MVC experience before. it may take three weeks to get started with RoR. maybe I am not able to accept it myself, but the more specific problem should be that Rails is too frequently used: of course, when I use ActiveRecord to get data, I can write find_by_ SQL ("blablabla"), but I will check the Rails documentation in detail, it provides something similar to Joins. group. select and so on, regardless of whether the efficiency is true or not, it will be faster to write less SQL in. isn't rb files more beautiful. Later on, I accidentally found that metawhere was something like this, so I had to abandon the pile of works but not elegant that I had learned before and devote myself to metawhere.

Of course, if you do not pursue perfection, it is not so terrible to get started.

About Python

Python has many advantages, such:

  1. The syntax is concise and requires no compilation. The Python syntax is concise and efficient. the phrase "My life is short, I use Python" demonstrates that efficiency is a feature of Python.
  2. Powerful data structure. The default Python development environment has many advanced data types, such as lists, tuples, dictionaries, collections, and queues. you can use these data types without further programming. Using these data types makes abstract mathematical concepts very simple.
  3. Forced indentation makes the code look organized.
  4. Complete plug-ins to complete most program design tasks.
Summary
  • There is no best language, but only the most appropriate language.
  • There are no bad languages and only bad programmers.
  • No language is omnipotent. it is impossible to speak only one language.

The language is not important. The most important thing is efficiency: development efficiency and execution efficiency. PHP? The syntax is silly and not dazzling at all. However, anyone who has studied C, JS, AS, and other languages is easy to use, because there are many overlapping syntaxes. Many people look down on PHP and say that PHP is too simple because PHP itself is not well understood. In fact, PHP is rarely used, more than 5.3 of the features make the language more vivid. the deeper you are, the more powerful and advantageous you will find.

Here we only list some cases of PHP, Python, and Ruby, so that readers can better select the language to learn.

There are no good or bad languages. Just follow your passion.

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.