News for hackers. Stuff that matters.
Re:Ask HN: What lessons did you learn from your best or wors... by mdaniel on Saturday May 15, 2021 @08:04PM (#27170076)
> Every if statement

... has an "else" whether it's written or not. Choose carefully whether to skip writing it, but always know it's there

I try to impress that not as much upon developers, but religiously upon folks writing requirements. Many pieces of code work just fine without the else, but the amount of bugs and rewrites due to someone either not considering "but of course it always succeeds!" or because there was an implied else scenario in their head that they just didn't bother to write down are almost innumerable.

Re:Ask HN: What lessons did you learn from your best or wors... by flqn on Sunday May 16, 2021 @01:07PM (#27175138)
This, so much. Every branch or decision point in either the domain model/flowchart/spec/etc or implementation should be carefully considered. This applies doubly so to error handling. Also, try to make the code paths look like or at least be recognisable by the spec. Try to keep one mental model of what happens that the team all share.