Java knowledge Vs. C++ knowledge

Pages: 123
From what I read it seems like it's talking about the standard library.
maeriden wrote:
Is that all you request to hire a new person?

It's what I may ask on the phone -- in-person interviews are far more in-depth. Also important are RAII and smart pointers, exception handling and exception safety, and we're very heavy relying on stateful (C++11-ish) allocators, but since they aren't common knowledge, I'm happy with just the understanding of the 98 allocators.

vlad wrote:
I do not know what is the C++ object model.

It's what's in Lippman's book http://amzn.to/14fih1E plus whatever happened since then. Simple test question for the phone screen: why can't a member function template be virtual? (and no, "because the standard says so" is not a valid response)
Last edited on
Simple test question for the phone screen: why can't a member function template be virtual?
A question like that makes no sense. There's a good chance that even experienced programmer never thought about that. Finding words for it (that the interviewer wants to hear) is even harder.

It's what's in Lippman's book http://amzn.to/14fih1E plus whatever happened since then.
So everyone who is a programmer read this?

the problem with interviewer is that they are caught in their own little world that they cannot even imagine that programmers from elsewhere may have another focus.

And sometimes I have the feeling that interviewer has a superiority complex.

Simple test question for the phone screen: why can't a member function template be virtual?


Because with the current generics done by static text substitution at compile time there is no sane way to implement this, although it would be perfectly viable from the programmer's standpoint? There is no practical use in restricting a generic method from being virtual. And in fact, all languages implementing generics by generating code at runtime have no problems with that. :P
Last edited on
Simple test question for the phone screen: why can't a member function template be virtual?

Well, in that case I should probably go back to plain C, and try to learn D or Haskell while I'm at it.

If I were to attempt an answer I would mumble something like: how can a template be overridden at runtime?

A template function's signature is "finalized" when compilation is done, but there's no guarantee it will be the same signature as of the function attempting to override it. Close enough?
why can't a member function template be virtual?
The answer is this:

http://stackoverflow.com/questions/4961909/templates-may-not-be-virtual

In short: It is a problem with the virtual table.

But I wouldn't say that it has to do with this 'infinite'. the virtual table knows just a pointer.
I'd say that the compiler doesn't like it if the virtual table should be build upon a definition of a function that somehow happens outside the class.
@coder777
And sometimes I have the feeling that interviewer has a superiority complex.


That's not restricted to programming interviewers though. All those "typical interviewer questions" are generally nonsense and a terrible way to distinguish good candidates from average ones. Most of the world hires based on "how well did you prepare for this by learning typical questions by heart", especially for fresh-out-of-university positions.
There's a good chance that even experienced programmer never thought about that.

That is actually the best possible scenario. When talking to a candidate. I want to find something simple they never thought of and follow their reasoning.

coder777 wrote:
So everyone who is a programmer read this?

No, reading the book is not required at all. It's much nicer to hear things learned from personal experience.

coder777 wrote:
the problem with interviewer is that they are caught in their own little world that they cannot even imagine that programmers from elsewhere may have another focus.

A programmer that has another focus is not a good fit for my team.

Gaminic wrote:
especially for fresh-out-of-university positions.

I should have mentioned, I wasn't talking about junior hires. I actually don't know how they get picked up where I work now - we (the programmers) only see them after they go through 4 months of intensive training. In the past, I was looking for the beginners who were interested in C++, knew about c++0x (at the time) or boost, and weren't afraid of oscilloscopes.

(wow, did I derail this thread)
Last edited on
closed account (S6k9GNh0)
I don't know what a oscilloscope is so guess I'm disqualified. D:
@coder777
It's what's in Lippman's book http://amzn.to/14fih1E plus whatever happened since then.
So everyone who is a programmer read this?

the problem with interviewer is that they are caught in their own little world that they cannot even imagine that programmers from elsewhere may have another focus.


I fully agree with you.

In my opinion the question about the OOP model in C++ is stupid. Maybe it has some sense in academic sphere but as far as i know they are usually very bad programmers.:)

Maybe it has some sense in academic sphere but as far as i know they are usually very bad programmers.


Bjarne Stroustrup got a PhD. Is he a bad programmer?
What about Donald Knuth? Judging by the bug density in his programs, he is among the top-10 programmers in the world.

And why Google gives bonus points to people coming from academia? I know more programmers that ended their CS with Masters degree than those who got a PhD. Among the ones with PhD, 4 are working at Google (in Poland, Switzerland and USA), and they are definitely A-class players. Another one works for Microsoft (USA). Another professor I know worked for IBM, on IBM DB/2 code. Among all the others that I met at various software companies - NONE worked on a project/company that you'd know the name of. Why? BEcause they are too mediocre to get into Google, MS or IBM or even an innovative startup.

So, judging only from my limited personal experience - I dare to disagree. People coming from academia are *usually* much better programmers, and hell lot of them work for great software companies.
Last edited on
@rapidcoder

Bjarne Stroustrup got a PhD. Is he a bad programmer?


I wonder how people are naive. Having PhD means nothing that this one is a good programmer.
As for Straustrup I said dozen times that he is very weak as practical programmer and code examples in his books are usually examples of how code should not be written.

That you can understand something I would like to say that I know many books written by such "programmers". For example not so far I read "C# Concisely" by Judith Bishop and Nigel Horspool. They are in fact pioneers in WPF. However their code is simply awful.

C++ was created by Straustrup simply because he was a bad C programmer.:)
Last edited on
closed account (1yR4jE8b)
he is very weak as practical programmer and code examples in his books are usually examples of how code should not be written.


How about showing us such an example and how it should be written instead (according to you)?
C++ was created by Straustrup simply because he was a bad C programmer.:)


I find this very hard to believe...
What about Donald Knuth? Or Leslie Lamport?
Whoa whoa who, stop right there.

Vlad already derailed another thread with the "Stroustrup being a good programmer" debate already derailed another thread the other day.

http://www.cplusplus.com/forum/lounge/109197/2/#msg594694
I simply do not see any logic between my words about Straustrup on the one hand and the question about Knuth on the other hand.
closed account (S6k9GNh0)
Then state a logical argument, not insults.
Last edited on
closed account (o1vk4iN6)
He is above us mortal men and he need not state an argument for his word is final.

Vlad must be going through some hard times at work, trying to put down people on the forums to gratify himself.


I don't think so. He's more likely a student thinking "oh, man I'm a better programmer than all those academic teachers out there - they are dumb, they put opening brace on the same line". This happens very often to our students especially once they suddenly understood pointers, or read some book on programming and they think they got some superpowers. Fortunately most of them grow up from this. Often when they hit the first hard computational problem and realize that putting the opening brace on the next line doesn't help solving it at all.
Last edited on
Pages: 123