796 reputation
46
bio website
location
age 42
visits member for 3 years, 10 months
seen Jul 10 at 14:16

Jun
18
comment Is a new build required everytime I make a change to the code?
@Aaditya: No, make clean deletes everything that's built, typically because you explicitly want to do a full rebuild. Try to build, edit a file and then just run make.
Jun
18
comment Is a new build required everytime I make a change to the code?
Did you try changing a file and building? MSVC will build what's needed, no more.
May
7
comment Extremely trivial C++ phone interview question
@Mehrdad: IMO a valid answer would be e.g. "AFAIK you can't". The OPs point isn't to decide whether to hire with these, it's to filter out the candidates he doesn't want to waste time interviewing. The answer to an interview question doesn't need to be 100% correct or 100% incorrect in order to tell you something useful about the candidate.
May
7
comment Extremely trivial C++ phone interview question
@Mehrdad: If I'm interviewing someone claiming 10+ years of practical C++ experience he should know this. If I interview someone fresh out of school I wouldn't ask it. Above are just sample questions that are suitable for a phone interview, at varying levels of difficulty.
May
7
comment Extremely trivial C++ phone interview question
@Peter: You can select which constructor to use when initializing a parent class, but not using a function call syntax. In c++0x you can delegate to other constructors though.
May
7
comment Extremely trivial C++ phone interview question
@Bo: If you're a senior who also interviews candidates, would you want to spend time interviewing people that couldn't answer the simple ones? Because those people for some reason do apply... As long as you tell the candidate that this is just a quick filtering test, I don't really see a problem with asking such questions.
May
6
comment Extremely trivial C++ phone interview question
@Nim: I've found that such Qs are a good test of the candidates confidence in his abilities. Someone who knows C++ very well will answer that on the spot rather than try to figure out what he's forgotten.
May
6
comment Extremely trivial C++ phone interview question
@Nim: It's a trick question - the correct answer is that you cannot explicitly call a constructor in C++ - you can indirectly call it by constructing an object, or in base class initialization, but you cannot explicitly just call it.
Feb
15
comment designing classes with similar goal but widely different decisional core
@Steven Jeuris: I completely agree on the indication of wrong abstraction, and I wouldn't choose this as a design. My answer is more focused on the "redesign" context, where my primary goal would be to make an existing design extensible without breaking anything or requiring large amounts of changes. I think we're basically agreeing on how this can/should be solved, but answer based on different primary goals.
Feb
15
comment designing classes with similar goal but widely different decisional core
@Steven Jeuris: On the topic of shared state, this is IMO an acceptable tradeoff, as it is both easy to detect when the expected state is not provided to the P4 class, and there's a single rarely changing point (the primary loop) where you need to ensure that the state is passed to PBase subclasses.
Feb
15
comment designing classes with similar goal but widely different decisional core
@Steven Jeuris:Making such functions pure virtual would require changing all PBase subclasses, which I'd want to avoid. Sure, for 4 concrete classes, who cares, but for a more complex scenario with e.g. a few hundred subclasses, avoiding changes to all classes due to the requirements of one new subclass would be preferable. The "Context" mechanism mentioned below and the method I describe allow changing requirements with minimum modification of existing code.