7 ms·
I've been trying to recruit good Modern C++ devs for almost a year and it's very very difficult. Even people with significant experience in their resumes usuall
by sytelus 8y ago
I've been trying to recruit good Modern C++ devs for almost a year and it's very very difficult. Even people with significant experience in their resumes usually fail to answer most basic questions like what is RAII or const correctness? In what cases would you rather pass around naked pointers instead of smart pointers? And so on. I shudder at the thought of these people writing C++ code and putting it in production. In C++ there are only few ways to do things right and lots of way to do it wrong. There is a gotcha virtually in every turn of the language, often not caught by compilers even with all warnings enabled. To top this off, static analysis and linters remains extremely poor for C++.
I understand Linus's argument that in large collaborative C++ projects driven by volunteers, you can easily end up with messed up code base littered with stupid mistakes. C is slightly easier to understand and deal with - relatively. Also note even fewer people actually knows what C++ features you can use it on bare metal or kernel code.
On a fun side story, Windows NT team initially had huge debates on using C++. Dave Cutler was firmly against using C++ to build OS if I remember correctly but the graphics group decided to be hip and modern and do everything in C++. After long delays and frustration graphics group had to revert to C.
- stochastic_monk 8y agoI feel that I’m more skilled in C++ because I developed a large project in C first. Whether or not C is the language one ultimately chooses, it makes one aware of the tradeoffs and benefits of various coding styles.
- sytelus 8y agoMain advantage of C is that it forces you to understand what goes on under the hood. To many C++ programmers who didn't do much work in C, if you ask how the variable var1 bellow gets allocated, they will be scratching their heads. As a former C programmer, this is the first thing I try to understand - who is allocating what and who will be freeing it up and how. I don't like anything to be black box or performing magic for me. But many quick short and sweet courses on C++ completely skip this. There is in fact a book someone showed me which said that you don't need to worry about memory allocations in modern C++, just use smart pointers and everything will be taken care for them! Poor souls!! void f() { Vector<int> var1; }
- 0xcafecafe 8y agoAny C++ programmer worth their salt should know that a vector is implemented using begin and end pointers. I believe its do with the person than the language. The same person can miss nuances of C as well.
- Koshkin 8y agoOn the one hand, knowing an implementation detail is (or shouldn't be) very important; also, those can change. But on the other hand this is helpful in cases when you need to make a judgement as to the efficiency of certain constructs. For example, I find it is very instructive to learn about the actual implementation of the shared pointer.
- e12e 8y agoI actually think this illustrates the success of c++ as a (also) high level language: a relative c++ novice can produce reasonably correct code, by sticking to a small, straightforward subset, and following best practices. I think c a novice seem much more likely to rely on undefined behavior and have an accidentally working program that leaks memory, fails to check the return value of malloc, close files etc? That is, one can be sort of productive and "correct" in naive c++ - in c that's not really possible (well, one can be "productive" but correct is less likely?).
- hopler 8y agoPatent said allocated, not implemented.
- gpderetta 8y agoAhem... I think that the tipical implementation is a triplet of base pointer, allocated size, initialized size.
- stochastic_monk 8y agoI expected it would be, and that’s how I’ve implemented my vector variants, but I checked the source code for libc++ and libstdc++. Both use two pointers.
- gpderetta 8y agoI don't think you need to learn C to become a good C++ programmer. But knowing it (or the low level subset of C++) will make you a better programmer.
- Koshkin 8y agoI love C, but these days the thought of doing any serious programming in it is scary, like a nightmare where you would find yourself naked deep in the woods with only a stick in your hand.
- stochastic_monk 8y agoI respect great C developers, and a lot of great software is written in it. I can just write an equivalent or better program much more efficiently with less effort with C++ metaprogramming. I also think macros are a valuable tool for the language and wouldn’t choose for them to be removed because it allows for concise shorthand.
- 0xcafecafe 8y agoIsn't this more of a reflection of the candidate and not of the language? Especially since the questions you mention are not "modern" C++ per se. I am in the same boat as you and have been looking around in the market for filling some positions in my team. My experience is also similar to yours but I attribute that mostly to the interviewee. Something like having "10 1 year experiences" than a "10 year experience". It is important in our field to keep up and at least look under the hood to see how things work.
- sytelus 8y agoFor languages like Python, C# its not as often to find candidates who can write syntactically correct code that produces the required output but the code would leave you in absolute horror and you would pray for the candidate.
- btschaegg 8y agoI agree with your last point, but if you see it from the perspective of a project leader that has to pull in changes (like Torvalds) or hire qualified people, that still makes no difference. If it's too hard to find good people or sift out bad code, even a technically good language is not helping you with your real task.
- 0x445442 8y agoIn defense of the interviewees, the 10 1 year experiences issue is usually dictated by "architects" and middle managers chasing the new shiny tech stack. From the interviewees perspective it's self preservation to have a knowledge base a mile wide and an inch deep because most business just want to get something out the door.
- linuxlizard 8y agoHonest question: what sort of C++ dev are you looking for? I'm curious how C++ is being used in industry these days. I'm re-learning C++ after 10+ years away. I'm tired of how squirrely Python is and how much extra work I have to do in C.
- Koshkin 8y agoNot the parent, but my answer would be, the sort that actually know the language, appreciate and use the whole range of its power (rather than think of it merely as "a better C") and yet do not always write code as if it was Java. A good C++ programmer should be able to consciously switch between two mindsets - one where you use C++ as a very high-level language, similar to the way people would use Python or Java, and one where you realize the need for new a abstraction and are able to implement it.
- zozbot123 8y ago> what sort of C++ dev are you looking for? I'm curious how C++ is being used in industry these days. Not parent commenter either, but by far the most common answer is: "the sort of C++ dev who is happy with maintaining incredibly clunky codebases that are old enough to drink alcohol in the U.S. If you're in a well-defined, niche sector like gaming, embedded, low-latency programming etc. the code won't quite be old enough to drink, but it will still be really, really clunky, and nowhere near a "modern" standard like C++17.
- sytelus 8y agoC++ is dominant language in space of game engines, simulations, code that runs on low power devices, inner core of virtually all deep learning frameworks. We have been looking for devs who can work in all these domains. At least in our case, the code base is pretty new, no legacy maintenance stuff.
- altmind 8y agoThis sounds unappropriate(im not trying to attack anybody), but my opinion is that no programmer would stick with C++ if he learned C++ good enough and have any quant of critical thinking. Many-many parts of C++ are just plain design mistakes that negatively influence the programming and operation. Maybe you can find some good C++ devs in CAML, lisp, scala, rust comminities, but these people probably would not turn back to C++ without a strong reason.
- Koshkin 8y agoOn the other hand, "there are languages everyone complains about, and there are languages nobody uses." See, for instance, https://stackify.com/popular-programming-languages-2018/ https://stackify.com/popular-programming-languages-2018/.
- Const-me 8y ago> After long delays and frustration graphics group had to revert to C. It was 1992. C++ is old language, however the first version of C++ standard only appeared in 1998. Before it happened, the quality of the compilers was mediocre. Early in my career (but much later than 1992) I have used VC++ 5 and 6, they weren’t good. They were good enough C-with-classes compilers, but try slightly more complex C++ and they just crashed. The standard library wasn’t there either, instead there were multiple incompatible STL implementations.
- dgzl 8y ago> Even people with significant experience in their resumes usually fail to answer most basic questions like what is RAII or const correctness? In what cases would you rather pass around naked pointers instead of smart pointers? I'm not claiming to be highly skilled with C++ (or any language for that matter), but I've spent several years as an undergraduate TA for the year-long intro to programming series which was taught in C++. I read the textbook over several times, helped create homeworks, exams and study material, and not once have I heard of RAII or naked/smart pointers. In fact, I've never heard the word 'correctness' in reference to the idea of const variables. Is my education faulty, or is it disingenuous to call these ideas 'most basic'?
- reducesuffering 8y agoMost universities are still teaching pre C++11, I believe. The terms you mentioned are much more relevant in modern C++, C++11 and onwards. Pre C++11 is more C-like, so I could understand them teaching it as it covers a breadth of C and C++, but new projects should be using C++11 onwards.
- sytelus 8y agoIf you have done all these within past 3-4 years then I’d say your educational institute has failed you. Today’s C++ programmers should be very familiar with Modern C++. Any new C++ projects should most definitely be using C++11 or newer. RAII is one of the most fundamental concept that C++ students should be intimately familiar and proficient with. Const correctness is also one of the fundamental tools that I would not live without. You should write to your professor with comments here.
- dgzl 8y agoI graduated 3 years ago, so that's close to right. I imagine my professors would say that the comment posters are out of touch with the contemporary University environment. And then the comment posters might say that the University is out of touch with contemporary industry needs from graduates. And I'd say you're both right, but here we are. I graduated from one of the better engineering schools in my West-coast state.