by schaefer · 3y ago · 0 comments
Not a single interviewee has even had a good guess in 2 years of open job recs.
It really has me reconsidering. I’m a language nerd through and through. I love C++. But I also have to be honest and say there’s such a thing as “the average amount of c++ the team knows”.
To me, the biggest threat to C++ isn’t rust, but rather the speed at which the language is changing. It’s already past the tipping point.
In my domain, embedded programming, I’m keeping an eye on zig with fingers crossed.
They're just enums, geez.
That's from someone who has written C++ compilers.
Some of the insane complexity being added to C++ comes from trying to emulate Rust move semantics without a borrow checker. An xvalue is what's left behind after you do a move. In Rust, the compiler guarantees that you can never access the remnants after a move. But in C++, someone will somehow manage to leak a raw pointer to something, then move it. So users have to know about xvalues.
(Could be worse. Trying to emulate Javascript async semantics in everything else has resulted in some real horrors. Only Go has a sane solution.)
And Java Project Loom IMHO, which copies a lot of Go's sane solution. (Not released in an LTS version of Java yet, but hopefully soon!)
Unless a good explanation is an insta-offer, why do you still ask a question you've gotten zero signal from?
Interview questions aren’t just for comparing candidates with each other. It’s also useful to know how a candidate’s knowledge compares to the knowledge of the team. The best of a bad bunch might still be unhirable. It’s often better to leave a role vacant than fill it with someone mediocre.
If the GP can’t find anyone in the hiring pool who knows C++ well, that’s a valuable insight. Maybe they need to expect less C++ from candidates and plan for more on the job training.
Or change languages.
How someone handles that inevitable "I don't know" moment is an important data point.
And that doesn't even begin to touch on the absolute disaster of the net framework/core/standard/mono/uwp runtime situation.
C# as a language just doesn't seem very stable. I really don't enjoy using it anymore.
In what way do you think it isn't stable? I've upgraded code written in C# v1 to the latest and greatest and never had a breaking change (well except for one time where it was my own fault for abusing reflection).
Ultimately you can use as much of the language as you want to, the "old" ways haven't been removed and you can still code like it's 2002 :)
But I just really, strongly dislike the way Microsoft went with the problem. Declaring types nullable with the `?` just puts me off. `Nullable<T>` was always something to be avoided, and I find the syntax just as annoying as null checks.
Ultimately most of my complaints can be boiled down to "too much changed and now things are different"
(I can't justify why I feel that way. I have middleware-corporate-lang dysphoria for some reason.)
Honest question: what do you expect the answer to be? Pedantically, the "correct" answer is that it statically casts its argument to an xvalue. Is this a way to tell if the candidate understands value categories?
Someone who doesn't know how it works but successfully have ever written a move constructor (which is a bit more advanced than merely using one) are going to come up with an answer that I would personally (as not the person who said this... for all I know they also will be super pedantic) claim is "close".
But, I would fully expect the majority of people you ask that question to will, for example, actually claim stuff like that the prior value is completely destroyed... not even merely deconstructed (which is already problematic), but somehow deallocated even if located on the stack, which is way more wrong than merely thinking std::move "takes ownership".
I don't know if you play chess at all, but a book I really enjoyed (and read probably about when I was your age? and the existence of which--honestly more than the specific content--massively informed my teaching style) was The Amateur's Mind, which was a chess master going back and attempting to not as much teach chess from his vantage point to an amateur but to go back and explore the misunderstandings amateurs have about chess by way of interviews with amateurs about games and then trying to work within that mental model. I think that, even though we were all amateurs at one point--or even might have a long way to go still--it can be difficult to really conceptualize the gulf between what an amateur thinks and what you might even assume is the mistake they are making.
But I think the concern is not about being able to use it, but to understand what it does, std::move is nothing but a cast. Itself it doesn't move anything. And then there is the whole fun with the state of the noved-from object afterwards. Quite some depth to uncover.
I have 30+ years of experience, and have hired many C++ developers, while working for different companies around the world. And my success rate in hiring good developers have been very high. Using exactly the questions I mentioned above.