How to Learn Ruby

Source: Internet
Author: User
Tags learn ruby on rails

Tip: This article is a learning methodology. Don't like it.

I started paying attention to Ruby from the end of, and invested in Ruby development in, and it continues until today. From my graduation to the present, I have also used VB, Java, JavaScript, and C/assembly in addition to Ruby, because I have studied electronics and hardware, so there is no good learning algorithm-related content, so this article will not involve the content of algorithm learning. This is my hard injury as a programmer. Of course, I am still learning algorithms, did not give up on it.

Like most Rubyist, I also learned Ruby from Rails. Before I learned Rails, I was using the SSH framework struts + spring + hibernate of JavaEE ), at that time, it was also the stage of getting started with Java, and I was not doing much deep. I was dazzled by Various XML configurations, and I was a little desperate for Java: is it because I will deal with XML in my later programming career? Rails conventions are more than configuration, DRYDon't repeat yourself) and other concepts, which deeply attracts me. Using Rails, there is no need to bother with the XML configuration, I only need to concentrate on writing my Ruby code. This is a happy programmer. I don't know how many people have similar experiences with me? I think there should also be many people.

Speaking of Rubyist, I never understood why Rubyist is not Rubyer or anything else? Later, I realized that Rubyist is a bit of an Artist. The Ruby language is the most artistic in the programming field, so we call Ruby programmers Rubyist. But in fact, many people are still far away from the real Rubyist, including myself.

Ignorance:

After this stage, I am very familiar with the mood of beginners: "Isn't it 15 minutes to develop a blog? Rails is very studious, easy to use, and fun. I want to master it quickly 」. Many Rubyist beginners are Agile web development with Rails and Programming Ruby. Basically, you can get started after reading and practicing these two books. Of course, many outstanding books have emerged to Learn Rails, such as "Ruby on Rails Tutorial" and the "Learn Ruby on Rails" crowdfunding on kickstarter recently 」, there is also the official "Ruby on Rails Guides", which is not as good as the official documentation when I started learning.

With such rich information, we have almost no difficulty in getting started with Rails. But have you found that you have fallen into a huge detail. This huge detail refers to Rails.

We initially learned Ruby with the goal of mastering Rails. Therefore, in the subconscious, we put Ruby in the second place, and Rails became the first learning goal. After you get started with a variety of reference books, you may be able to develop a simple web site or use your Rails skills in general work, but you will find that, you will eventually reach a learning bottleneck. One of the advantages of the Rails community is that there are a lot of gems and various gems allow you to develop quickly. But do you really understand these gems? Development is not a simple function stack.

When you hear that Cucumber is popular, you are confused about choosing Cucumber or Rspec. The rise of MiniTest makes you more confused. Which one should I use?
When you hear that Rails4 uses thread security by default, do you know what thread security is? Isn't Rails3 thread-safe? What is the default significance?
When you hear that sidekiq saves more memory than resque, you immediately want to try to use sidekiq instead. Have you ever wondered why? Sidekiq is better than resque?
...
And so on.

At this time, we only stopped in the use phase! Because you are already in the details of Rails, and you ignore Ruby.

So now, you are just a Ruby coders, far away from Rubyist.

In-depth

As you can see, everything you use is built on Ruby: Rails, Sinatra, Cucumber, RSpec, Sidekiq, and Resque.
Ruby + Web development knowledge + architecture ideas-> Rails/Sinatra
Ruby + TDD/BDD and other agile practices-> Cucumber/Rspec
Ruby + multithreading/multi-process concurrency-> Sidekiq/Resque
Ruby + Actor concurrency model-> Celluloid
Ruby + Socket + Reactor-> eventmachine/Goliath
...
And so on

Therefore, if you want to gain an in-depth understanding of the above tools, you need to systematically learn Ruby and learn relevant domain knowledge in the process of learning Ruby, this is a virtuous cycle.

Ruby is a magic language that is object-oriented and has both functional programming features, at the same time, you can go deep into the features of the object-oriented and functional programming paradigms.

So when we talk about Ruby in depth, we are not talking about how to use Ruby syntax, but about:

1. the design philosophy behind Ruby and its underlying implementation.
2. Interaction between Ruby and systems in other fields, such as web
3. How does Ruby build a beautiful DSL based on its object-oriented and functional programming features and its meta-programming capabilities?

At this stage, you may be able to break away from the Ruby coders and reach a new level, which is very close to Rubyist.

Philosophy

If algorithms must be mastered by qualified programmers, then the philosophy must be understood by qualified programmers.

I am not a Master of Philosophy. Do not misunderstand me.

Philosophy is the soul for us to learn and solve problems. Here I will only share a few of my philosophical experiences:

1. Being heavy is the root of light, and being static is the master of rashness.

Ruby can be used flexibly only when the foundation is solid.
When we encounter a problem, it's useless to worry about it. Let's calm down and think about it.
When we are learning, don't rush for success. Let us calm down and learn. Slow means fast.

2. existence is reasonable.

My understanding of this sentence is that when a program encounters a strange bug or your project can be used on your machine but cannot be used on the server, you should think about it. This is not a strange problem. The program is executed according to your instructions. It must be something wrong with you, and it may be a serious problem! Take this issue seriously!
When I came across a concept, I should think about the rationality of this concept. For example, TDD/BDD. Why is there BDD with TDD?

3. Philosophical classics: Where did you come from? Who are you? Where are you going?

When we learn new technologies, we should ask:
What are the reasons for this technology, or what problems it is designed to solve? Where did you come from ?)
How is this technology implemented? How can this technology be used? Who are you ?)
Is the problem solved by this technology permanent? What will happen in the future? What technologies are similar to this technology and how are they developed? Where are you going ?)

Summary:

This article is not so much about "How to Learn Ruby" as "how to learn", because the above methodology applies to learning anything.

P.S comes with a brief outline of the "attractive Ruby" Course Plan:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1219411259-0.png "alt =" rubyroadmap.png "style =" margin: 0px; padding: 0px; height: auto; "/> rubyroadmap.png

Finally,

I hope you will pay attention to the public account RubyStudy and discuss any questions with me, including your own opinions on this article.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/121941N09-1.png "alt =" 10-30 7.02.17.png "style =" margin: 0px; padding: 0px; height: auto; "/>


This article is from the "wudaoji" blog, please be sure to keep this source http://blackanger.blog.51cto.com/140924/1338843

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.