3 ms·
As a Rust developer [1], I can't help but look at C++ as anything but a very dangerous Perl that has outlived its welcome. C++ can do all kinds of wacky stuff,
by echelon 4y ago
As a Rust developer [1], I can't help but look at C++ as anything but a very dangerous Perl that has outlived its welcome.
C++ can do all kinds of wacky stuff, all of which feels bolted on as the language tried to grow support for each passing paradigm and fad. The syntax is arcane and makes PHP look downright delectable. Pointer sigil placement and const correctness (dangerously) matters, template compile errors look like alien machine code, and no amount of new best practices will save you from old C++ codebases.
I can't see new people reaching to learn C++. It will die with its current users. It's difficult to learn anyway, mostly because the materials and community are inaccessible and stuck in the 90's. And the important lessons on how to actually properly do memory management aren't enforced and only come from painful failures, direct tutelage, or reading an entire book on the subject twice over.
If all Rust had going for it was Cargo, an improved syntax, and the better docs and compiler messages, it would still win. Thankfully it's got so much more than that, and it fixes many of the systemic problems that C/C++ can't address.
[1] (in production, generating revenue)
- j1elo 4y ago> I can't see new people reaching to learn C++ I guess you wrote this while knowing very well that it's just whishful thinking. People will keep learning C++ for the foreseeable future, in order to reach the job market that this language opens up. And if "people" in this sentence meant the companies using it, then again not a chance in the short term. Most companies using C++ have huge codebases that will only be ported to something different when it makes financial sense for them to do it (which is something that almost never happens for an already existing codebase)
- echelon 4y ago> I guess you wrote this while knowing very well that it's just whishful thinking. People will keep learning C++ for the foreseeable future, in order to reach the job market that this language opens up. Just like FORTRAN. (Sorry for the snark! I do agree with your points.) > Most companies using C++ have huge codebases that will only be ported to something different when it makes financial sense for them to do it (which is something that almost never happens for an already existing codebase) Again, not disagreeing with you, but this is why it's good when companies get eaten by more nimble startups without the baggage. Legacy systems die due to business failure.
- smt88 4y agoThere are billions more lines of C++ code in production than FORTRAN. It's not a good analogy.
- gpderetta 4y agoAnd people still write FORTRAN today.
- still_grokking 4y ago> Legacy systems die due to business failure. You mean like in the case of COBOL? ;-) OK, admitted, banks can't fail. They're protected by law of nature. (Or something like that).
- j1elo 4y agoYeah, I agree with you. Note I'm a C++ dev who would like to see less of C++ and more of newer languages that have improved upon mistakes of previous ones. But my opinion is that C++ will remain king for a long time in those niches where it has established itself.
- still_grokking 4y ago> no amount of new best practices will save you from old C++ codebases That's true. But at some point maintaining this code will give you your weight in gold on a daily basis. Like it's currently for COBOL. No, I'm not looking for such a job. I fear C++ and especially the legacy code. But there will be likely people willing to look after this code. > I can't see new people reaching to learn C++. It will die with its current users. Successful languages don't "die". They fade out. Very, very slowly… I think this process in some way resembles nuclear decay and the concept of half-time. > If all Rust had going for it was Cargo, an improved syntax, and the better docs and compiler messages, it would still win. Well, yes, but the syntax is no real improvement. Rust is as ugly as hell. (Which does not say anything about the actual language as such. Syntax is "just syntax". But Rust has chosen deliberately an ugly syntax to attract C/C++ people, I guess).
- zozbot234 4y agoUgly? The one thing I've seen complaints about wrt. Rust syntax is the lifetime specifiers, and that's a required part of the language.
- still_grokking 4y agoOf course it's ugly. As hell. All the unnecessary syntax noise everywhere. Unnecessary braces, unnecessary semicolons, unnecessary commas, angle brackets, some wild mixture of symbols and words (where clauses in types, WTF…), ill lambda syntax, etc. A modern language shouldn't be designed to be foremost convenient for the machine, but instead convenient for the human in front. Parsing is cheap nowadays. Very cheap. But OK, syntax is much of a personal opinion based thingy. It wouldn't be a show stopper, at least for me, if the actual language has merit.
- Thiez 4y agoExcept that COBOL devs are not that paid that well. If they are worth their weight in gold the average COBOL developer must be pretty skinny. By all means specialize in a legacy language if that is what you enjoy, but you are setting yourself up for disappointment if you do it for the money.
- flohofwoe 4y agoThe funny thing is, to somebody who's neither involved too much in C++ nor Rust, Rust syntax looks just as arcane as C++ ;)
- echelon 4y agoRust looks and feels a lot like Ruby (expressions/functional), Java (generics), and Swift (error handling, though Rust was the inspiration). The novel parts are lifetime specifiers (infrequent), reference/slice sigils (not a big deal), and the weird macro language.