[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c code vs c++ code



On Sun, Nov 24, 2002 at 09:55:51PM -0600, Steve Baker wrote:
> 
> 
> Katie Lucas wrote:
> >On Sun, Nov 24, 2002 at 06:01:21AM -0500, Jason Stechschulte wrote:
> >
> >
> >>I'm wondering if there is some benefit to using the C code rather than
> >>the C++ code.  Is it possibly better for porting to other systems?  Or
> >>is it simply programmer preference?
> >>
> >
> >I have, in the course of my travels around the development world, met
> >quite a lot of people who put "C++ developer" as their
> >profession. Stunningly, scarily, terrifyingly few of them are actually
> >anything over "C and isn't class neat cos I can put methods in structs
> >with it" developers.
> 
> ...but there are also programmers who could quote you the C++ standard
> verbatim but don't grok fundamental things like the distinction
> between "A-is-a-kind-of-B" and "A-contains-B".
> 
> There are some *really* terrible programmers out there - and they
> can write awful code in any language you care to provide them with.
> 
> But beware - there are people (I'm one of them) who have used all the
> wonderous features of C++ and cooly *decided* not to use many of them.
> It's a bad idea to label them all as people who havn't bothered to
> learn more than C-with-classes - that's not always the case.
> 
> As a C programmer, I never once used a 'goto' and only rarely used
> a 'comma operator'. Did that make me a bad C programmer?  I don't
> think so.  Those are *dumb* language features that we don't need.
> It's the same deal in C++. You have to know what makes you more
> productive and what causes you to blow your leg off with alarming
> regularity.  Templates, exceptions, stream I/O and multiple
> inheritance are good examples of those things.

Now you see, I find all those things mean I can write extremely high
quality code extremely quickly. I also don't have trouble with
multi-threading or memory allocation or any of the other bits of the
language that people keep describing as "tricky" at me, and quoting to
me as reasons to use smalltalk, lisp, java or whatever their favourite
toy language is.

Coding is extremely easy.

Working out what to code is the only hard part of C++ engineering...