Php-python-ruby

Source: Internet
Author: User
Tags getting started with php php language minimalist design

<title>Php-python-ruby</title> Php-python-ruby

Original

A word summary

To summarize briefly:

If you want to help him find a job as soon as possible, make money, recommend PHP.
If you want him to be an efficient engineer, recommend Python.
If you want to make him fall in love with his job, Ruby is recommended.

Choice of language

Programming languages are very important, don't think they are all Turing equivalents, and use them all the same. In fact, the good language, the thing that brings you is beyond imagination.

Here are some ideas:

The programmer's time is much more valuable than the machine's time: Choose the most efficient language, do not care too much about the performance, if you can not develop something, then run faster also useless.
Elegant abstraction is better than simple stuffing: this means that your code is the most concise and full of design, object-oriented, easy closure, everything is expression and so on, and the best abstraction is the language itself can be layered, both can write language language, such as the ability of the DSL is an indicator of strength.
A talented community is better than a difficult job: the language must have an active and talented community, and with her people there is a sense of pride and meritocracy, and everyone in the community thinks it's better than others. Even if you're not so easy to recruit programmers, we don't all know that a talented programmer is more than 100 mediocre. Choose this language, can ensure that the team together coding each person, is a master.
And the most important, the fun is more than anything: flexible, fun, always have new found magic language, only you can not think of, not you can not do, for a real hacker, this is the only reason to choose language, this is why Perl can survive for a long time, because she is hacker for Created by hacker.

If you can read these ideas, I believe you can guess my choice:) Yes, Ruby is in the mainstream language I think the most outstanding, the highest development efficiency, the most elegant concise abstract ability, most of the community (GitHub-centric), and the greatest fun.

As a programmer, should choose different ideas of language to learn, and of course to choose the most representative of the language, in the programming world, the mainstream of thinking in fact two, one is structured programming, one is functional programming, object-oriented is only a phase of structured programming evolution, Most of the other kinds of thinking are the two branches.
The creativity of the community

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

There are many languages that can be run on a Mac, and a lot of people use git. But only Ruby's users have developed a homebrew package management system that leverages GitHub's many features to truly turn every user into a potential repo contributor. I believe this is definitely not a coincidence. If the same conditions are in front of you, you make a whole new thing and others don't, it means you are more creative than others.

As a Python user, I think Ruby syntax is not very important. But from the outside, the Ruby community continues to export some of the ideas from technology to development in recent years, and there are a lot of cool projects from the Ruby29 community. Makes me feel that the Ruby community is a very innovative community. So if you're learning programming to make a cool thing, then I highly recommend that you learn Ruby directly.
From Web Development to compare

For Web Development, these three languages are capable, but there are many differences:

Ruby's rails framework is indeed a paradigm for rapid development, but Ruby's syntax is too flexible, and sometimes there are many different ways of writing the same process.
PHP is a veteran web scripting language, relatively mature compared to the other two. Although PHP is fast prototyping, it is easy to get out of control, especially when the project is slightly larger.
For Python, because of its own minimalist design, there may be more applications, almost all aspects of it can be involved in it, the Web is just one aspect of it, and there are more successful killer applications, Youtube is developed in Python, the server's various original shell Or Perl scripts, scientific calculations, game scripts, even on the desktop client can see Python's masterpiece, such as Ulipad, for beginners, Python30 is a good choice, in these three of its syntax is the most concise and clear, suitable for beginners to learn.

The introduction language or should choose a more rigorous, like Java,python language more appropriate, from the PHP language is not easy to learn OO ideas and design patterns and other things, and these for a good PHP programmer is also necessary. This is not black PHP, each language has its own advantages, such as the introduction of PHP fast, can increase the confidence of programming, understand programming that point, you can comprehend by analogy contact other languages. Many programmers are getting started with PHP.

There is a phenomenon in programming learning: people who directly recommend Python do not learn much about Ruby in depth. People who have learned Python and Ruby basically like Ruby.

Specifically what language to use, is not unique. According to the scene is to be divided. A person needs to learn at least 3 languages:

One is working language, such as c++,java,php, these three languages, is the Internet's universal medicine, as long as it will, work is never worry, large companies will generally use, used to develop some large-scale projects.
One is your own language, like Python,ruby, and of course I recommend Ruby. I also used Python, and later because of work needs, reluctantly gave up Python, finally, actually deeply like Ruby. And then no longer back, for personal use, is to pay great attention to the development of performance, a language, at least 10 years, if the language of their choice, can be developed in the efficiency of the development beyond the other language One-tenth, then in 10 years this benefit is very large.
There is a new language to use, do not need to go deep, but must understand, this helps to compare the shortcomings of different languages, so as not to become a frog. such as Nodejs, scale and so on.

About Ruby

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

Originally, the rails framework had its own server,webrick. Looking at Log is a very efficient development.
If you want to deploy, it is also absolutely convenient to use passenger.
The template system of the views layer, the ERB should be more beautiful than the various Python, and more simple. I used Django before and felt too heavy.
Rails can keep you amazed by the way the program can be written, the first time I saw a 7.days.ago, I was shocked.
Rails emphasizes a DSL, one that fits people's language habits, and I think it's a programming language subversion, and we're not using a particular language (such as Ruby) to implement a function (like writing a compiler in C or Java), Instead, I can define a new language based on these languages (a lexical grammar generator like LEX,YACC). Look at the settings of ROUTES.RB, how surprised, this is the program, is simply poetry. Beauty is not only in content, but also in form.

The downside of Ruby or Rails may be that the curve of learning is too steep, I've had MVC experience before, and maybe it took me three weeks to get started, and perhaps I'm not ror, but the more precise question is that Rails has too many idioms: Of course, I'm using ActiveRecord. When you take the data, you can write Findbysql ("Blablabla"), but look at Rails ' documents, he provides methods similar to Joins.Group.Select and so on, regardless of whether efficiency is really faster, write less SQL in. RB In the file will not be more beautiful. Then to later, occasionally found that there is metawhere this kind of thing, is also painful to abandon the past learned that a pile of works but not elegant things, hesitate to devote to metawhere study.

Of course, if you don't pursue perfection, it's not so scary to get started.
About Python

Python has many advantages, such as:

Simple syntax, no compilation required. Python syntax is simple and efficient, a word "life is too short, I use Python" what all explain, high efficiency is the characteristics of Python.
Powerful data structure. The Python development environment, which is installed by default, already comes with many advanced data types, such as lists, tuples, dictionaries, collections, queues, and so on, that you can use to manipulate these data types without further programming. Using these data types makes it very easy to implement abstract mathematical concepts.
Force indentation, which naturally makes your code look organized.
Plug-in complete, can complete most of the program design tasks.

Of course, there are many, but also can go to see "design philosophy of Python" 31 this chapter.
Summary

There is no best language, only the most appropriate language.
There is no bad language, only bad programmers.
No language is omnipotent, only one language is absolutely impossible.

What language is not important, the most important is efficiency: development efficiency and execution efficiency. PHP32 Grammar is silly, not a little dazzle, but generally learn C, JS, as and so on, it is easy to get started, because there are a lot of grammatical overlap place. Many people can not see PHP, said PHP is too simple people, often because of PHP itself is not enough to understand, in fact, PHP inside the General people use very little, more than 5.3 of the features also slowly let this language vivid, the more you go deeper, the more you can find its strength and advantages.

Here are just a few examples of Php,python and Ruby, allowing readers to better select the language of study.

The language is not good or bad points, Just follow your passion.

Date:2015-01-11 13:30:01

Author:sunx

created:2015-01-11 Sun 13:39

Emacs 24.4.1 (ORG mode 8.2.10)

Validate

Php-python-ruby

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.