News for hackers. Stuff that matters.
Re:The Performance Impact of C++'s `final` Keyword by dllthomas on Tuesday April 23, 2024 @12:19PM (#40133706)
> in my opinion at least, are a bit harder to screw up, so I will always prefer them

My experience is the opposite - a sizeable chain of ifs has more that can go wrong precisely because it is more flexible. If I'm looking at a switch, I immediately know, for instance, that none of the tests modifies anything.

Meanwhile, while a missing break can be a brutal error in a language that allows it, it's usually trivial to set up linting to require either an explicit break or a comment indicating fallthrough.

There are no comments on this comment yet.