Java's properties enabled the remarkably rapid creation of complex libraries that had eluded the C++ community for a decade. And, unlike various vendor's C libraries, they all plugged and played nicely with each other.C and Java fill almost disjoint niches. Aren't most JVMs written in C even though most of the rest of the "ecosystem" is written in Java itself?
The "problem" of C is that it sort-of-works for lots of people and there is apparently no one with resources or motivation to develop a clearly superior replacement, if that's even possible. If you try to "clean it up" too much sooner or later somebody will be disappointed and it will turn out that not one but at least a few replacements are needed. To an extent this is already happening with Java/C# displacing C in many applications. C is not defined by C standards, them being more like the lowest common denominator that most (and not even all) vendors reluctantly agree to support. Want a memory model? You have one in every operating system written in C. C is a product of evolution, not intelligent design.
As for Java generics, at least Java has generics, unlike most "C incremented" and "better than C" languages which can't even assign a meaningful type to stdlib's qsort.
I particularly like "C is a product of evolution, not intelligent design" and your equating Java with C#-not-Java-honestly.

One neat counter example to the "importance" of the JVM being written in C is Squeak Smalltalk. The last time I looked that virtual machine was written in a subset of Squeak Smalltalk, which makes it very easy to bootstrap the system and to improve the system. Some people will incorrectly claim that doesn't count, since there are two intermediate languages involved: a small subset of C and an assembler language.
Yesterday's news: "With the upcoming Linux 6.8 kernel cycle, the first Rust network driver is set to be introduced." https://www.phoronix.com/news/Linux-6.8-Rust-PHY-Driver
Yesterday's news: "With the upcoming Linux 6.8 kernel cycle, the first Rust network driver is set to be introduced." https://www.phoronix.com/news/Linux-6.8-Rust-PHY-DriverNot sure whether this is a good thing as Rust as a language is pretty obscure. It is good to bring a language that has built-in OO support into the Linux kernel but realistically C++ is a much better choice for the simple reason C++ has been around longer, more people know it and thus make it easier to support the kernel. With Rust only a few can do kernel maintenance so chances are high nobody is going to touch it and the code gets abandoned (especially since the Linux kernel notoriously lacks decent comments).
On Wed, 5 Sep 2007, Dmitry Kakurin wrote:
>
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about portability,
> it's BS.
*YOU* are full of bullshit.
C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.
In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.
C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:
- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)
- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.
In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.
So I'm sorry, but for something like git, where efficiency was a primary
objective, the "advantages" of C++ is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.
If you want a VCS that is written in C++, go play with Monotone. Really.
They use a "real database". They use "nice object-oriented libraries".
They use "nice C++ abstractions". And quite frankly, as a result of all
these design decisions that sound so appealing to some CS people, the end
result is a horrible and unmaintainable mess.
But I'm sure you'd like it more than git.
Linus

Yesterday's news: "With the upcoming Linux 6.8 kernel cycle, the first Rust network driver is set to be introduced." https://www.phoronix.com/news/Linux-6.8-Rust-PHY-DriverNot sure whether this is a good thing as Rust as a language is pretty obscure. It is good to bring a language that has built-in OO support into the Linux kernel but realistically C++ is a much better choice for the simple reason C++ has been around longer, more people know it and thus make it easier to support the kernel. With Rust only a few can do kernel maintenance so chances are high nobody is going to touch it and the code gets abandoned (especially since the Linux kernel notoriously lacks decent comments).
Java generics are sufficient for container classes, and not much more. Useful, but underwhelming.
For C++ generics
Yesterday's news: "With the upcoming Linux 6.8 kernel cycle, the first Rust network driver is set to be introduced." https://www.phoronix.com/news/Linux-6.8-Rust-PHY-Driver

Way back in 1988 I had severe doubts about C++, and everything I have seen since then merely confirms that suspicion.
Fundamentally, if C++ is the answer, you asked the wrong question.
Way back in 1988 I had severe doubts about C++, and everything I have seen since then merely confirms that suspicion.When I read the original Bjarne Stroustrup book in the mid 80s I thought it had real potential. It addressed a number of the weaknesses in C, like it bundled both data and its related functions into a class/struct, where they should have been from the start. The problems started when others got hold of it, and there was no longer one person's vision driving it. Even by the time of the first edition of the book he had clearly been pushed to add more than his original vision of a incremental change from C, but it was still looking OK.
Fundamentally, if C++ is the answer, you asked the wrong question.If the question is "how should I develop this elaborate graphics application", C++ isn't such a terrible answer. The problem is people get so focussed on that type of problem when teaching and thinking about C++ that they've built a system that hammers everything into that mould.
Even then it was only good if you hadn't been exposed to the.existing alternatives, Smalltalk and Objective-C.
Around 1992 I saw some people develop a GUI for an SDL (i.e. FSM) compiler. (My contribution was merely to create the hardware interface to the HP8920 GSM testset). They spent many man years on the GUI. I could have done something far better and sooner in Smalltalk. Yup, C++ was the wrong starting point for that GUI application
Even then it was only good if you hadn't been exposed to the.existing alternatives, Smalltalk and Objective-C.I really disliked Objective-C. The functionality was good, but the way the extra syntax was fudged onto the existing C syntax felt horribly wrong.QuoteAround 1992 I saw some people develop a GUI for an SDL (i.e. FSM) compiler. (My contribution was merely to create the hardware interface to the HP8920 GSM testset). They spent many man years on the GUI. I could have done something far better and sooner in Smalltalk. Yup, C++ was the wrong starting point for that GUI applicationIn the 80s a colleague avoided all that hassle. He made some templates for Autocad, to easily draw ITU standard SDL, and a fairly simple program to compile the drawings into the tables for the FSM.
In the end there is no substitute for competent engineers. But you also need to optimise your choices to the kind of engineers available. For example: I'm not a fan (to put it mildly) of Altium for schematics and PCB design and rather not touch it. But if a customer asks what would be a good package for doing simple PCBs themselves or outsource I can't go around the fact that Altium is pretty much industry standard. So unless there is a good reason to recommend something else, I still recommend the customer to outsource to somebody who uses Altium because the chances are high it is easy to find somebody to take over and/or get an in-house engineer to work on the designs.
When I read the original Bjarne Stroustrup book in the mid 80s I thought it had real potential. It addressed a number of the weaknesses in C, like it bundled both data and its related functions into a class/struct, where they should have been from the start. The problems started when others got hold of it, and there was no longer one person's vision driving it.
...
C actually comes close to the holy grail, but it lacks syntatic sugar for these techniques, lacks templates, and some argue that it makes bypassing abstract interfaces too easy.

...
C actually comes close to the holy grail, but it lacks syntatic sugar for these techniques, lacks templates, and some argue that it makes bypassing abstract interfaces too easy.
C also adds some other characteristics,
...
[1] where all children are above average
This was a rant specifically about modularity, abstraction and object orientation. In this context the disadvantages to Java are arbitrary (and widespread) type casting and lack of syntactic sugar. The disadvantages to C++ are very primitive code generation facilities.
I'm not going to end every post about C with a full list of things that people consider wrong with C
UB is idiotic, as is the fact that both ISO and compiler vendors consider it acceptable instead of at least IDB, lack of memory management is considered dealbreaker by most, some features are obsolete relics of PDPwhatever assembly language, you need to memorize operator precedence to understand type declarations, ...
...
C actually comes close to the holy grail, but it lacks syntatic sugar for these techniques, lacks templates, and some argue that it makes bypassing abstract interfaces too easy.
C also adds some other characteristics,
...
[1] where all children are above average
Didn't you leave out some context from that quote?
...
C actually comes close to the holy grail, but it lacks syntatic sugar for these techniques, lacks templates, and some argue that it makes bypassing abstract interfaces too easy.
C also adds some other characteristics,
...
[1] where all children are above average
Didn't you leave out some context from that quote?
Yes, quite explicitly, and with a direct pointer to the full post and a direct pointer to the source of the quote.
Which bit do you consider important to the point I made?
I don't think it matters who created Rust, but the more languages they knew the better. The more languages the higher the probability they will extract the good bits and avoid the bad bits. That was very clearly demonstrated in Gosling's 1996 Java whitepaper.
If Rust was only a "simple safe subset" of C++, that would be a beneficial step. Rust adds extra novel capabilities on the form of ownership and non-mutability. That is absolutely vital with today's multicore processors and MCUs. C/C++ is painfully inadequate for those.
When I read the original Bjarne Stroustrup book in the mid 80s I thought it had real potential. It addressed a number of the weaknesses in C, like it bundled both data and its related functions into a class/struct, where they should have been from the start. The problems started when others got hold of it, and there was no longer one person's vision driving it.The problem was right at the point when he decided to put code inside data structures, the rest was a consequence.
What you wrote is the basic dogma of object orientation, and it inevitably fails when when you need to do X to two different types A and B. So you have these options:
1. Copy X to both A and B, remember to update both copies when you fix a bug or add features to X. I suppose this can work too...
2. Make X a method of a pointless Xdoer type and reduce types A and B to dumb accessor functions around their data. You are Java.
3. Make X a method of a pointless Xable type and derive types A and B from Xable, which inevitably leads to...
4. Multiple inheritance, because A and C but not B are actually Yable too, and which may also lead to...
5. Templates, because sometimes loads of pointless types and hidden function pointers behind the programmer's back is too much overhead - ask Java.
6. You are C++ now.
Object orientation is cancer and a poor bandaid over lack of foresight and modularity. In Java it reportedly also serves as a hammer to force at least some modularity on programmers lacking in foresight...
What you actually need is:
1. Modularity - restricting which code accesses which data.
2. Interfaces - common way of manipulating different data by generic code.
3. Flexilibity of implementation - sometimes code duplication may be worth the cost, sometimes a single function pointer is enough and there is no justification for dragging along vtables with each piece of data. In some cases this necessitates choosing between languages, like C++ vs Java.
4. Sensible defaults and a way of changing them when justified would be the holy grail.
C actually comes close to the holy grail, but it lacks syntatic sugar for these techniques, lacks templates, and some argue that it makes bypassing abstract interfaces too easy.