Ruby Language: By: Mohamad Amin Rastgoo
Ruby Language: By: Mohamad Amin Rastgoo
overview
By: mohamad amin Rastgoo
The History of Ruby
● least surprise
➢ Network programming
➢ GUI programming
➢ XML programming
➢ Prototyping
➢ Programming education
Ruby Attribs
● Multi-paradigm programming language
● Methods: Every procedure in Ruby is a method of some
object.
● Blocks: blocks can be passed as a parameter to a
method
● No Declarations: variables distinguished by the prefix
of its name
Ruby Attribs
● Scope Prefix
● Inheritance and Mix-in
● Performance
● everything is open!
● Missing unary operators
● parallel assignment
● Mutable Strings
● True and false in Ruby
example
Classic Hello world example:
● Arrays
● Mutable Strings
● Constants
● enforced case-conventions
access
● Mixin's inheritance
● Open classes
Type system
Type Safe?
1.no operation will be applied to a variable of a
wrong type: probably safe
2.the program will not have type errors when it
runs:No
Type system -Strong Typed?
1.type annotations are associated with variable names,
rather than with values. If types are attached to values, it is
weakly typed: WEAKLY TYPED