The Parable of the Novice Programmer
12th Jan - 2025You’re in your second year of university, going to a competitive programming event. It’s Google’s hashcode. You’re in a team and there’s a few others. One of those teams consists of lecturers, including the head of your school, and they have about 10 degrees between them.
It’s a bit more than your team’s 0 degrees, but you think fuck it. You’re with your friends and there’s free pizza — which saves you buying and cooking a meal this evening. It’s your first event like this, so let’s give it a go and see what it’s like.
The problem statement gets released, and you’re waiting for your hardly-earned pizza to arrive. You nab a large whiteboard and plan out your approach. The pizza arrives, you eat and you finalise your approach. The bulk of the time passes you by.
Your approach mostly makes sense, but it feels like there’s a few ways that you could make it quicker. Fuck it, you decide. There’s not a lot of time left. Let’s build it.
The 4 of you crowd around your eBay-special laptop, held together with tape. You open whatever editor your course recommended, which is nice because it’s easy to run the program in there.
You open your trusty main.py
file and directly translate your whiteboard into code. Functions? Nah. Logic with a bunch of calls to print()
to make sure everything’s progressing as expected.
You run your code. A couple of minutes pass, and after lines of text cascade from your interpreter you have your solution. There’s 10 minutes left. You submit your solution.
Looking at the leaderboard, you’re at the top. The top? you think. Where are the lecturers? They’re too busy worrying about their implementation to actually submit something. They decide to cut a few corners, because they need to remind the room that the people they’re learning from are actually capable (and they really were).
The leaderboard updates. A new contender — in second place! Time runs out, and you’re still at the top. Full of pizza. After some chat, comparison, and a few “wtf” faces at your mess of spaghetti code, you amble home on a warm summers evening, making sure to check in on the pub on the way.
This happened to me during my studies. I read a post about “programming like it’s your first time” and it reminded me of my own experience. The thing to take from this is that good is often better than perfect — and that’s especially true when you’re building something. Implementation generally doesn’t, as much as it pains me to say. What matters most is the outcome.