Did You Run This Code?!
Phillip Harrington Nov 2024
TL;DR: Even if you’re making the tiniest of changes, always rerun your code. Always.
When I was a younger developer, I worked at a company that had a lot of developers grouped into small teams. Each team had an architect assigned to it, guiding the developers. One of the things the architect did was give a 1-on-1 code review to each developer every week.
I lived for this code review. I learned so much every time. It was the highlight of my week at work.
One week, I had some code I was particularly proud of. Right before the meeting I made one teeny, tiny change. Then saved the file, and breathlessly raced off to our architect’s cubicle.
He pulled up my file, took one look at it, looked at me with a stern expression, and said - in a very harsh tone,
“Did you run this code?!
“Get out of my cubical!”
My one teeny, tiny change prior to the meeting included a syntax error, which I had missed, and he immediately saw.
And that was it. That was my code review that week. I was crushed. I felt really, really dumb.
However, his harsh response drove the point home, and it’s been one of the best lessons of my career.
Even if you’re making the tiniest of changes, always rerun your code.
- Before hopping on a huddle.
- Before committing it.
- Before opening a PR.
- Before deploying it.
- Before a Code Review!
Always.
Yes. I know. It seems completely obvious.
But how often do we make the slightest change and just commit it? I’m guilty of doing this a lot, too, but then I ask myself, “Did you run this code?!”
Hal Abelson said,
“Programs must be written for people to read,
and only incidentally for machines to execute.”
But actually running code is a great sanity check!
Postscript
For fun I even added a label to my company's project GitHub called I Ran This Code for PRs.