News for hackers. Stuff that matters.

safety-second

Re:You’re better off using Exceptions on Monday February 03, 2020 @02:41PM (#22228106)
You could use a File class that throws on EOF, but that would be a really bad idea for C++ since throw/catch are very expensive.
Re:You’re better off using Exceptions on Monday February 03, 2020 @02:37PM (#22228074)
C++ exceptions are only good if you use them like signals from C or panics in Go. This means you have to use error values for 99% of errors or you lose this benefit. The fact that the STL sprinkles exceptions everywhere doesn't help this. C++ exceptions are so non-deterministic and slow that every real-time system disables them just to be sure.