News for hackers. Stuff that matters.
Re:The Design of C++ (1994) [video] by paulddraper on Friday September 09, 2016 @11:52PM (#12467603)
> there is very little that could be changed in it without the danger of destroying its finely tuned fabric built from intricately interacting concepts and mechanisms

Really? Very little? Finely tuned fabric?

Is diamond inheritance really part of that fabric? And NULL?

C++ is old and has only accumulated, never lost. When I think "finely tuned fabric", I think of Rust, which has the fortune of decades of learning. C++ piled on rvalues and move semantics. Rust is the one that "tuned" its design.

I'm not dissing C++; it's a true veteran, and has witnessed entire languages rise and fall. But let's be honest: the design of C++ is (as one would expect for a decades-old language) organic, not "finely tuned".

Re:The Design of C++ (1994) [video] by shin_lao on Saturday September 10, 2016 @02:51AM (#12468025)
Is diamond inheritance really part of that fabric?

Diamond inheritance isn't a problem in C++ as each inheritance path is followed separately. A small price to pay to enjoy the power of multiple inheritance.

And NULL?

NULL is deprecated since C++ 11 in favor of nullptr.

C++ is old and has only accumulated, never lost.

You may want to have a look at the latest standards.

Re:The Design of C++ (1994) [video] by humanrebar on Saturday September 10, 2016 @10:41AM (#12469442)
> NULL is deprecated since C++ 11 in favor of nullptr

Pedantically, it's discouraged, not deprecated. NULL is a preprocessor constant defined in so many places, often in contradictory ways. There's no practical way for the C++ standards to deprecate it.

Compiler and analysis tools vendors could (and should) provide warnings when NULL is used when nullptr is more appropriate (which is always IMO).

Re:The Design of C++ (1994) [video] by pjmlp on Saturday September 10, 2016 @12:35PM (#12469907)
Actually before nullptr was designed, the good practice in C++ was to use a plain 0, due to the way NULL is sometimes defined and how implicit conversions work.

Seeing C++ codebases using 0 for pointers instead of NULL was already a sign how up to date the respective programmers were with C++'s best practices.

Re:The Design of C++ (1994) [video] by cynicalkane on Saturday September 10, 2016 @07:59AM (#12468788)
I don't think the usual criticisms of NULL are satisfied by it becoming slightly more type-safe.
Re:The Design of C++ (1994) [video] by paulddraper on Saturday September 10, 2016 @07:00PM (#12471267)
Re:The Design of C++ (1994) [video] by izym on Saturday September 10, 2016 @09:58AM (#12469204)
References don't allow null.
Re:The Design of C++ (1994) [video] by blub on Saturday September 10, 2016 @04:42AM (#12468328)
Rust isn't finely tuned either, it just has memory safety (finely) turned up to 11.

I wouldn't call C++'s design organic, just severly constrained by backwards compatibility. It is finely tuned, but the results are not even close to an ideal that didn't consider C. Finely tuned doesn't imply perfection.