How to learn Ruby? Ruby Learning tips Sharing

Source: Internet
Author: User
Tags ruby on rails learn ruby on rails

How to learn Ruby? What do you need to know before you learn Ruby? This is a lot of people want to learn the voice of Ruby friends, I do not give a specific answer, the following to tell you about a predecessor learning Ruby (http://www.maiziedu.com/course/ruby/) learning process it. I majored in electronics at college, I learned c/assembler in school, I learned about Ruby in the early stages of Ruby, and most of rubyist, and I started learning about it from rails, and I was using Java EE's SSH framework before I learned rails (struts+ Spring+hibernate), at that time was also the beginning of the Java stage, and did not do much deep, various XML configuration, I dazzled, to Java suddenly a bit desperate: is not my future programming career and XML deal with it? The Rails convention is larger than the configuration, DRY (Don ' t repeat yourself), and so on, I'm fascinated, using rails, and no longer bothered with a lot of XML configuration, I just concentrate on writing my Ruby code, this is the happy programmer. Oh, I do not know how many people and my experience is similar? I think there are a lot of people, too.

Speaking of Rubyist, I did not understand, why call rubyist, not rubyer or other? Then I understood, Rubyist, a little artist. The Ruby language is the most artistic in the field of programming, so we call Ruby programmers rubyist. But in fact, a lot of people are far from the real rubyist, including myself.

Ignorant:

It is through this stage, so I understand the current beginner's mood: "Not 15 minutes to develop a blog?" Rails is very studious, very useful, very fun, I want to quickly master it. " Many of Rubyist's introductory books are "agile Web development with rails" and "programming ruby", and basically, if you read through the two books and practice, you can get started. There are, of course, a lot of good books on rails, such as "ruby on Rails tutorial" and recent Kickstarter "learn Ruby on rails", and the official "ruby on Rails guides", When I started studying, the official documents were not so good.

With such a wealth of information, we have little difficulty in getting started with rails. But have you found that you have fallen into a great detail inside. The big detail I'm talking about is the rails.

The goal of our initial learning of Ruby was to master rails, so the subconscious, Ruby's learning was put in second place, and rails became the first learning goal. After you've read through a variety of reference books, you may be able to develop a simple Web site or apply your rails skills to a general job, but you'll find that you end up with a learning bottleneck. One of the benefits of the rails community is that there are a lot of gems, all kinds of gems that allow you to develop quickly, but do you really know these gems? Development, is not a simple feature stack.

When you heard that now popular cucumber, so on their choice of cucumber or rspec feel confused, minitest rise, and let you feel more confused, I should use Which?

When you hear that RAILS4 is thread safe by default, do you know what thread safety is? RAILS3 is also thread-safe? What does the default mean?

When you heard that sidekiq than resque more memory, immediately want to try to switch to Sidekiq, have you ever thought, why? Sidekiq better than Resque wrote?

。。。

Wait a minute

At this time, we only stop at the use stage! Because you're stuck in the details of rails, you're ignoring Ruby.

So, at this point, you're just a ruby-yard farmer, far from Rubyist.

Depth

As you can see, everything you use is built with Ruby: Rails, Sinatra, Cucumber, RSpec, Sidekiq, Resque, and so on.

Ruby + Web Development knowledge + architecture ideas-Rails/sinatra

Cucumber/rspec, agile practices such as Ruby + TDD/BDD

Ruby + multi-threaded/multi-process concurrency-sidekiq/resque

Ruby + actor Concurrency model-celluloid

Ruby + Socket+reactor-Eventmachine/goliath

...

Wait, wait.

So, if you want to learn more about these tools, you need to study ruby in a systematic way, and in the process of learning Ruby, to learn the relevant domain knowledge, this is a virtuous cycle process.

Ruby is an object-oriented and functional programming feature of the Magic language, so as you delve into Ruby, you can also delve into the characteristics of both object-oriented and functional programming paradigms.

So, when we say that we're learning more about Ruby, we're not talking about how Ruby's syntax should be used, it's saying:

1 The design philosophy behind Ruby and its underlying implementation.

2 Ruby interacts with the system (including other domains, such as the web)

3 How Ruby builds a beautiful DSL based on its object-oriented and functional programming features, and its meta-programming capabilities

At this stage, you may be out of Ruby's hierarchy, reaching a new level that is already close to rubyist.

Philosophy

If the algorithm is a qualified programmer must master, then philosophy, but also a qualified programmer must understand.

I am not a master of philosophy, please do not misunderstand.

Philosophy is the soul of our learning and solving problems, and I am only here to share a few of the philosophical experiences I have used:

1. The weight is light fundamental, static is the master of mania.

Ruby, only a solid foundation, can be used flexibly.

When we encounter problems, anxious useless, calm down to think, clues, to find the problem.

When we learn, do not be anxious, calm down to learn, slow is fast.

2. Existence is reasonable.

In this sentence, my understanding is that when the program has a strange bug, or, when your project can be used on your machine, and to the server is not available, you should think, this problem is not strange, the program is executed according to your instructions, it must be where you went wrong, and may be a serious problem! Please take this issue seriously!

When learning, encounter a concept, should think more about the rationality of this concept, such as TDD/BDD, with TDD why there will be BDD?

3. Philosophical Classics Three questions: Where do you come from? Who are you? Where do you want to go?

When we learn the new technology, we should ask:

What is the technology based on, or is this technology being created to solve problems? (Where did you come from?) )

How is this technology implemented? How is this technology going to be used? (who are you?) )

Is the problem of this technique permanent? What will be the future development? What are the technologies that are similar to this technology, and how are they developing? (Where do you want to go?) )

Summarize:

This article, rather than "How to learn ruby", say is "How to learn", because the above methodology, applies to you to learn anything.


How to learn Ruby? Ruby Learning tips Sharing

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.