6 ms·
Never trust a programmer who says he knows C++
- stcredzero 17y agoOdds 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 17y agoWait, 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?
- bdr 17y agoThere are two different definitions of "know" in play. That's all it is.
- mprime 17y agoWell, the only (literal) meaning of "know" that doesn't fit what everyone else on this thread was thinking it meant is: (3) archaic : to have sexual intercourse with So we should rephrase "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." With something along the lines of "Odds are, one should never trust a programmer who thinks they have had sex with [X]. Odds are they only think they have had sex with really have had sex with [X], but they haven't gone too much farther than figuring out how to use the library." What is this smut in my Hacker News? source: http://www.merriam-webster.com/netdict/know http://www.merriam-webster.com/netdict/know Or perhaps you meant implications of the word "know" in play? (:
- earl 17y agoWell, I always did feel like I was getting fucked by C++.
- RyanMcGreal 17y agoMaybe the idea is that a competent programmer is also humble.
- mprime 17y agoI guessed that was the meaning a long time ago, but it's just amusing to read it literally.
- irrelative 17y agoAnd, I'd add, not humble naturally but got that way by being humbled again and again by his knowledge.
- RyanMcGreal 17y agoYes, 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.
- stcredzero 17y agoNote the comment makes no absolute statement. Note the reference to "odds." This is almost the same idea as: "Remember, most people think they're an above average driver. Also remember, half the people are below average drivers." It's also along the same lines as, "There's always someone better than you." Also note the use of "really." "Know" is twice accompanied by the adjective "really." I would've thought this would make it clear that I wasn't talking about "a little knowledge." The odds are that a programmer does have "a little knowledge" about [X]. Given that you, despite claiming to be puzzled didn't try to take "odds" or the frequent use of the adjective into account, I wonder if you are apt to catch details like that. Maybe this would make a good interview question for coders?
- mprime 17y agoMaybe you could go fuck yourself?
- Anon84 17y agoAlso remember, half the people are below average drivers. Depends on what you mean by "average". If you mean "median" you are correct, but if you mean "mean" (like most people do) this is not necessarily true for most interesting situations.
- btilly 17y agoA simple example where most people are above the mean is that most people have an above average number of legs.
- elblanco 17y agoUsually, the more you know, the less you know.
- icefox 17y agoAfter finding out what language/library someone is most proficient in I always ask them what they find bad/wrong about that language/library.
- aaronbrethorst 17y agoAmen to that. It's always amazed me how many candidates I've had sputter on something like this. Nothing flips my bozo bit faster than someone claiming a particular language or technology they've supposedly "mastered" is perfect.
- arethuza 17y agoI've started asking in interviews what people thought was wrong with a particular language or environment and if they had any thoughts as to features they would want added (or removed).
- aaronbrethorst 17y agoThat reminds me of an interview I did years ago with a Computer Science grad student. His area of study was in compilers, and he said his strongest language was C. So, I asked him: "what would you improve in C? What's less than ideal about it?" He couldn't tell me a single thing.
- stcredzero 17y agoOne job interview sputter I recently produced: I worked at a shop with a supposedly Object Oriented architecture. However, one subsystem consisted entirely of Class methods -- very, very long class-side methods with nested loops, deeply nested logic, and a half dozen array simultaneously incremented indexes that recursively called cut-and-paste variant copies of themselves. Now I work with a different company, but I was interviewing someone who worked at the same shop, and asked him about his opinion of the architecture of the above subsystem. His answer: "It's very nice."
- frou_dh 17y agoNever trust an old man who says he's stood on the moon
- tjarratt 17y agoGuess I'll be taking C++ off my resume then. Wouldn't want to risk having an interviewer think I'm not trustworthy!
- gridspy 17y agoYou liar! ;)
- jrockway 17y agoI 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 17y agoSounds 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.
- mprime 17y agoI'll be upfront in admitting that I loathe C++ just as much the next guy (I can't seem to get away from Lispy languages), but isn't this being a teeny bit ridiculous?
- tbrownaw 17y ago> I have never met anyone who knows C++. Hello jrockway, nice to meet you. :) > 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?) If you understand those, there's a decent chance you're a real programmer rather than a language-specific programmer.
- kscaldef 17y agoI agree with the general observation, but it's definitely not the case that C++ is the only language where this happens.
- aidenn0 17y agoTrue, 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.
- kabdib 17y agoI 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.
- Eliezer 17y agoLong as you don't need any honest 9s or 10s for whatever it is you're doing, I guess that's fine.
- kabdib 17y agoSnarky answer: You can easily tell the 9s or 10s because they answer "eight." Less snarky: They give you evidence, really quick, that they're a 9 or 10. It's not hard to tell.
- d0m 17y agoA 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.
- killedbydeath 17y agoPublic non-virtual functions may be useful. For example, to provide alternative API functions. Something like: virtual public setOrigin(const Point &p); public setOrigin(float x, float y) { setOrigin(Point(x,y)); } Someone inheriting from this class will know that all the customization is in one function.
- wheels 17y agoOne funny consequence of this effect is that at 20 I listed like 15 programming languages on my resume; at 26 I listed 3.
- chasingsparks 17y agoI've been moving in the same direction. My question: which three?
- wheels 17y agoAt that time (4 years ago, last time I did a resume) C++, C and Perl. I wouldn't list Perl now. There are some other languages I've worked more with in the last couple of years that I would only mention only if they were in the "nice to have" section of a job description, and duly noted as only "some familiarity with".
- plesn 17y agoWow, 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.
- jerf 17y agoI've long since taken C++ off of my resume, because I haven't used it for 10+ years, since I was in school. But because I'm a normal person for a HN reader, I've kept up with the news, and in learning so many other languages at one time or another have a pretty decent idea what's going on. Recently we started hiring for a C++ position, and I was asked to sit in on the interviews. I said that I didn't really know C++, but I do know enough other stuff to keep up. Or so I thought. Our interviewer handed out a bit of code something like this int some_func(int, SomeComplexObject&); .. some code context... { { int a = 1; SomeComplexObject b = new SomeComplexObject() some_func(a, &b); } if (b = 0) { cout >> "Error" >> endl; } } or whatever, something like that, and asked what was wrong. People with "years of experience" in C++ would strain and strain to find "the" error. This is of course a steaming pile of errors, the only legal code line is "int a = 1;" and that's redundant (just stick the 1 in the function call). I don't have C++ on my resume, but after that experience I'm pretty sure I could put it back on without experiencing too much flak. On that note, if you're into languages I really recommend the C++ FAQ Lite: http://www.parashift.com/c++-faq-lite/ http://www.parashift.com/c++-faq-lite/ Anybody who can follow that should probably just leave C++ on the resume. We all know C++ is massive, this is an interesting case study in how the massive language interacts with itself.
- deleted 17y ago[deleted]
- chancho 17y ago> Anybody who says they are good at C++ is either delusional or has spent years writing, linking, debugging it. This strikes me as a completely reasonable and not deprecating thing to say about any powerful language (such as C) or any advanced tool in any profession for that matter.
- deleted 17y ago[deleted]
- pmiller2 17y agoI'll speak about my two main sharp instruments these days: C and Python. IMO, it doesn't take years to get "good" at these languages (C, because it's a smallish language; Python because it tends to obey the principle of least surprise fairly often). With sufficiently deliberate study, I think it'd be fair to call oneself "good" at either C or Python after a single year. I suppose I probably ought to clarify what I mean by that. I mean that someone "good" at C or Python is someone who's made it over all of the typical newbie hurdles and is able to spot typical newbie mistakes more or less at a glance. This is not someone I'd expect to have total control or mastery over the language or to know the respective standard libraries inside and out. Now, to become an expert in either of them, then, sure, you're going to need many years of experience (and, if you want to claim to be a Python expert, you need to be at least "good" at C, IMO, because there are times when you're just going to need to suck it up and write a C extension).
- tman 17y agoBadly standardized? Not since the mid-90's. And the days of cross-compiler pain went away almost completely when the last big holdout of the pre-standard days, Microsoft, finally released their 2003 C++ compiler. Your next point, that C++ is just C "with OO" strikes me as deeply ignorant. OO is an important feature, but 95% of the language innovation of the last 20 years has been in templates. Compilation errors are a pain in C++. It's something that takes months for a smart programmer to figure out. Debugging C++ is harder than debugging C, yes. It's a more complex beast. Reading your post I get the impression of someone who has read a lot more about C++ than working with C++. Try interacting with any modern C++ code-base (something written in the last 10 years), avoiding the template meta-programming code-bases which are really only of use for library-writers not library-users.
- chasingsparks 17y agohttp://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
- billswift 17y agoI 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.
- gawi 17y agoNever 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 17y agoAnd a good programmer will raise his eyebrow at you and coolly reply "a little less optimisation"
- jmtulloss 17y agoI'm a C programmer, not a C++ one, but at least in C, you sometimes need volatile to have a correct program.
- gridspy 17y agoIndeed. 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).
- defen 17y agoI remember well the "static object initialization segfaults" valley.
- froo 17y agoAlways trust a graph that has no numbers or points to compare scale!
- known 17y agoDo you mean I shouldn't trust http://en.wikipedia.org/wiki/Bjarne_Stroustrup http://en.wikipedia.org/wiki/Bjarne_Stroustrup
- froo 17y agoNo, just look at that bottom picture. He looks suspiciously a lot like Dr Robotnik (with a shaved moustache) http://bit.ly/dbWcWv http://bit.ly/dbWcWv
- DanielBMarkham 17y agoAnother 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 17y agoI 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 17y agoI 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 17y agoI 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.
- DCoder 17y agoIn 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.
- JoeAltmaier 17y agoYou can cut your hand off with a power tool.