Slashdot Mirror


How Much C++ Should You Know For an Entry-Level C++ Job?

Nerval's Lobster writes: How much C++ do you need to know to land an entry-level job that's heavy in C++? That's a question Dice posed to several developers. While the exact topic was C++, the broader question of "How much X do you actually need to know to make money off it?" could also apply to any number of programming languages. In the case of C++, basics to know include virtual methods, virtual destructors, operator overloading, how templates work, correct syntax, the standard library, and more. Anything less, and a senior developer will likely get furious; they have a job to do, and that job isn't teaching the ins and outs of programming. With all that in mind, what's a minimum level of knowledge for a programming language for entry-level developers?

19 of 336 comments (clear)

  1. None. Go meta. by Anonymous Coward · · Score: 5, Insightful

    Knowing C++ shouldn't matter. Demonstrating that you can quickly master and use any language should.

    1. Re:None. Go meta. by Anonymous Coward · · Score: 5, Insightful

      This is surprisingly accurate. No amount of programming language knowledge will help you write a good program if you can't design the software from a practical level, upwards. What do you want the computer to do? What exact steps do you want it to take? Good, now translate that into $programming_language. That last part is actually the easiest part of software engineering.

    2. Re:None. Go meta. by Anonymous Coward · · Score: 2, Insightful

      OP is saying "If you know Spanish that should be good enough for France since you can just pick up French along the way. They're all Romance languages so it'll work out soon enough".

      Soon enough... Except when the company wants you to know C++ tomorrow rather than 2 months later when you've mastered the API.

      He has a point but it's not something I would bank my resume on...

    3. Re:None. Go meta. by IamTheRealMike · · Score: 3, Insightful

      That sort of logic holds true when moving between languages that are very similar. The transition between Python and Ruby or Java and C# spring to mind.

      However if I need a C++ programmer and need one pronto, I'm not gonna hire a guy who has only JavaScript on his CV no matter what. Learning C++ is not merely learning a different way to create an array or slightly different syntax. To be effective in C++ you need to know how to do manual memory management and do it reliably, which takes not only domain knowledge but more importantly: practice and experience. You need to understand what inlining is. You very likely need to understand multi-threading and do it reliably, which takes practice and experience a pure JS guy is unlikely to have. You need to be comfortable with native toolchains and build systems: when the rtld craps its pants and prints a screenful of mangled symbols you need to be able to understand that you have an ABI mismatch, what that means and how to deal with it. Unfortunately that is mostly a matter of practice and experience. You might need to understand direct manipulation of binary data. There's just a ton of stuff beyond the minor details of the language.

      Could the pure JS guy learn all this stuff? Of course! Will they do it quickly? No.

  2. How to read f*ucked up code by mveloso · · Score: 5, Insightful

    The biggest skill in C++ is how to read code that's got templates, generics, overloaded operators, and custom keywords.

    "What do you mean they overloaded '+' to merge objects?"

    "This doesn't look like C++, it looks like some foreign language."

    "Oh, we reversed the meaning of + and - because the senior guy thought that the original semantics were incorrect. But only for some objects."

    1. Re:How to read f*ucked up code by goose-incarnated · · Score: 2, Insightful

      The biggest skill in C++ is how to read code that's got templates, generics, overloaded operators, and custom keywords.

      "What do you mean they overloaded '+' to merge objects?"

      "This doesn't look like C++, it looks like some foreign language."

      "Oh, we reversed the meaning of + and - because the senior guy thought that the original semantics were incorrect. But only for some objects."

      This. Outside of academia I've never encountered C++ written in a sane manner. Hell, even inside of academia things get a bit iffy. Things you can expect to see if you ever maintain C++ code:

      * Objects passed by value which don't have a deep assignment copy constructor.

      * File scope objects using other file-scope objects - "Because VS2010 ensures instantiation order."

      * Dependencies with no real reason; this is especially bad on Qt projects. Why use std::vector when you can use a QVector?

      * const char *use_this_later = MyQstringObject.toStdString().c_str(); // Bang! There goes another foot... maybe if we had GC...

      * You used copy semantics? You *meant* move semantics (This should never had made it into the standard).

      * Overloaded functions - "myfunc (foo);" does something different to "myfunc (bar);", because hilariously foo and bar are different types

      * Ditto for operators - "foo + bar" does something quite different to "bar + foo".

      * Other than "type var[size];" there is no primitive array type. Arrays are implemented in the library, not in the language like every other sane language.

      * No GC. In other languages you can get away with it, but in C++ you stand no chance - someone, somewhere back in the mists of the past, would have created a critically dependent-upon class that *will* return a temporary object that gets deleted automatically while you still have references. QString, for example.

      All of the above, in addition to all of the gotcha's in C as well. In this day and age there is very little reason to use C++. If you need objects, UI, etc use Java or C#. If you don't need objects use C; at least you can trivially expose every single piece of C code you've written to other languages via a library. This lets you reuse your code. The only C++ code you'll ever expose to other languages are C-compatible functions.

      I'm looking, right now, at a mountain of code, some 20+ classes, many with file-scope instantiations, every single fucking object a Qt object. The original developer noticed that the code for Qt-derived classes won't compile without a copy constructor so he very cleverly made empty copy constructors for all the classes so that even a shallow copy won't be performed. As expected, he also stores instances in containers - which means every now and then the program would give incorrect results with seemingly no predictable occurrences. It doesn't crash, mind, just gives incorrect answers.

      Good luck; you'll need it.

      Stay away from C++ - stick to languages that implement context-free grammars only.

      --
      I'm a minority race. Save your vitriol for white people.
  3. Which C++? by Anonymous Coward · · Score: 5, Insightful

    Is it abort maintaining some old code which tends to be more like C with use of class instead of strict,
    Or is it C++14 which is a much more modern language?

  4. oooh really? by Anonymous Coward · · Score: 2, Insightful

    and that job isn't teaching the ins and outs of programming

    That is called mentoring. It usually one of the jobs of a 'sr developer'. Learn on your own time is a crap way of putting the cost of learning your system onto the developer.

  5. Re:Answer by lgw · · Score: 5, Insightful

    NONE! Find a real language! *ducks*

    For non-ducks, the most important things to know about C++ aren't list in the summery: RAII and shared_ptr<T>

    C++ is not C. C++ written like C tends to be crap code - just an overly complex and distracting language for that coding style. If C++ is the right tool for the job, you need to be using a coding style very similar to C# and Java: throwing exception when errors are encountered, writing exception-safe code all the time, returning from functions in the middle, and never, ever, worrying about cleaning up at the bottom of a function what you allocate at the top.

    If all of that sounds wrong to you, congrats, you're a C coder, and there's nothing wrong with that. Good C code is good code. But C++ is designed to be used with "scoped objects", that is, every object cleans itself up when you exit scope, so you really have to internalize the tools for that, and that mindset.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  6. Re:*shrug* by Anonymous Coward · · Score: 3, Insightful

    C++ programmers do get paid more, but there's much, much more .NET and Java work around.

  7. For C++, there is no standard answer by swillden · · Score: 5, Insightful

    For C++ there is no standard answer, because every C++ shop uses a different subset of the language. There are probably a few things that all of them have in common, but it's unreasonable to expect that any entry level C++ programmer can be productive without support from senior programmers while they learn the local ropes. Even experienced C++ programmers will need a little time to get up to speed on the local style guidelines.

    C++ doesn't have an extensive set of standard libraries, either, which means that every shop has its own set. So senior programmers have to expect that new people are going to spend a lot of time getting up to speed on those.

    Finally, I think the question is fundamentally bad, because it implies a misguided expectation of immediate productivity. That's a common expectation (hope?) throughout much of the industry, but unless you're hiring contractors for six-month jobs, its stupid. What matters in the longer run isn't what your new hires know coming in the door, it's how well they learn, and think. Because whatever they know coming in is invariably inadequate in both short and long term. One of the things I found very refreshing when I joined Google is that they don't much care what you know in terms of languages, libraries and tool sets. It's assumed that capable people will learn what they need to when they need to learn it, and that any new project involves some ramp-up time before people are productive. On the other hand, given a little time to get up to speed capable people will become very productive. Much more so than the less capable person who happened to know the right set of things when hired.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  8. Code reviews by JustNiz · · Score: 4, Insightful

    Your best bet is to find out if the place you intend to work for does regular peer reviews of code as a part of their process, and if not either stay clear or get an agreement that they will code review your stuff at least for a few months until you know the ropes.
    Code reviews of your efforts, if done properly, are the best way I know of becoming effective quickly.

  9. C++ is so broad as to render this question useless by EmperorOfCanada · · Score: 3, Insightful

    This would be like how much English do you need to get a job at an English speaking company?

    If the domain of the programming is really specific such as financial machine learning, or embedded systems then a tiny handful of fizzbuzz tests would be enough as the core questions would all be about the domain knowledge. But if the job involves pushing C++ right out to its limits where the company has occasionally made contributions to LLVM or GCC then maybe the minimum knowledge would be that of a C++ god.

    But the simple reality is that the surface area of C++ and its applications is so large that as long as the programmer had demonstrated that they can deliver in one area of C++ and are capable of learning whatever SDKs or specifics that you use I would not be too torn up to hire a programmer who knew little of the local company's subset of C++ used.

    I personally have delivered C++ applications for embedded systems, mobile, and desktop. Yet it would take me very little time to write a (apparently) simple test that I would fail. Then I could point to myself and say, "Ha ha you don't even know these basics, you fool!"

    For instance what is the keyword "compl" used for? Answer: it is a replacement for the ~
    Why would you want to use compl other than having a broken tilde key? Answer: Because some systems don't have a ~ but do need to compile C++.

    Plus if you were to quiz me on after I had been maintaining some other systems in Objective-C/Javascript/Python/PHP/SQL you could probably catch me up on all kinds of little stupid things where I would muddle the languages together. So just asking me the string function for reversing a string, upper/lower case, or other trivial things. I could end up looking like a real boob even though I could point to the hundreds or many thousands of times that I had used that construct/function/keyword in C++.

    So, I am a huge fan of talking over some code that was created by the person and then seeing a quick fizzbuzz test or two to make sure they aren't full of crap. After that it would be to talk about projects that are at least similar to the project in question.

    That all said; I wouldn't even be terribly offended if someone didn't even have much C++ experience as long as they could show that not only did they have mastery of one of the languages similar to C++ such as Java, javascript, or even even PHP; but that they had a proven ability to have quickly mastered a new language in the past. On this last note I would find it odd that an aspiring hard core programmer hadn't solidly encountered C or C++ in the past.

  10. Re:As a hiring manager by janoc · · Score: 5, Insightful

    And I do hope that you offer a senior developer wages as well for these sort of requirements. The OP was talking entry level job.

    People requiring these sort of skills for an entry level job are the true reason for the perceived "lack of IT talent" - unreasonable expectations and entry level pay.

  11. How much C++? All of it, if possible by OrangeTide · · Score: 3, Insightful

    Unless you've mastered C++, all you will accomplish is writing lots of difficult bugs. Really only gurus should be working on C++ projects. If I can't find enough gurus, then I would pick a different language for the project. (I worked on C projects most of my career because I'm not a C++ guru)

    --
    “Common sense is not so common.” — Voltaire
  12. Re:Answer by Spazmania · · Score: 5, Insightful

    C++ is not C. C++ written like C tends to be crap code - just an overly complex and distracting language for that coding style. If C++ is the right tool for the job, you need to be using a coding style very similar to C# and Java

    That's a bit of a problem, because when you program in C++ the same way you'd program in Java, you lose the efficiency and simplicity of C without gaining the clean design of Java. Java is superior to C++ in almost every reasonable use of C++ *except* the ones which call for programming in C but with, you know, a little bit plus.

    If all of that sounds wrong to you, congrats, you're a C coder

    I resemble that remark.

    --
    Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
  13. Re:Answer by TheRealMindChild · · Score: 4, Insightful

    I don't know how to respond because this whole post is bullshit.

    If you are using C++ as such a high level language as Java/C#, you may as well use them because you threw away some of the most useful/valuable parts. Also, Exceptions are EXCEPTIONAL and should be treated as such... only expected to be thrown when something exceptional happens, not as a means of flow control.

    --

    "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
  14. Re:Answer by Gibgezr · · Score: 3, Insightful

    In the field I work in, we aren't allowed to use RAII; we compile with it turned off. Same for exceptions (this is not exactly unique; Google coding practices require this as well, as do many other companies). Performance-critical real-time code shuns that stuff. We haven't used C for 20 years, because C++ offers the stuff mentioned in summary, and what we need is all that power PLUS the ability to manipulate memory directly, and all as fast as possible. There are huge swaths of industry that need more than "C with classes", but less than Java/C#.

    Of course, what it boils down to is the old joke about C++: get 5 experts on the language in one room, and you discover that each of them only is comfortable with 40% of the language...and it is a DIFFERENT 40% for each of them!

  15. Re:Answer by lgw · · Score: 3, Insightful

    (You can't "compile with RAII turned off", as RAII is a coding style: you're probably thinking of RTTI. But the RAII style might not be good for a realtime system, as it can hide expensive work to release resources.)

    The abomination that is Google's C++ coding conventions is why I hang up on their recruiters. (Though I hear an internal war has been raging for a couple years within Google over their 80s-night coding conventions). Actually, I'm not sure what's you'd use from C++ beyond "C with classes" if you're writing C-style code. If you're not comfortable with exceptions, and are following an "allocate at the top, clean up at the bottom, never return from the middle" mindset, C++ is damned awkward - you won't be using the standard libraries much, you won't have non-trivial constructors, and so on.

    --
    Socialism: a lie told by totalitarians and believed by fools.