4 ms·
> Do you know why this line of C++ code compiles with Visual Studio 6, but produces the wrong result? Are you actually serious? You ask about a quirk in a 15-
by DavidWoof 14y ago
> Do you know why this line of C++ code compiles with Visual Studio 6, but produces the wrong result?
Are you actually serious? You ask about a quirk in a 15-year-old single-platform compiler?
I always wonder what some interviewers think they're gaining from questions about minute historical trivia like this. It doesn't provide any real insight into ability at all.
- Contero 14y agoI thought that was meant to be a joke. At least I hope it was. It would get a good laugh from me in an interview.
- VikingCoder 14y agoAnd that would be good, too. I like to laugh with my co-workers. Especially the ones who have to maintain code that was originally written in Visual Studio 6, but somehow has survived to today. Because if you end up with a job like that, where you occasionally have to maintain something that long-lived, you'd better have a sense of humor to carry you through to the times that you get to innovate like crazy and make something nobody had ever thought of before. May we all get to work at jobs that have a healthy and responsible mix of those two activities.
- VikingCoder 14y agoAt the time I was working with code that had been written with Visual Studio 6. The code snippet was written at that time, and I thought it was interesting because of how it behaved, and it let me delve into how the person reasoned about the language, the compiler, and the runtime. I repeat my earlier declaration that I loved candidates who didn't know the answer, but could have a good conversation about the question.
- notaddicted 14y agoThe question equates to "spot the undefined behaviour in this statement" which I think is a legitimate question for assessing knowledge of a language like C++, and to use as a starting point to find out if they understand the difference between programming to the language spec. versus programming to the compiler.
- dinkumthinkum 14y agoI think it could be an OK question. I'd have to see it; if it is something sort of well known or a fairly arcane thing. It being 15 years old is not really that problematic to me. Python is much older than that. :)