4. PHEELOSOPPHHY Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves. Principal OF Least Astonishment (POLA) And after two years of C++ programming, it still surprises me. ( Matsumoto said this NOT @phoenixwizard )
5. As of 2010, there are a number of complete or upcoming alternative implementations of Ruby, including YARV, JRuby, Rubinius, IronRuby, MacRuby, and HotRuby.
6. Seeing Everything as an Object “ I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python3.” 5.times { print "We *love* Ruby -- it's outrageous!" }
7. Blocks, a Truly Expressive Feature search_engines = %w[Google Yahoo MSN].map do |engine| "http://www." + engine.downcase + ".com" end
8. Ruby’s Visual Appearance var could be a local variable. @var is an instance variable. $var is a global variable.
9.
10. "[%s]" % "same old drag" # => "[same old drag]" x = %w{p hello p} "<%s>%s</%s>" % x # => "<p>hello</p>"
11. Use enumerations to cut down repetitive code (DRY) %w{rubygems daemons eventmachine}.each do |x| require x end
12. Use enumerations to cut down repetitive code (DRY) %w{rubygems daemons eventmachine}.each do |x| require x end
13. Rescue blocks don't need to be tied to a 'begin' def x # ... rescue # ... end
14. FRAMEWORKS (OTHER THAN RAILS) LET ME FIRST TALK OF RAILS FOR FEW SECONDS !! THE WEB DEVOLPMENT THAT DOESNT HURT
15.
16. mERp Like Ruby on Rails, Merb is an MVC framework. Unlike Rails, Merb is ORM-agnostic, JavaScript library agnostic, and template language agnostic, preferring plugins that add in support for a particular feature rather than trying to produce a monolithic library with everything in the core. In fact, this is a guiding principle of the project, which has led to third-party support for the ActiveRecord, DataMapper, and Sequel ORMs.
17. Vintage Vintage is a very small web framework written in Ruby based on the original idea of Merb: Mongrel serving up ERb (Embedded Ruby) templates. The idea has been expanded and now Vintage helps you serve up ERb, HAML, Textile, Markdown, and Markaby templates.
18. Ruby is Productive and Fun For me, the purpose of life is, at least partly, to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, so Ruby is designed to make programmers happy. I consider a programming language as a user interface, so it should follow the principles of user interface. Yukihiro Matsumoto (a.k.a. “Matz”), 2000, emphasis added
19. What are the principles of good user interface? Here are the three principles with supporting quotes by Matz: Principle of Conciseness : “I want computers to be my servants, not my masters. Thus, I’d like to give them orders quickly. A good servant should do a lot of work with a short order.”
20. Principle of Consistency : “... a small set of rules covers the whole Ruby language. Ruby is a relatively simple language, but it’s not too simple. I’ve tried to follow the principle of ‘least surprise.’ Ruby is not too unique, so a programmer with basic knowledge of programming languages can learn it very quickly.” Principle of Flexibility : “Because languages are meant to express thought, a language should not restrict human thought, but should help it. Ruby consists of an unchangeable small core (that is, syntax) and arbitrary extensible class libraries....”