|
I need something less broken than C.
|
|
|
|
|
Then certainly not C++.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
C++ is ceirtanly less broken than C, but is not a replacement for C++
|
|
|
|
|
It's more brokener; it has all of the breaks of C and adds its own.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
It provides mechanisms to avoid some of the worst aspects of C. For instance, you almost never need to use horrible C preprocessor macros in C++. The type system is stronger than in C (albeit still not strong enough) - there are less implicit conversions. The new C++ 11 initialization syntax fixes all the problems with implicit conversions on initialization. The C++ Standard library offers sane strings and dynamic arrays that C still doesn't have, etc, etc...
|
|
|
|
|
Are you saying that it is no longer backward compatible with C?
Nemanja Trifunovic wrote: provides mechanisms
Which can be ignored I assume.
Nemanja Trifunovic wrote: you almost never need to use horrible C preprocessor macros
But I could, and I would.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
PIEBALDconsult wrote: Which can be ignored I assume.
Some yes. Some, like the stricter type system - no.
PIEBALDconsult wrote: But I could, and I would.
And you would have no-one but yourself to blame.
|
|
|
|
|
Nemanja Trifunovic wrote: Because there is really nothing else for low-level high-performance software.
But that's what they're asking. Why is there nothing else?
Kevin
|
|
|
|
|
Kevin McFarlane wrote: Why is there nothing else?
If you look at the languages that were marketed as "the C++ replacement": Java, C#, D, you'll see that they are higher-level productivity languages - replacement for VB maybe, but not for C++. The only new language I am aware of that may be targeting the same niche as C++ is Rust, but it is not stable yet.
|
|
|
|
|
Nemanja Trifunovic wrote: If you look at the languages that were marketed as "the C++ replacement": Java, C#, D, you'll see that they are higher-level productivity languages
But author is not discussing those (apart from D, which is low-level, not sure why you think it isn't) but mainly D, Rust and Go.
Kevin
|
|
|
|
|
Well, D and Go are really not low level enough to be a replacement for C++. Rust may be, but is not ready.
|
|
|
|
|
So we need to wait for Double-D ?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Nemanja Trifunovic wrote: Rust Not sure I should trust a language name "Rust", somehow makes me think the code will rot.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
Because the devil is in the details. And when you look to create something that replaces C++, you inevitably land, head first, into the nastiness that C++ rather admirably handles.
"Replacing C++ with something clean" looks great on a whiteboard. But, in practice, it's impossible. You can't retain the advantage of being that close to the system without exposing the underlying implementation.
|
|
|
|
|
mikepwilson wrote: "Replacing C++ with something clean" looks great on a whiteboard. But, in practice, it's impossible. You can't retain the advantage of being that close to the system without exposing the underlying implementation.
That's the kind of answer I was looking for.
The way I would look at it is that C++ is the language you turn to where "if you can't do it in anything else, you can do it in C++."
Whereas, for a language like Eiffel you would use it for applications where "nothing else will do."
It doesn't mean that you wouldn't use those languages more widely but that the above define the sweet spots.
Kevin
|
|
|
|
|
|
Pete O'Hanlon wrote:
Assembly language?
Or Forth
|
|
|
|
|
Don't. You're making me wistful for my Forth days.
|
|
|
|
|
What about D?
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
While D is good in many of the spots where C++ is appropriate - the choice of GC by default means that it is unsuited to areas with hard realtime or space requirements.
It is possible to avoid this, but loses many of the benefits of D.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I'm working on a new language I am going to call C##.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Careful with that - it looks sharp.
TTFN - Kent
|
|
|
|
|
As any musician will tell you, that is D.
|
|
|
|
|
Nah! Someone's already done "D". I'm basing mine on FORTRAN!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Forogar wrote: FORTRAN So, F#
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|