Presentation is loading. Please wait.

Presentation is loading. Please wait.

A TOUR OF RUBY 2011 ACM Class, Dong Xie. What is Ruby?  Dynamic programming language  Complex but expressive grammar  A core class library with rich.

Similar presentations


Presentation on theme: "A TOUR OF RUBY 2011 ACM Class, Dong Xie. What is Ruby?  Dynamic programming language  Complex but expressive grammar  A core class library with rich."— Presentation transcript:

1 A TOUR OF RUBY 2011 ACM Class, Dong Xie

2 What is Ruby?  Dynamic programming language  Complex but expressive grammar  A core class library with rich and powerful APIs  Draws inspiration from Lisp, Smalltalk and Perl  Easy for C and Java programmers to learn  Ruby is designed to make programmers happy. ——By Yukihiro Matsumoto

3  Optional parentheses  Parallel assignment  Punctuation Suffixes and Prefixes Simplified Expressions

4 Everything is an Object  Completely object-oriented language  Seeing Everything as an Object  even simple numeric literals and the values true, false and nil  Only single inheritance, the Mixin(Module)

5 Everything has a value  NO difference between expressions and statements  Everything has a value, even if that value is nil  Even control structures have their own value such as if, while, etc.

6 Classes are Open  Dynamic Programming Language  Not only dynamic-typed (like python, PHP, etc.)  Allows its users to freely alter its parts  Add, Remove, Redefine

7 Singleton methods  Per-object methods  Only available on the Object you defined it on

8 Iterators and Blocks  “A truly expressive feature”  Iterators —— loops  Blocks —— associate with a method invocation

9 Procs and Lambdas  Class Proc, Kernel.Lambda  Functions that can be manipulated as objects  Block as a single parameter  Instances of class Proc as parameters

10 And more…  Symbols are not lightweight strings  “Variable” constants  Fake keyword parameters  The universal truth  Missing methods  Metaprogramming capability  Packages —— RubyGems  ……

11 To learn more…  Official Site: http://www.ruby-lang.org/en/http://www.ruby-lang.org/en/  Ruby in a Nutshell  The Ruby Programming Language  The Book of Ruby  Programming Ruby  Ruby Cookbook

12 Any questions are welcomed… Q&A

13 Contact: xiedong1993@gmail.com Thanks for Listening


Download ppt "A TOUR OF RUBY 2011 ACM Class, Dong Xie. What is Ruby?  Dynamic programming language  Complex but expressive grammar  A core class library with rich."

Similar presentations


Ads by Google