Hacker Newsnew | past | comments | ask | show | jobs | submit | invaderzirp's commentslogin

No, you just need to both understand how your system works and then clearly write down what it's doing and why. If projects like Postgres and SQLite and musl libc and the Linux kernel can all do it, I think the CRUD app authors can do it, too. But it's not magic, and another tool won't solve it (source: I've seen a hundred of these tools on scores of teams, and they don't help when people have no clue what's happening and then they don't write anything down).


Especially on teams where deviance has been normalized, and broken things are just expected. I've been bitten both ways before: is this an obvious mistake? Or the lynchpin holding up the house of cards? Of course, if someone had just written some text explaining it, or perhaps a decent commit message instead of just "WIP", maybe we wouldn't have to do archaeology every single time.


"Oh yeah, those tests are always flaky. We just rerun them until they pass. Or we turn them off. I mean, Jeff wrote them like three years ago and he quit last year, so..."

I'd rather have the prose. And if it's wrong, then fix it. I'm so tired of these excuses.


Erm, this is what docs are for. Like a man page, where it'll give you function signatures and return types and explain what those functions do. Unit tests are not that, and they shouldn't be that, because that's not their purpose.

New rule: if you write a function, you also have to write down what it does, and why. Deal?


What's stopping someone from reading the code, studying it deeply, and then writing down what it does? That's what I do, but I see people struggle with it because they just want to get more tickets done.


Nothing, sounds like a great plan.

But if you want other people to benefit from it, a good place to put it is right next to a test that will start failing as soon as the code changes in a way that no longer conforms to the spec.

Otherwise those people who just want to get more tickets done will change the code without changing the spec. Or you'll end up working on something else and they'll never even know about your document, because they're accustomed to everybody else's bad habits.

If you're going to be abnormally diligent, you might as well so in a way that the less diligent can approach gradually: One test at a time.


The code already says what it does.


Ah yes, states' rights being used to justify treating people poorly. Famously, this has never happened before ever.


Please stop spamming this conspiracy theory. It devalues the discourse. Thank you.


Ah yes, "we can't do anything before an election", despite it always being just before some election, and also it's totally okay when one party does it.


A lot of people's salaries depend on screwing over customers.


I've seen people argue for the most heinous shit here without so much as a slap on the wrist. HN isn't above politics, it's just above the _wrong_ politics.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: