Standing on the shoulders of giants
- first place to look in rails code
- routes
- start by looking at the url, use routes to look deeper in the 'hood'
- notes
- amazing intro lol
- hilarious pictures
- not a talk about identify - l
- learning from other people
- "if I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
- be responsible for legacy code
- Why stand on the shoulders of giants?
- "To see further"
- To really learn from the masters
- understand the domain
- "listen & learn"
- Control your destiny
- constantly refactor your code
- actually learn and get better
- We all write legacy code
- time passes, and shit gets old
- Protect yourself from, five days ago
- You're surrounded by idiots
- avoid really bad code
- a little less than 50% of people suck
- Why is reading code hard?
- languages that aren't Ruby
- not everything will be ruby
- ruby is good to learn off of, nice and clear
- Unfamiliar idioms
- Code Written by non-heroes
- The skills that pay the bills
- a hemet with a light on it
- go exploring "spelunking"
- "where no one has gone before"
- make a plan and execute it
- one part of this code you need to figure out right now
- don't get distracted by alternate caves
- use your tools
- find and grep are your friends
- don't chase rabbit holes
- Examples
- xmlrpc4r - michael neumann
- standard library, on all of our machines
- Beast - Rick Olson, Josh Goebel
- find(:stuff)
- find out that user is admin by following routes, user.admin true if users < 0
- authenticated_system.rb - Rick Olson
- might be legacy after dhh's keynote
- Rake - Jim Weirich
- acts_as_versioned - Rick Olson
- Spelunking Rails Recipe - Adam
- bullets
- Grok any methods the ation calls
- Check the template any helpers it might use
- Grok the controller action
- Grok any controller filters
- Check out the controller or skip directly to the view
- Look at the URL, cross reference with routes.rb
- Rails spelunking, the preface
- filters defined in ApplicationController or helpers in ApplicationHelper
- Observers,validations,callbacks,etc. defined in models
- code in lib or plugins
- Anatomy of a plugin
- init.rb is called by rails
- framework-punching involves including or extending classes in AR,AP,etc ("monkeypatching")
- Metaprogramming skillz
- class_eval to manipualte classes at runtime
- RJS - Marcel Molina Jr. and Sam Stephenson