On Tuesday, 7 June 2016 at 07:57:09 UTC, Walter Bright wrote:
It's not that C++ got any safer. All that old code will still
compile and crash. It's that I got better, which should not be
confused with the language getting better. I learned not to
stick my fingers into the high voltage section of the power
supply.
Well, I don't know how newbies approach C++ and what problems
they run into, but when I learned C++ in the 90s most of my
problems were related to using the C-subset of C++. Often for
performance reasons as compilers weren't as good back then so
even simple compile-time abstractions could give significantly
lower performance.
Of course, I knew C++98 and was a proficient programmer before I
started using C++14/17 18 months ago and the learning curve for
becoming proficient in C++14/17 is quite steep and involves both
learning, inventing (going where people haven't gone before) and
unlearning. There are just way too many ways of doing the same
thing in C++ to be certain that one does something the
best-possible way.
Which is rather costly compared to say Go or the direction D1
took, which focus on being simpler than C++ and generally offers
one way to do something. Work on making D simpler (easier to use
and easier to read) and you may find new markets.
Simpler does not mean less powerful. The best way to get a simple
and consistent language is to create a simple high level IR that
can represent all language constructs you are interested in (by
"lowering").
C++ still suffers from:
http://www.digitalmars.com/articles/b44.html
The array issue is solved. I only use std::array<Type, Dim>. I
never use Type[Dim]...
I also use gsl::span<Type, Dim> or gsl::span<Type> for array
parameters. I also have my own array types for special use cases
(forcing heap allocation etc).
So this is solved in modern C++.
I don't think it is "idiomatic" to write C-code in C++14/17.
What really irks me about C++/D is that they don't focus on
making it easy to write readable code (making complex code more
readable). I don't think it is difficult to fix, but it requires
significant breaking changes.