[article] Language Design Deal Breakers

H. S. Teoh hsteoh at quickfur.ath.cx
Sat May 25 22:44:52 PDT 2013


On Sun, May 26, 2013 at 01:27:55PM +1000, Peter Williams wrote:
> On 26/05/13 11:59, Nick Sabalausky wrote:
[...]
> >Forget waiting for a huge improvement, I'd have been happy to
> >ditch C++ even for a small improvement. C++ is such a pain IMO that
> >using it has about as much inertia as ice skates on concrete.
> 
> I found shifting from C++ to C an improvement.  (Yes, I learnt C++
> before I learnt C.)  I should mention that this was back in the mid
> 90s and C++ may have improved since then :-).
[...]

You're not the only one who felt that way. At my day job we also
"upgraded" from C++ back to C. I've often ranted about our horrific
experience with a hugely over-engineered C++ system that can literally
do *anything*... except that nobody understood how to use the thing. It
had dtors with side-effects that did useful work, for instance, and
there were so many levels of abstraction it was bordering on insanity.
Once I had to make a function call to said horrible code... it involved
going through 6 layers of abstraction, two of which were fwrite()ing
function arguments to a temporary file, then fork() and exec()ing an
auxilliary utility that fread() the arguments back, and *then*
dispatched them across an IPC link...

We're now back in C-land, and boy the code is much cleaner, and
*faster*, even though it's a lot harder to read and more tedious to
maintain.

Like I've said many times before, the only way I found coding in C++
tolerable was to use it as "C with classes". Trying to do real OO in C++
is an exercise in masochism. Even Java with its baroque verbosity and
prolific boilerplates beats C++ hands-down in this respect. And don't
even mention templates, which are already nasty enough to work with in
simple generic types; they are utter monstrosities when you start
getting into CTFE and compile-time codegen. D templates, CTFE, and
mixins, by contrast, are actually *pleasant* to work with.


T

-- 
Computers shouldn't beep through the keyhole.


More information about the Digitalmars-d mailing list