5 ms·
I've thought for years that C++ was a sprawling mess of a language with a good and useful subset buried in there somewhere. I'm giving up with C++20. It's time
by debatem1 7y ago
I've thought for years that C++ was a sprawling mess of a language with a good and useful subset buried in there somewhere. I'm giving up with C++20. It's time to acknowledge that the language is too big and its virtues too small.
- carlsborg 7y agoAgree, the direction this is going is outdated. Complexity is expensive and erstwhile c++ programmers are now in in cto positions or are responsible for budgets and know this. The c++ standards need to focus on adding to developer productivity by incorporating micropython to make it more accessible.
- gpderetta 7y agoSure, the language is not complex enough, let's bolt another language on top of it. The spaceship operator is exactly an attempt to make the language more accessible, but of course is being dismissed here as anything c++.
- carlsborg 7y agoMaybe it’s useful and I appreciate the effort going into this. But consider you have a legacy c++ system in a large bank. The argument “we can extend this with a subset of python” can win over “when do we rewrite this in java or nodejs” which are the real conversations that have been taking place over the last decade.
- deleted 7y ago[deleted]
- skgoa 7y agoIt seems to be a matter of propper balance. You can elevate patterns, idioms etc. to language features and you can add entirely new features that enable entirely new solutions. Java and Python are doing this sensibly. But burying devs in an avalanche of new language features that change the way you are supposed to do fundamental things is going to make it much harder to keep up. Especially when this happens every 3 years.
- carlsborg 7y ago> Java and Python are doing this sensibly. IMO this is because Java and python are driven by open “community processes” where anyone can influence the language. C++ standards are influenced by full members of some kind of iso national bodies, from what I remember.
- pjmlp 7y agoAnyone can be part of ISO process, you just need to write a paper for your change and be willing to champion it, or find supporter to champion it for yourself. https://isocpp.org/std/the-life-of-an-iso-proposal https://isocpp.org/std/the-life-of-an-iso-proposal
- gpderetta 7y agoActually recently the C++ standardisation has become significantly more open. Anyone can submit papers and attend meetings (attendance has skyrocketed in the last few years), only full members and national bodies can participate on formal votes, but every body participates in informal votes. The biggest issue is that the language is first defined by a standard and there are multiple implementations, which makes it much harder to iterate, and, as it is hard to get any moderately complex proposal through, often you can see the lack of an overall unified design. I do believe that c++ lacks a strong benevolent dictator figure. Stroustup abdicated his position probably too early.
- Negitivefrags 7y agoThis non-sequitur of a reply is getting pretty tired on C++ articles. Perhaps you could explain how this feature is a sprawling mess exactly? In my opinion, not only is the feature easy to understand for beginners, but it also : 1) Simplifies code - less code to write means less code to have bugs 2) Prevents people making mistakes - incompatibly defined comparison operators wont happen with <=> 3) Gives a speed boost - in some algorithms it's faster to do a<=>b rather than a < b and b > a. You could find a deep dive article just as long about the minute details of comparison for practically any language.
- simias 7y agoI agree. I'm usually the first to shudder at C++'s insane complexity (and the fact that they keep piling more on top with every new standard) but this change feels rather natural, intuitive and a significant quality of life improvement. Sure, it adds the `<=>` operator but I think once you've been explained once what it does it's not to hard to reason about it. That still leaves the problem of technical debt of course: for the decade to come C++ devs will have to deal with both the legacy and the modern version of comparison operators and they'll have to learn to understand and deal with both.
- amelius 7y agoWell, if you really want to be convinced how hairy C++ has become, just have a look at the implementation of the Boost libraries.
- cmrdporcupine 7y agoWith every revision of the C++ standard Boost becomes both less hairy and less necessary. The direction of the language is towards greater cleanliness and consistency.
- amelius 7y agoYes, but it shows that the problem still exists.
- 7y ago
- jokoon 7y agoMaybe it's because you're not not a developer who would gain by working with C++. If you don't need performance, speed, or low memory footprint, I can easily say that you don't need this language, so I don't think you can understand why this language is how it is. Just use something else. But you can also be a little curious as of why some industries are using C++, because if you look hard, there are not that many language like C++. Rust is an exception, sure, but it's very recent and it's not like Rust can pretend to replace everything that is done with C++.
- psychoslave 7y ago>Rust can pretend to replace everything that is done with C++. Do you mean in term of "you can't replace decades of base code in a single day", or do you mean that there are – according to you – scope where C++ is definitely better than Rust?
- the_duke 7y agoI'm a big Rust fan, but right now, Rust is still missing a few important features that C++ can offer. Most of those are in progress and will materialize eventually. * const generics: landing relatively soon but still not there * const/constexpr: support is getting better , but is still very limited right now * lack of higher kinded types prevents things that are quite easy to do with templates. The GAT (generic associated types) is being worked on but nowhere near completion * obviously the library ecosystem is tiny and immature compared to what C++ has to offer Feature wise I believe that Rust will be on somewhat equal footing to C++ in a few years, at which point I won't see any reason to use C++ over Rust, except if you rely on certain libraries - or in a domain where Rusts trait system is just inferior to classes + inheritance.
- debatem1 7y agoWhat a presumption. I do embedded security. For context, that means I use C++ when raw performance isn't that important-- because if it were, it would be in verilog and baked into the silicon.