AD said:
AD said:
So, you're not coding in C++, and you come to a C++ community hangout to
complain about C++ being difficult to comprehend, and you expect what,
sympathy?<shrug>
I'm not coding in C++ ANYMORE
I could not possibly see how it can be used to write robust code
You expect us to trust your judgement?
[I've found C++ _much_ easier to write robust code in compared to C.
It is clearly no proof against incompetent coders (nothing is), but it
does offer some really good tools to help competent ones...]
Well, objective-c (and it's inherent to all c based languages, unless
you start ripping out pointers, etc) is prone to allowing a single fly-
idiot
poisoning the whole barrel, and java like languages
were designed precisely to keep idiots at bay, but c++ seems to be
especially
susceptible to providing morons with tools to automate
writing some crap code.
I guess, everyone's mileage varies. For a change, I am on AD side in this
C-vs-C++ maintenance/reviewing issue although for different reasons. Reading C++
code takes, in my experience, much longer time than C code of equivalent
complexity because there are on average more (commonly used) meanings for
identically-looking C++ code than C code. I have already given on this group an
example that, in C, you pretty much know that f(a) does not change a -- but not
in C++. Also, something like a+b can mean anything but addition (forget about a
<< b being always a shift) and getting certainty is prohibitively time-expensive
(last time I counted, operator<< had some 3 to 4 thousands overloads in my
organization; add to this potential automatic conversions and you get the picture).
To be on schedule, a reviewer/maintainer needs to assume; but because there are
always more than one way to skin a cat in C++, any (and I mean *any*) assumption
one developer will find reasonable will be broken not too often in another
person's code that the unfortunate first developer has to review.
Writing C++ code is a different story.. I often call C++ code I am getting for
reviews or maintenance "write-only" because it takes longer to understand what
some code does (forget about "supposed to do") than to write the equivalent
code. (yeah, I know there shall be specs that say what code shall do; the only
thing is, often there are none).
I think that's why I noticed trend about C++ developers (and related managers)
to switch roles: you code if you can, no matter how high is your level in an
organization, and leave reviewing to underlings. I think this trend is
C++-specific, because the situation with Java is opposite, in my experience:
more senior people commonly review the code. I was too late to catch this trend
timely; now trying to reposition myself back to writing.. hopefully not
write-only code.
-Pavel