Anyone ever try to build "C the good parts"?
Anyone ever try to build "C the good parts"?
First they made "C the good parts" by gathering all the various C bits then in use to make something portable and called it C89.
Then they made "C the good parts" by removing all the parts that made C slow to write and called it Perl.
Then they made "C the good parts" by making C easier but still fast and called it Java.
In the meantime, we've gotten Objective-C and C++, which were attempts to make C better while preserving backwards compatibility. C++ has gone on to spawn its own legacy of "No actually, these are the good parts" with D, Clay, Rust, and various half-steps along the way that want some of the features of C++ but not all of the features of C++.
I don't think they'll stop, because as it turns out, people use tools for different reasons and it's very rare that a general purpose tool solves your very specific problem perfectly. I'm inherently skeptical of any "X the good parts" because the "good parts" are domain specific.
Actually I really don't get this endless "silver bullet" discussion. C has its place and for very good reasons. Also the author makes really good points about the integration aspects of C.
There is a continuum between the possibilities of a programming language and the possibilities of a configuration file. As soon as one says that a programming language is suitable for a particular purpose one has moved a few steps towards the configuration file end of this continuum.
This is, of course, a personal preference but I very much prefer to enjoy the power of programming language as opposed to the lack thereof of configuration files. Therefore, I like programming languages that attempt to be useful for any purpose. My favorite language is still C++ and if I were to switch to something else I would be inclined towards Rust.
C++ is too complicated. "Nobody" writes C++, but a subset of it. Select your subset.
Dynamic typing in Lisp (and the like) is really nice for quick prototyping where program correctness is not key. You are exploring what you want to achieve with the program, be it algorithm level or architecture. C++ is not well suited for that, since type checking and memory worries are slowing you down, too many details to drag along. Hence no "silver bullet".
Quick prototyping is not something that I do. Nor am I very much interested in it. At my place of work I have seen it done around me after which it was my task to turn the python prototype into C++. The most surprising thing there was how far the prototype turned out to be from what was actually needed, to the point where I very much question whether the prototyping exercise was useful at all. YMMV regarding this, of course.
There are examples of OSes that don't work like that, despite targeting x86. For example, bare-metal Forth.
https://github.com/Microsoft/MSRC-Security-Research/blob/mas...
They are also very clear that C is done on Windows, and compatibility is only to the extent required by ISO C++ and a couple of key FOSS projects.
https://herbsutter.com/2012/05/03/reader-qa-what-about-vc-an...
UNIX is C's platform, there is hardly any reason to use it outside of non-UNIX OSes.
Plenty other languages offer system programming features, with better type safety and equal portability.
That one doesn't feel right. More like "figure out how to nudge the C++ crowd into the general direction of Smalltalk without them noticing".
No way. C++ was always much more into the functional programming paradigm. (See the STL, for example.)
The connection between C++ and OOP is because OOP was the insane hype at the time when C++ was being invented. The OOP lipservice was mandatory in order to be taken seriously by the fashion-driven programming industry, but real C++ programmers always looked down on OOP and considered it a code smell and crutch.
Not really, the C++ OOP features were directly modeled after very similar features in Simula. C++ was specifically designed as a way of bringing these sorts of features to C, although it did include other improvements to the language as well. Templates and the STL as we know it were a relatively late addition to the language.
It's also worth mentioning that there's only a handful of things about OOP that could be genuinely considered "a code smell"; in fact you could restrict that concern to one feature, viz. implementation inheritance. Object-based programming which follows the "composition over inheritance" guideline can still broadly tap into the improved-modularity benefits that 'objects' are generally known for.
Always? The STL was a last-minute addition to the standard library before C++98. Just a few years before, template implementations in compilers were buggy. There's a reason Qt has its own containers: because it's that old.
> The connection between C++ and OOP is because OOP was the insane hype at the time when C++ was being invented
No, it was because Bjarne wanted features from Simula whilst still generating fast code.
> real C++ programmers always looked down on OOP and considered it a code smell and crutch.
Absolutely not. Again, look at Qt. Look at CERN's ROOT. Java looks a lot like it does because that's how C++ code was written at the time. Even in the early 2000s I was getting funny looks from people when I told them to default to putting variables on the stack.
C++ without a standard C++ library is not really C++.
> No, it was because Bjarne wanted features from Simula whilst still generating fast code.
Yeah, but Simula is somewhat its own thing, before the OOP madness.
> Again, look at Qt. Look at CERN's ROOT. Java looks a lot like it does because that's how C++ code was written at the time.
Only because C++ was the only thing available at the time, so people twisted it into 'OOP', despite the fact that C++ was very a poor fit for 'OOP'.
> C++ without a standard C++ library is not really C++.
You seem to be missing the point, which is that there was a time (two decades!) when the C++ standard library existed, but didn't include the STL.
> Only because C++ was the only thing available at the time, so people twisted it into 'OOP', despite the fact that C++ was very a poor fit for 'OOP'.
You are completely mistaken on your history here. C++ was intended to be "C with classes" from day one.
"Classes" is a low-level thing that you'd need for implementing many language features. Including things like 'abstract data types' of the ML kind.
Good C++ style has always viewed "OOP" as something highly suspect and hacky.
(This didn't apply to "classes" in the C++ vein, which are mostly about pre/post-conditions and RAII.)
That sums it up quite well.