With RoR, often the focus is on how easy it is to build an application from the ground up. But, there is a whole different set of challenges when working on a mature application.
This talk will discuss the issues discovered when peeling back the layers of a 7-year-old pile of code. In the beginning, the question isn’t “How do I build this,” but more like “Where does this go” or “Where is this bug coming from.” I will discuss the sometimes-unintended consequences of introducing new features, tracking down and fixing ancient bugs, estimating the time a new feature will take to build given the many other peculiar surprises you will uncover, and finally how not to worry about the inevitable day when you will break everything.
The audience will hear from a developer who works with old code every day and get tips to make their future selves and successors less confused, more productive, and less unintentionally destructive.
http://goruco.com/speakers/2013/gill-julie/
7. Old Bugs
Congrats, you found a 5-year-old bug
- was it written like this on purpose?
- did it ever work?
- what else will break when I "fix" it?
# TODO: make this not suck
Specs help
8. StreetEasy Magic or Rails
Magic
Where is this logic coming from?
Can Google help?
url_for_model, link_to_dialog
Area[“manhattan”]
> def self.[](args)
self.send(args[:filter], line)
9. Building a Feature
How long is it going to take?
Need to rebuild
foundation code
Domino effect
10. Building a House of Cards
Fragile
Careful
examination
Care,
Caution,
and Patience
Editor's Notes
My name is julie juliethethrill Here to talk about large old codebases What does this have to do with a house of cards?
Is this about that netflix show with kevin spacey? No
I'm talking about this, a house made of carefully balanced playing cards Back up a little Graduated Pace CS Largest app, 10 models Freelance, school I built it all StreetEasy - 2005/2006 hundreds of models, billions of rows, pile of code This talk will hopefully prove an entertaining look at my first experience with huge old codebases How I have come to think of Large apps = house of cards, ready to crumble when you let your guard down
A ton of data City data user data listing data recorded sale histories I had never seen so much data In fact, my first script that had to do with listing amenities ran out of memory I was shocked, and hadnt ever had so much data that I had to optimize just to get it to run.
What is all this data? What does all this data mean? How does the code use it?
Detective work Never had to Debug, understanding, or fix other peoples code Inspecting elements Following the trail of views and partials Tracing methods in the debugger several levels deep Learning to follow and understand obscure trains of thought is a large part of my job
Specs help. Specs stop people from misusing your code Not spec'ing every piece of code But spec something you're afraid others will mess up
Ah the metaprogramming Sending what to who? If you've never seen meta programming before, this line can be quite the doozy. Chase down the method that is being sent, chase down the params being sent.
Domino effect Adding this feature might affect a distant piece of code somewhere Hopefully a spec will catch it If not, a really weird bug will soon pop up PAUSE
When dealing with other peoples huge old codebases, exercise the same care, caution, and patience with your code that you would when remodeling or building onto a house of cards. Thank you.