GettingYour Ruby
EGOT
ChannelYour Inner Tracy Jordan
EGOT?
Emmy
Grammy
Oscar
Tony
Ruby EGOT?
MRI
JRuby
Rubinius
MacRuby
MagLev
Topaz
...
Ruby EGOT?
But...why?
Because!
A Side Note on
Reading Code
Read Code
A Side Note on
Reading Code
Read Code!
A Side Note on
Reading Code
Read A Lot of Code
A Side Note on
Reading Code
Read Twice as Much
Code asYou Write
A Side Note on
Reading Code
Read Ten Times as Much
Code asYou Write
A Side Note on
Reading Code
Read Code
What’s in a Ruby?
Objects!
What’s in an Object?
Class
InstanceVariables
Methods
Data Actions
What’s in an Object?
Class
InstanceVariables
Methods
Data Data
Data StructureData Structure
How Do I Build An Object?
Class
InstanceVariables
Methods
How Do I Build An Object?
How Do I Build An Object?
Uhh...Josh? RBasic?
Glad you asked!
Dirty, dirty tricks!
Dirty, dirty tricks!
Dirty, dirty tricks!
Dirty, dirty tricks!
Dirty, dirty tricks!
How Do I Build An Object?
• Data Structure for Object Data
- Class
- InstanceVariables
• Data Structure for Methods
How Do I Build An Object?
With Objects!
C Doesn’t Have Objects!
Java
Objective-C
SmallTalk
Python
Ruby
C++
C++
C++! C++!!!
In a perfect world...
• Blocks as arguments
• Crazy Names
• Metaclasses Singleton Classes
• Modules
I want my EGOT!
The Bug
Matz’s Ruby
Interpreter!
string.c
Find the method...
Hint: grep is your friend!
Oh, MRI...
Break it down...
If “other” is a string, do a string comparison
(in the else clause...yay)
Break it down...
If “other” can not be converted
into a string, return nil
Break it down...
If “other” also doesn’t have its own
comparison operator, return nil
Break it down...
If “other” does have its own
comparison operator, call it and
return the negation of the result
The Fix
JRuby!
core/src/main/java/org/jruby/RubyString.java
Find the method...
Well, if MRI does it...
The Fix
The Fix
The Fix
Rubinius!
kernel/common/string19.rb
Find the method...
The Fix
The Fix
The Fix
in:
kernel/common/string20.rb
If you program in Ruby,
you can contribute to
Rubinius
MacRuby!
string.c
Find the method...
I feel like I’ve seen this somewhere
before...
The Fix
Topaz!
topaz/topaz/objects/stringobject.py
Find the method...
The Fix
The Fix
MagLev!
src/kernel/bootstrap/String.rb
Find the method...
Hmm...primitive_env?
...uh, maybe next time
But...why?
Brain Exercise
But...why?
If you are a programmer...
Ruby is just another program
But...why?
If you are a Ruby programmer...
Ruby is a program you use every day
If you get to know Ruby better...
You will be a better
Ruby programmer
KNOW ALL THE RUBIES!!!
Questions?
@manhattanmetric https://github.com/jballanc
Upcoming SlideShare
Loading in...5
×

Getting Your Ruby EGOT

175

Published on

Slides from the presentation that I gave in Berlin at EuRuCamp 2013.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
175
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Getting Your Ruby EGOT

  1. 1. GettingYour Ruby EGOT ChannelYour Inner Tracy Jordan
  2. 2. EGOT? Emmy Grammy Oscar Tony
  3. 3. Ruby EGOT? MRI JRuby Rubinius MacRuby MagLev Topaz ...
  4. 4. Ruby EGOT?
  5. 5. But...why? Because!
  6. 6. A Side Note on Reading Code Read Code
  7. 7. A Side Note on Reading Code Read Code!
  8. 8. A Side Note on Reading Code Read A Lot of Code
  9. 9. A Side Note on Reading Code Read Twice as Much Code asYou Write
  10. 10. A Side Note on Reading Code Read Ten Times as Much Code asYou Write
  11. 11. A Side Note on Reading Code Read Code
  12. 12. What’s in a Ruby? Objects!
  13. 13. What’s in an Object? Class InstanceVariables Methods Data Actions
  14. 14. What’s in an Object? Class InstanceVariables Methods Data Data
  15. 15. Data StructureData Structure How Do I Build An Object? Class InstanceVariables Methods
  16. 16. How Do I Build An Object?
  17. 17. How Do I Build An Object?
  18. 18. Uhh...Josh? RBasic? Glad you asked!
  19. 19. Dirty, dirty tricks!
  20. 20. Dirty, dirty tricks!
  21. 21. Dirty, dirty tricks!
  22. 22. Dirty, dirty tricks!
  23. 23. Dirty, dirty tricks!
  24. 24. How Do I Build An Object? • Data Structure for Object Data - Class - InstanceVariables • Data Structure for Methods
  25. 25. How Do I Build An Object? With Objects!
  26. 26. C Doesn’t Have Objects! Java Objective-C SmallTalk Python Ruby C++ C++ C++! C++!!!
  27. 27. In a perfect world... • Blocks as arguments • Crazy Names • Metaclasses Singleton Classes • Modules
  28. 28. I want my EGOT!
  29. 29. The Bug
  30. 30. Matz’s Ruby Interpreter! string.c
  31. 31. Find the method... Hint: grep is your friend!
  32. 32. Oh, MRI...
  33. 33. Break it down... If “other” is a string, do a string comparison (in the else clause...yay)
  34. 34. Break it down... If “other” can not be converted into a string, return nil
  35. 35. Break it down... If “other” also doesn’t have its own comparison operator, return nil
  36. 36. Break it down... If “other” does have its own comparison operator, call it and return the negation of the result
  37. 37. The Fix
  38. 38. JRuby! core/src/main/java/org/jruby/RubyString.java
  39. 39. Find the method...
  40. 40. Well, if MRI does it...
  41. 41. The Fix
  42. 42. The Fix
  43. 43. The Fix
  44. 44. Rubinius! kernel/common/string19.rb
  45. 45. Find the method...
  46. 46. The Fix
  47. 47. The Fix
  48. 48. The Fix in: kernel/common/string20.rb
  49. 49. If you program in Ruby, you can contribute to Rubinius
  50. 50. MacRuby! string.c
  51. 51. Find the method...
  52. 52. I feel like I’ve seen this somewhere before...
  53. 53. The Fix
  54. 54. Topaz! topaz/topaz/objects/stringobject.py
  55. 55. Find the method...
  56. 56. The Fix
  57. 57. The Fix
  58. 58. MagLev! src/kernel/bootstrap/String.rb
  59. 59. Find the method...
  60. 60. Hmm...primitive_env?
  61. 61. ...uh, maybe next time
  62. 62. But...why? Brain Exercise
  63. 63. But...why? If you are a programmer... Ruby is just another program
  64. 64. But...why? If you are a Ruby programmer... Ruby is a program you use every day
  65. 65. If you get to know Ruby better... You will be a better Ruby programmer
  66. 66. KNOW ALL THE RUBIES!!! Questions? @manhattanmetric https://github.com/jballanc
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×