Hacker News new | ask | show | jobs
by chowells 517 days ago
This is pretty spot-on. A culture of testing everything will ossify code by not understanding what a "unit" is and amplifying developer churn by testing implementation details instead of the actual units. A culture of just getting features out the door will suffer under the weight of every change dragging on all future changes.

If you want to really get code that can be adapted whenever requirements change, you need to be thoughtful. Understand the code you write. Understand the code you choose not to write. Understand the code that was there before you got there. Think about the edge cases and handle them in a way that makes sense.

I'd call it "practicing writing code without bugs" rather than "writing code without bugs", though. In the end it's a practice. Is it going to be what you work towards every day, or is just an afterthought?

1 comments

> Understand the code you write. Understand the code you choose not to write. Understand the code that was there before you got there.

Yup. I have seen so many people write stuff that could just be a YAML script, tying together massive dependency trees that they have no clue about.

Then, they lose it, when things go pear-shaped.

However, if the goal is to sell the company before the chickens come home to roost, it's a feature, not a bug.