Top 10+ Things .NET Developers Should Know About Ruby
1. Top 10+ Things
Every .NET Developer
Should Know About Ruby
Jeff Cohen
@jeffcohen
jeff@purpleworkshops.com
2. Windy City Rails
Sept. 12, 2009
Essential Javascript
Oct. 17, 2009
Rails for Everyone
Oct. 24, 2009
3. Top 10+ Things
Every .NET Developer
Should Know About Ruby
4. 1. History & Philosophy
SmallTalk C++ Ruby Java VB6 C#
1983 Perl 1993 1995 1996 2000
1989
5. 1. History & Philosophy
Yukihiro Matsumoto
"Matz"
6. 1. History & Philosophy
2003 Interview with Matz:
http://www.artima.com/intv/ruby.html
Minimal Interface vs. Humane Interface
What You Feel > What You Can Do
Sapir-Whorff Hypothesis
9. 4. Objects
Everything is an object
A class is an object
No "primitives."
You can pass classes around like objects
Easy reflection/introspection
10. 5. Messages
Think in Messages, not Methods
"hello".length
"hello".send(:length)
All message handlers (ok, fine: "methods")
return a value to the calling code
11. 6. Blocks
Extremely Common Ruby Idiom
Most Seen in Iterators
Anoymous Methods
Can Be Saved For Later Use (lambda)
12. 7. It's Just a Script
No compilation
A class "declaration" is code that's executing!
13. 8. Dynamic Typing
The type of an object is deduced at runtime
Open Classes
Object-Specific Type (enables Singleton Methods)
Strongly Typed even though not Statically Typed
IntelliSense is hard to do
14. In Case You Rant At Me
About The Lack of Intellisense
It rots your mind:
http://www.charlespetzold.com/etc/
DoesVisualStudioRotTheMind.html
It forces bottom-up design
It forces linear programming, not free-form
experimentation
It discourages Test-Driven Development
It's a sign that your API is TOO FREAKING BIG
15. 9. OOP
Use Modules to Mix-In Behavior
Don't Worry About Interfaces
Duck Typing
No Abstract Classes
17. 11. Even More...
Ruby Class Methods vs. .NET Static Methods
begin/rescue/ensure vs. try/catch/finally
String interpolation
Other new things: symbols, lambdas, closures
No method overloading
18. C'mon in - the water's fine!
Rails for Everyone
Oct. 24, 2009
$395.00
purpleworkshops.com