DHH Keynote
(notes taken by Luc Castera http://dambalah.com)
-----------
5 Years since I wrote Rails.
5 years in software years is an eternity.
'The notion that your legacy application was gonna be save by Ruby on Rails is not a useful notion'
Rails can't do much more than set you in a path. If it's not really about Rails, then it's about you.
Legacy is not a specific technology.
Legacy = old stuff we don't like
Legacy code is often written by people who thought they got it nailed. They might later realize that the app is legacy but not because of the application itself, but because of changes in ourselves. 'what the hell was I thinking?'
Code goes from Best Code Ever to Legacy.
Legacy
^
| _____/
| __/
| __/
| _/
|/
|_____________________________> Time
Best Could this can't
Code be sucks take it
Ever better anymore
Code is always the same. It's our perception of it that changes.
1. You are learning more
2. You start appreciating more levels of details. Start to care about details you never even see before.
Legacy software is a positive thing. It is showing you that you got better, you've grown.
Whatever you write today will become legacy.
You are in the 'Best Code Ever' phase now but it won't last. If you don't realize that, you will get dissapointed.
The best programmers write the most legacy software.
Liking your tools and what you do should speed up the process of going from 'Best code ever' to 'biggest ball of mud'
If you leave a project too soon, you are not gonna get the most of it.
'When you're green, everything turns legacy over night'
Inherent dilemma of being new to something:
1) you learn a lot of things really fast
2) but what you wrote you are not proud of.
There's no other way to become very good than to write a lot of legacy software.
Writing legacy software can feel like a waste of time. But it's necessary to grow,learn.
'Good software takes 10 years to write' - Joel
'Truly succesful software takes 10 years to write' - DHH
The goal to everybody should be: to write on software that will take 10 years to write.
'The single worst strategic mistake that any software company can make: Rewrite the code from scratch' Joel
37signals has the most legacy Rails code out there.. 5 year old rails code.
Broken window theory (see prag prog.)
Showing Basecamp code.
Application helper is very long (500 lines) and doesn't have a unifying theme. ---> Broken Window.
It doesn't have to be all or nothing. You can make a small impact, a small change. Make incremental changes. That's the secret of living with legacy software. You have to do it step by step.
'You have to live the code you touch in a better condition than you found it'
ApplicationHelper should really be empty ideally. ApplicationHelper is where you should put places that you don't know yet where to put. It's a staging phase. Things shouldn't stay there.
Garbage Can Theory --> a place where we dump things we don't know where to put. Example: ApplicationController or his GlobalController in BaseCamp