by lll-o-lll · 3y ago · 0 comments
When I first started programming for actual money (an embarrassing number of years ago now) I remember the old guy mentoring me wouldn’t let me use a debugger. “You have to think through the code, the debugger is the last resort”. I didn’t agree, it just looked like masochism and bravado from someone who hadn’t had good tools so I should suffer too.
Now that I’m the old guy, I recognise the wisdom. Stepping back, thinking through the problem, and you can write all that code without the inefficiency “run” “error” “modify”.
Or maybe that’s just how us old guys think.
These days, I work on buzzwords like kubernetes, microservices and Go and I likely couldn't use a debugger for customer issues even if I wanted to. Instead, I rely on a mix of intuition, logs and sometimes blind luck. I wonder if I've accidentally ended up in a domain that isn't that difficult. Or perhaps my luck will run out and I'm going to hit a debugging brick wall some day in the future.
Easy problems / bugs require next to no hypothesis. You just see the error, backtrace or whatever and can go fix it.
But harder bugs and system bugs usually require information gathering and analysis of that information to figure out and form a good hypothesis. To do that, just like your mentor said, you need good knowledge of the code and good understanding of what the information is telling you and what that can suggest or rule out.
But this is all very different from “just” thinking through the code. If anything, my cognitive capacity has declined significantly with age. I depend heavily on tools to shorten the paths I have to think through in the first place. And tests (if you’re doing TDD anyway) are just a more efficient “run, error, modify” after all.
Having said that, I am quite keen to not learn from my experoence and I keep doing a thing I know doesnt work.
Sometimes you have to slow down to go faster.