3 ms·
> C++ is just fine No it isn't. Using undefined behavior for things which can be implementation-defined behavior instead is harmful. It creates more space for
by Panzerschrek 2mo ago
> C++ is just fine
No it isn't. Using undefined behavior for things which can be implementation-defined behavior instead is harmful. It creates more space for bugs and security vulnerabilities.
- Frieren 2mo agoC++ was designed as an universal way of writing low level system code. It has some abstractions above C, but still allowing for all kinds of optimizations. (Think using a class vs a template, similar abstraction different impact). To use C++ to code user programs is the actual mistake. Think about assembly. Should assembly also be safe in all calls? That will make everything slower, and consume way more energy. Will you blame assembly if people used it to create a phone app and it had memory leaks? Or will you blame the developer for using assembly in the first place? C++ is a tool designed for a range of purposes. There is a push to make it an universal language that makes everything well. But engineering is about making compromises. For your use, C++ may be the wrong language. I do not disagree with you. But maybe you should be using another language instead. Or we should create a new language that fills the sweet spot that C++ covers, and then evolve C++ to be the safe language that you want. One way or another, it is a compromise.
- atiedebee 2mo agoI thought C++ was designed to fit all sorts of applications. There is many GUI libraries for C++ for example, and the language has all the capabilities to add abstractions for making these sorts of libraries easy to work with. I think you could argue that C was made for low level code, since the working group seems to be focussing on making the core of the language more usable instead of allowing for abstractions that make libraries easier to work with (I think we can all agree that the C interface of gtk is not that great to work with, though I do commend their efforts). Sorry for rambling so much, I hope I got my point across.
- imtringued 2mo agoApparently you thought wrong and should stop using C++.
- inigyou 2mo agoC was made as more portable assembly, and C++ was made to add lots of features to C.
- Frieren 2mo ago> to fit all sorts of applications. Yes. In 1985. Processor allow for things like garbage collectors that in the 80s would have been a terrible waste for most uses. Most game developers will never create a 3d engine while 80s developer will do their, 2d engines, by themselves. Assembly was created to be able to create any kind of applications. In the 50s that made sense, not in the 80s.
- UncleMeat 2mo agoWhat is an appropriate behavior for casting inf or nan to an integer?
- deleted 2mo ago[deleted]