
Never trust a programmer who says he knows C++ - skorks
http://lbrandy.com/blog/2010/03/never-trust-a-programmer-who-says-he-knows-c/
======
wheels
One funny consequence of this effect is that at 20 I listed like 15
programming languages on my resume; at 26 I listed 3.

~~~
chasingsparks
I've been moving in the same direction. My question: which three?

~~~
plesn
Wow, I have to do a resumé and I'm depressed about myself. I'm nearly about to
write:

Languages: C, Python, Haskell

Will code for food in Java,C++,C#,Whatever.

------
kabdib
I have three standard "screener" questions: (a) what's a virtual method, (b)
why would you want to have a destructor be virtual, and (c) what's a virtual
base class.

Most folks (if they have a head on their shoulders) get A, a lot get B, and C
befuddles almost everyone. (There are a few situations where you'd want to use
a virtual base class. And if someone replies, "Oh yeah! I use those all the
time!" they're probably using /other/ parts of the language that are just as
unsavory).

Related to the original discussion: I've found the folks who self-rate
themselves (on a scale of 1-10) as nines (and one guy was a ten) are generally
bozos. This is independent of the language in question.

~~~
d0m
A better question is: Why do we need to put the archaic virtual keyword in
front of a method? Shouldn't non-virtual functions used in an inheritence way
be declared as private while the other being automatically virtual ?

Then if he agrees, he's ok. If he gives you more examples of why C++ is
archaic, he's great. If he begins talking about non-virtual methods being more
optimized than virtual one, thanks him for his time and try to find someone
else.

~~~
sorbits
What if he makes a case for keeping types as POD when possible? :)

Anyway, it is clear from your comment that you dislike C++ and you prefer to
hire people who agree with you that C++ is archaic, that is fine and all, but
it doesn’t show in-depth understanding of the language. Explaining why things
are as they are does show deep understanding of the language and a desire to
learn the dirty details, IMHO a valuable trait.

~~~
d0m
It's a way to avoid a 100% only (and closed mind) C++ programmer.
Understanding the cost of a virtual function is something. Not understanding
that in most situation this cost is trivial, is something else. And every C++
great programmer should know that C++ is archaic and that higher level
languages exist. If someone only knows C++, he is a C++ programmer, not a
programmer.

~~~
tspiteri
Virtual functions are helpful only when you have derivation and need some
common interface. When your class is not meant to be derived from, declaring
functions as virtual is just plain misleading. And I am strongly against
fitting everything artificially into a class hierarchy, that is, I dislike
using the OOP sledgehammer for every simple class.

Also, great C++ programmers are those who use C++ in a problem domain matched
to it, not those who use C++ where Perl or Python or something else is so much
better. So they know that C++ is not archaic at all, it is just not suitable
for every job, but then, what language is?

------
DanielBMarkham
Another post that confuses "all the features of C++" with "programming in C++"

Once more for the record, programming in C++ does not involve using all of the
features of this massive language. In fact, a good C++ programmer keeps things
as brutally simple as possible. C++ programming forces you to.

The author is dead-on about how you get swamped by the features. What he
missed is that you come out of the valley on the other side with a good
appreciation for "That hurts. Let's not do that unless we absolutely have to"

You know, C++ has to be a significant language. Nowhere else have so many
people cried out in pain and frustration. Yet the language still rolls on.
That's probably not much of an endorsement! (grin)

~~~
VBprogrammer
I mostly agree with you but I don't think I'd apply for a job specifically
programming in C++ without knowing the appropriate use cases for the majority
of the language features. Obviously different if you are only listing it as a
language you have some familiarity with.

~~~
Retric
I think you overestimate the value and difficulty in learning the less often
used aspects of C++. C++ still includes the _asm_ keyword and in some areas
you are going to see it used. However, while I might like people to know at
least one ASM language it's far from required to call yourself a C++
programmer.

~~~
VBprogrammer
I would still expect a C++ programmer to know when assembly might be used
(i.e. the use cases, the benefits, the drawbacks and the alternatives).
Admittedly, I'd also expect them to know it really isn't an area they should
mess with unless they really have to.

------
gawi
Never trust a programmer who says he knows C++... Never trust someone who says
he knows... Never trust a programmer... Never trust C++ ... Never C++...

At university, they taught me C++. I suffered a lot. So the minute I
graduated, I stopped doing it. This was a valuable lesson after all.

If someone pretends to understand C++, just look at his code and say "Ok, so
what happens if you add 'volatile' just here."

~~~
gridspy
And a good programmer will raise his eyebrow at you and coolly reply "a little
less optimisation"

~~~
jmtulloss
I'm a C programmer, not a C++ one, but at least in C, you sometimes need
volatile to have a correct program.

~~~
gridspy
Indeed.

The underling effect of volatile is that the compiler turns off certain
optimisations to do with instruction reordering and aggressive caching in
registers without stores.

However in most places that a typical non-firmware, non-driver programmer
would use volatile they really should be using a memory fence (acquire,
release or atomic store).

------
chasingsparks
<http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect>

~~~
billswift
I have a hard time with names; I generally think of this as "the third
quartile effect". Most people self-evaluate themselves as being in the third
quartile of ability - the lowest fifty percent overestimate their ability,
while the highest quartile tend to underestimate themselves.

------
kscaldef
I agree with the general observation, but it's definitely not the case that
C++ is the only language where this happens.

~~~
aidenn0
True, but C++ is a perfect storm for this.

1) There are a _lot_ of nooks and crannies that can bite you in the butt

2) It's cosmetically similar to C and Java so you get a false sense of
security (The article points this out).

3) It's popular (same effect for PHP or Java (I took a intro to programming in
this language, so I know it!))

4) Due to #1, every decent C++ shop tends to standardize on a subset of the
language, with practices that deal with the nooks and crannies of just that
subset.

------
DCoder
In my current free time project, I learned enough C++ by reading assembly to
not find anything new in Lippman's "C++ Object Model". I'm not sure if that's
a good sign or a bad one - did I see so many tricks, was I not reading
attentively, or what... pity the book doesn't cover COM+ though.

When I inherited this project, it was relying on (cast)s and macros all around
and this led me to some nasty traps, I switched to building a lot of
templates, they've so far proven invaluable in saving debugging time,
enforcing type safety, and communicating expected data types to other
developers. Templates are good. And macros are traps, but everyone already
knew that.

Granted, the project is a niche, I don't think there are many similar projects
out there, so not sure how useful my knowledge of the object model is. I'm
reversing/extending a C++ game with no source, btw. DLL injection and all that
goodness.

------
stcredzero
Odds are, one should never trust a programmer who thinks they know [X]. Odds
are they only think they know really know [X], but they haven't gone too much
farther than figuring out how to use the library.

~~~
mprime
Wait, what?

EDIT: This comment literally says "usually if you think you know something,
you don't." So I guess I shouldn't apply for a job using language FooBar,
since by this guy's rule I probably don't actually know FooBar.

How does this make sense?

~~~
RyanMcGreal
Maybe the idea is that a competent programmer is also _humble_.

~~~
irrelative
And, I'd add, not humble naturally but got that way by being humbled again and
again by his knowledge.

~~~
RyanMcGreal
Yes, exactly! I didn't become the half-decent programmer that I am until I
finally embraced the fact that my code sucks and adopted highly defensive
coding practices as a result.

------
tjarratt
Guess I'll be taking C++ off my resume then. Wouldn't want to risk having an
interviewer think I'm not trustworthy!

~~~
gridspy
You liar! ;)

------
froo
Always trust a graph that has no numbers or points to compare scale!

------
defen
I remember well the "static object initialization segfaults" valley.

------
frou_dh
Never trust an old man who says he's stood on the moon

------
JoeAltmaier
You can cut your hand off with a power tool.

------
known
Do you mean I shouldn't trust <http://en.wikipedia.org/wiki/Bjarne_Stroustrup>

~~~
froo
No, just look at that bottom picture. He looks suspiciously a lot like Dr
Robotnik (with a shaved moustache)

<http://bit.ly/dbWcWv>

------
jrockway
I have never met anyone who knows C++. I have also never met a C++ programmer
that knew how to program or what OOP was. (Polymorphism? What's that? Tests?
What are those?)

~~~
neilc
Sounds like you've just met a lot of bad C++ programmers. Given that most
programmers are terrible and there are a LOT of people who claim to be "C++
programmers", I guess that isn't too surprising. People who actually know
(sane, modern) C++ are rare.

