News for hackers. Stuff that matters.
Re:The Compiler Is Your Best Friend, Stop Lying to It by threethirtytwo on Wednesday December 31, 2025 @01:32PM (#46446864)
False it has value. It’s actually even better to log it or throw an exception. print(“this cannot happen.”)

If you see it you immediately know the class of error is purely a logic error the programmer made a programming mistake. Logging it makes it explicit your program has a logic bug.

What if you didn’t log it? Then at runtime you will have to deduce the error from symptoms. The log tells you explicitly what the error is.

There are no comments on this comment yet.