News for hackers. Stuff that matters.
Re:C23: A Slightly Better C by tyree731 on Sunday January 21, 2024 @03:42PM (#39082838)
Nah. More like C is a bunch of hand tools, and C++ is those same hand tools, plus a bunch of power tools. Sure, you could just use the hand tools, and hey maybe they even give you a better of sense of what you’re building at a low level, but it’s exhausting, and it turns out the power tools are really useful.
Re:C23: A Slightly Better C by janice1999 on Sunday January 21, 2024 @03:46PM (#39082871)
Some of C++ features are great, as recently discussed on the Linux kernel mailing list. However for many of Cs usecases, they are not appropriate, like exceptions and RAII in embedded. Once you start disabling major features those 'power tools' become far less attractive. Also, to extend the metaphor, hand tools are usually obvious and easy to use while power tools can have very long manuals. See for example the 275 page book on just Initilisation in C++ [0].

[0] https://www.cppstories.com/2022/cpp-init-book/

Re:C23: A Slightly Better C by spacechild1 on Sunday January 21, 2024 @04:39PM (#39083343)
How is RAII a problem on embedded platforms? It is basically about scoped cleanup, something you would otherwise have to do manually.
Re:C23: A Slightly Better C by actionfromafar on Monday January 22, 2024 @07:41AM (#39088854)
Not sure what waa meant but what comes to mind to me who has dabbled in embedded is that in C it’s painfully clear how long “objects” live and when you tear them down and how. In C++ stuff can easily “happen” at an inopportune moment.
Re:C23: A Slightly Better C by mgaunard on Monday January 22, 2024 @09:45AM (#39090009)
Same in C++: happens at the end of the scope. You precisely control where that is.