Moving into a Code Base
Early this year, I moved into someone’s code base, and within the week moved into a house. Neither were new, but both were new to me. At the time, I thought little of it. I tend to separate my personal world and my work world in my mind, if not publicly. As I settled into the new code base and the new house, though, I begin to feel like my work world and my personal world were almost mirroring one another.
It seemed like cold snowflakes had been falling for weeks or months. Of course, the day we are to be out of our old house, it was about 38 degrees Fahrenheit, and raining. Cold rain. I hate cold rain. Nonetheless, by the end of the day, we had all of our belongings in our new house - cribs, beds, couches, end tables, dining table, coffee table, lamps, plants, stools, tools, etc. It never matters how much stuff you get into a new place. It doesn’t matter if you’ve had all of that stuff long enough that it smells like you. It doesn’t matter if you lay out your new living room just like your old living room.
In the end, it still feels like someone else’s house.
As I said, it’s fairly similar dropping into an existing code base for the first time. Sure, a lot of structural aspects are the same. There’s a garage, bedrooms, bathrooms, a kitchen; and those rooms function the same as their counterparts in other houses. This code base had mostly the same directories as other code bases I’ve been in. Still, once I got my database set up, the project’s various processes started, the tests running, it still felt like someone else’s code base.
I’ve a yellow labrador retriever, nearly nine years old. She doesn’t much like having to stay in new places, and she hates hardwood floors. She spent the first few days sniffing everything suspiciously, and whining. When I (and the weather) let her spend some time in the backyard, she ran around like a puppy. She found sticks to run around with and chew. She chased people walking the sidewalk with their dogs just on the other side of the fence. When she came inside, she sniffed and whined some more, but with a bit less feeling.
My lab did two things: she explored as much as she could as often as she could, and she found something she liked (the backyard) and made it her own. I still have to re-gather the sticks into a pile every week. It’s obnoxious, but I’m glad she’s happy.
We can do this with our code. Try to look at all of the code. List the contents of the more important directories. Read some of the code from the meaty files — the ones that probably hold the domain knowledge. Try to grab a healthy-sized feature to implement. Grab that stick, make it yours, run with it, but don’t neglect sniffing around the rest of the code every once in a while. It can be difficult to truly read every commit, but go back and list directories, and read through those meaty files again.
I’m writing this in my living room, and it truly feels like my living room. I know where all the outlets are (wherever it would be inconvenient for our furniture, that’s where). I know where the floor squeaks. If you were to turn out all of the lights while I’m on this couch in the middle of the night, I’d be able to make it to my side of the bed without breaking a toe.
All of that, and I didn’t even whine that much. Unfortunately, the significance of that is totally lost on my dog.