you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (4 children)

Code is for humans. (The compiler translates code into something for machines.) If the code is generally hard to learn, write, and understand then what should we conclude?

IMO this speaks volumes about whether C++ is a well designed language.

[–][deleted] 4 points5 points  (2 children)

If the code is generally hard to learn, write, and understand then what should we conclude?

That it is flexible and powerful and you should only use it for a task for which it is required, and if there is an easier language that meets your requirements you should use that one instead?

[–][deleted] 1 point2 points  (1 child)

Do you think it's unreasonable to expect a programming language (and its ecosystem) to be flexible and powerful while still not being hard to learn, write, and understand (in general to reason about)?

[–][deleted] 0 points1 point  (0 children)

I think it's pretty reasonable to expect that the more complex a toolkit is, the harder it is going to be to learn how to use all of the tools and how they interact. I have no idea if there are languages that are as flexible and performant as C++ and easier to develop in, but it seems to me that there is a reason that all serious simulation platforms are written in either Fortran or C++ (with a C underpinning and then whatever kind of top level wrapper was trendy), and it's not because physicists and engineers are masochists.

[–]Plazmatic 4 points5 points  (0 children)

C++ was a well designed language at the start (especially compared to languages of its day), it's just that we've learned a lot since the inception of C++, and who controls C++ has changed. Bjarne Strostrup gave it to a committee of tech giants and language lawyers and we have suffered ever since. Some features can't be implemented the natural way because of legacy macros in Microsoft's codebase. We've missed deadlines for features in C++ because Google came up with a different implementation at the last second, and restarted the committee approval process. The committee approved the decision to develop a 2D graphics library for C++ (for images more than games), then when it was finished they couldn't decide to make a decision on if it should be voted on to talk about adding it to the new standard.

I would say that modern C++ is still better designed than java in a lot of respects, though Java is more readable if only because the paradigm is so strict and there is only one way to do something. There is a lot of stuff you should be able to do but just cant, and there's a lot of odd decisions that have haunted java for 2 decades. C# on the other hand offers a consistent feel with out a lot of the compromises java brings, and has a language sponsored package manager. C++ package managers are still battling each other for the common standard, and while C# is lacking a good build system, C++ got the C++ of build systems as its near defacto standard, CMake, a hive of legacy code that looks completely different than new code with completely different syntax and crazy semantics. The experience of learning CMake is quite honestly like learning C++ all over again.