Or, “In search of the lazy programmer”
A slide with a fancy title (and #)counts Except this one Ask questions at any time Rules
Started with Progress v Dot R created 1991 Acquired 1996 MBO 2012 #1 Dot R and Me
New methodology Unit tests Separate Model from DB #2 A new way
Wanted modern, clean code Dynamic Code ! Yay! Separate Model from DB #3 A new way
Single base class All crud handled for any table Weekend of hard work Several beers in celebration #4 Success!
Need to add extra functionality (lookup etc) Explain methodology to other devs Use methodology in other systems Let’s fire it up and see ! #5 Time for change
Horrible code Dynamic everything. Arrgggh. Should be xxx rated Document it. That will sort it out #6 Failure !
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it” Brian Kernighan
Why this way ? Showing off how clever I was… Keep my job ;) However, it’s wrong wrong wrong #7 On Reflection
Needed lots of samey code I didn’t want to write the code (#1 lazy programmer) So, get the computer to do it #8 Code Generation
Consistency Predictable: No surprises Understandable Faster than you are #9 Code Generation
Maia uses templates ActiveRecord framework Roll your own Easy and productive #10 Summary