News for hackers. Stuff that matters.
Re:Writing a game engine in pure C: The Graphic Initialization by kevin_thibedeau on Wednesday June 05, 2019 @05:20PM (#20109291)
The problem with exception-less C++ is that new, delete, ctors, and dtors become timebombs when they fail in a way that would have generated an exception.
Re:Writing a game engine in pure C: The Graphic Initialization by keldaris on Wednesday June 05, 2019 @05:55PM (#20109569)
I'm not sure why you were downvoted. I almost exclusively write exception-less C++ (compiling everything with "-fno-exceptions"), but correctly handling errors in constructors and destructors is absolutely an important concern. It's not hard to do, obviously, but it does require forethought and heavily encourages delegating complex logic to other parts of the code.
Re:Writing a game engine in pure C: The Graphic Initialization by NikkiA on Thursday June 06, 2019 @01:04PM (#20116508)
If new fails your program crashing is probably going to be the only outcome anyway, might as well fail from an unhandled exception.

And if you're putting things that can throw exceptions in your ctors or dtors you're probably already writing code that is a timebomb

Re:Writing a game engine in pure C: The Graphic Initialization by heinrich5991 on Wednesday June 05, 2019 @08:47PM (#20110542)
dtors that throw come with their own share of problems: If they do so while another exception is in flight (dtors are still called for objects when the stack is being unwound(?)), C++ crashes the process.