On Thu, Mar 6, 2014 at 3:51 PM, Barry Roberts <b...@robertsr.us> wrote:
> On Thu, Mar 6, 2014 at 11:37 AM, Levi Pearson <levipear...@gmail.com> wrote:
>>
>> So, I don't even care that much about PHP.  My pet language to hate is
>> C.  It was a pretty reasonable language for its day and in the context
>> in which it was developed, just like PHP in its early days.
>
> All that C-hating, and not even a passing swipe at C++?  That's my
> favorite language to hate.  I don't disagree with your conclusions,
> but the worst thing I can say about C is that it made C++ possible.

I hate C++ less than C, simply because it provides facilities to
create real abstractions without abusing language features.  It also
has a real story regarding dynamic memory allocation; C itself does
not even consider the issue, leaving it entirely up to libraries, and
leaving proper resource management to be a HUGE source of bugs due to
the discipline required to get it right and *keep* it right in the
face of code changes.

The main flaws of C++, as I see it (beyond those of C that it does not correct):
1. Insistence on full (or very very nearly full, anyway) compliance
with C. This rules out any features at a *lower* level than C, which
as I pointed out before are often necessary for the sorts of programs
where C and C++ are prime candidates due to their lack of required
runtime libraries.  It also rules out fixing legacy flaws that the
people driving the C standardization process are too mired in legacy
code and thinking to consider.
2. Too many features with complex and poorly-understood interactions,
and no real way of hiding it or making the compiler enforce some sane
subset of features throughout a codebase.

There are reasons for those decisions that have technical merit, and
individually all of the features are reasonable ideas that have nice
implementations elsewhere. But the combination of them all leads to a
very complex system.  Now, if you understand C++ sufficiently, you can
create beautiful and elegant programs with it.  It's fairly
well-designed in that it enables tasteful and disciplined engineers to
build abstractions that can help less-capable engineers to build
robust systems.  But the systems designed by different capable
engineers don't always work well together, and junior engineers in
charge of building things often screw things up in ways that are
nearly impossible to fix.

If I knew C++ better, I would use it more, but I have been more
interested in learning other languages than C++.  I do think it
provides a much better set of tools for building reliable software
than basic C does, but you have to know a lot more and master quite a
bit of complexity in order to put them to effective use.  And it also
lacks some real no-brainer things due to C compatibility.  D solves a
lot of the C++ problems while retaining a lot of familiarity for C++
programmers, but it's hard to convince a C++ programmer that there's
anything better than C++.

      --Levi

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to