Great quote I saw today:
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
-- Brian W. Kernighan
Ma homie Kernighan! Nigga wrote the book on C. Incidentally not many people know this about ma homie, he used to be known on the streetz as… ah shit, I promised him I would keep his days back in da hood a secret.
Speaking of debugging, that shit is hard. As in not the skill, just the work itself, its hard ass work. Debugging is getting into the mind of the asshat who wrote some fancy ass code that for some reason isn’t working as it should on a production system. Thats right, getting into this asshat’s mind. Nigga was probably high as shit when wrote this shit. Probably why they fired him. It don’t matter, your sorry ass gotta fix it. At that moment, you are thinking, “But they pay me to write code”. Nigga please!!!
Writing some shit is easy. Its what you learn when you read some tutorial about some new ass technology. That shit comes easy. Debugging some shit that some other borke ass nigga wrote. Thats what ma homie Kernighan is talking about. That shit is hard. Its like a climbing mount Everest or some other mystical shit. If you havn’t done it yourself, you dont know what its like. Lets face it, code is not easy to read. Someone had to do a lot of mental gymnastics, and map a lot of high level concepts to the constructs of some programming language. This mapping is expressed in the code. Can you see it? No you can’t! And that asshat who wrote is nowhere to be found.
So the next time you write some code, think about the reader. Think about who will have to fix it. Develop the skill to debug. The skill to read code with ease. With our without a debugger. Learn to read stack traces. Learn how to GET stack traces. Learn what is good logging and what is useless logging. Learn the tools to help you find out more when shit ins’t working as it should.
Writing new code is easy. Creating new systems is easy. Find the root cause of some weird ass delays that only show up on your production system is hard.
tl;dr: at some stage in your programming career, you will have to fix some code/system that some asshat created