9 ms·
A wise practice. As a young egotist I would often omit parens in complicated C expressions. I did this intentionally and in a very self-satisfied way - writing
by cannam 7y ago
A wise practice.
As a young egotist I would often omit parens in complicated C expressions. I did this intentionally and in a very self-satisfied way - writing multi-line conditionals and lining them up neatly without parens with a metaphorical flourish of my pen.
Then one day, chasing a hard-to-find bug, I realised it had happened because I'd mixed up the precedence of && and || in a long conditional. I was an idiot. Since then I've made a point of reminding myself that I know nothing and that there's nothing to be gained from pretending I do, and putting parens in everywhere.
Sometimes, even now, I get those grandiose moments when I think the code I'm writing cannot possibly go wrong. Those are the moments that call for a bit of fresh air and an extra unit test or two.
- NotSammyHagar 7y agoThat's a great observation. Passing on that expertise is what wizened veterans can do to move our capabilities along and not let learning go to waste. I've heard that a big reason for sometimes struggling software engineering quality in countries and companies is places where the only way to grow is to become a manager - you need people to stay in technical paths so they can pass on that learned knowledge.
- nerpderp82 7y agohttps://news.ycombinator.com/item?id=3842713 https://news.ycombinator.com/item?id=3842713
- codebje 7y agoI heard an aphorism once I've tried to live by since: It is twice as hard to debug code as it is to write it. If you write code as clever as you can make it, you will never be able to debug it.