views:

2362

answers:

22

My company, a C++ house, is always looking to hire recent grads. However due to the Java Schools phenomenon, we typically end up interviewing strong Java programmers with maybe a minute smattering of C++. Often the C++ classes don't really prepare students for working in C++. Nevertheless, often these are bright kids, eager to learn and do their best.

Every interview, I struggle with this fundamental question:

How hard is it to turn a "Java School" programmer into a C or C++ programmer? Has your company had experience turning the stereotypical "Java Schools" programmer into a strong C++ programmer? Is it worth the effort?

One of the reasons I struggle with this is not just due to a C or C++ vs Java language difference, it's the fundamental skills that come with learning C or C++ that I think often get lost at the Java School. These include data structures, computational complexity, manual memory management, really everything Joel Spolsky says here.

Often, as far as I can tell, a student will have some of those fundamental skills (be able to answer a few questions), but I'll still have this large part of my mind that's extremely skeptical with how well someone can learn these skills without getting their hands dirty in some C or C++. Maybe I need to be disabused of this stereotype. Am I just being unfair?

Anyway whats your experience with turning the "Java School" programmer into a C or C++ programmer?

A: 

Depends on programmer IQ. The real question is : Is this programmer smart enough for us to invest the learning time? The smarter, the less time he needs to learn.

Ovidiu Pacurar
A: 

Java programmwer would fit right into a C# house, as well as a C++ developer would.

The cross over into C/C++ would depend on the programmer but I wouldn't count their Java skills for anything other than general programming experience. I would also be surprised if you attracted many such applicants.

dove
+15  A: 

Programmers program. Someone who actually knows how to program can learn any language. Sure, there's a learning curve, but a good coder can get up to speed relatively quickly. If you're expecting someone with advanced knowledge, you wouldn't be looking to hire fresh grads anyway, right? So there's going to be a learning curve either way.

Dana
I'm not sure that is the case with C/C++. If the programmer in question has done only 'modern' languages and never done assembly language work, then he or she may have a really hard time groking memory management, no matter how good they are in Java or C#.
Jim In Texas
I'm also not sure if this would be the case for say doing a functional language when all you've done is Java or C#. I thing learning a new language is trivial if you've been exposed to something in the same class of languages, but I don't think its universally trivial to go from one to another.
Doug T.
This overlooks the fundamental difference in skill between C* and Java.It is very easy to excel in Java without learning the critical programming skills that are needed for most types of commercial programming.The "programmers program" approach has lead to the massive influx of programmers that don't tryly know how to code.
David Frenkel
+1  A: 

Someone from a Java school should still have a strong grasp of data structures and computational complexity. The only area where they should be deficient is in manual memory management. If they understand what the garbage collector does for them and they seem bright enough that you could teach them memory management, then I'd say give them a shot. Since they didn't spend time learning memory management in Java school, try to find out if they're particularly strong in some other area that you need.

Bill the Lizard
A: 

It's just another language.

And if you stick with the relatively small subset of pure OOP features, there is really not that much to learn from a Java developers perspective. The only thing you should have to teach them in order for them to be generic OOP programmers is the fact that they have to implement a destructor to take care of their memory.

However, if they should be using the STL, templates, exceptions and the likes, they'll probably need some more guidance.

Jasper Bekkers
I've seen Java developers write C++ code with the mindset, "it's just another language". It's like trying to speak Spanish to an Italian, because hey they're both Romantic languages, so there should be plenty of similarities.
Tom
+33  A: 

Well, if they don't understand data structures and algorithmic complexity, they aren't going to be much good at serious Java programming, so I don't see that the language is an issue here.

They won't understand pointers, but good C++ programming typically doesn't use pointers in complicated ways. (There are exceptions, but since I don't know what your company does I can't tell whether they'd apply.) After all, you probably don't want your developers writing their own linked lists rather than using std::list.

They won't understand manual memory management, but that's a lot easier in C++ than it used to be. In modern C++, doing your own memory management has become harder, due to the potential of exceptions, so you want to practice RAII with pretty much everything (using auto_ptr, boost::shared_ptr, whatever).

If I were running things, I'd hire them if they looked good. I'd be aware that there might be problems (C++ is a more demanding language than Java, after all), and have some sort of idea how to deal with them.

There's no reason to avoid hiring people out of college just because they don't have the exact skills you want. The smart ones will learn, and you probably don't want to hire the ones who aren't smart.

David Thornley
I disagree, pointers are fundamental to data structures, and references are necessary for copy ctors.
Hooked
Which data structures are pointers fundamental to? Most of the basics are available in pointerless form from the standard library or Boost. Nor should references be too difficult to pick up. Get them started, then get them into the lower-level details.
David Thornley
@Hooked: Pointers are only necessary when they are equivalent to Java references, so a Java background should suffice.
David Rodríguez - dribeas
@David Rodriguez: What about pointers to stack variables? That's often useful when you want pass-by-reference semantics. This can't be done directly in Java.
Jørgen Fogh
@Jørgen Fogh: If you want pass-by-reference semantics you should use references rather than pointers, and the concept is not hard to grasp: a reference (c++, not java) is just an alias to a different variable, whether in the stack or dynamically allocated is irrelevant.
David Rodríguez - dribeas
+2  A: 

It is relatively simple to figure out if a graduate has solid understanding the basics irrespective of their 'language' group. These fundamentals include 1) Data Structures 2) Operating Systems and 3) Algorithms and their Complexity. These are essentially conceptual areas and discussing design or approach towards a particular problem in these can reveal how strong or weak they are. You dont have to make them write code.

I would say that if anyone has a strong base in these fundamentals, and equally importantly has a positive attitude, he can learn any other language.

I always go for these fundamentals and their evaluation - fresh grad or experienced. These are the primary criteria to get someone hired.

Ather
+1  A: 

I am a java developer myself, but had a C/C++ base in college. And I am GLAD I started with memory management, lists, queues, stacks and most important: pointers. Although I don't use pointers explicitly, I know what's going on in the back of my app, find memory leaks, performance issues, etc.

I think the best solution is not asking Java/C# developers to learn C/C++ (and all the matters that come with these languages) when they go to work, BUT teach them these subjects in college. This would be the best solution.

As it is now, it's like fixing the effects/symptoms, not the actual cause.

Alexandru Luchian
+11  A: 

Hi Doug,

I have programmed in many languages and find C++ very difficult to figure out and be productive in, compared to other languages that I have used such as Java, C, Python, Fortan, Javascript, ASP and Perl. I would almost say it's in a category of its own. I do NOT believe that competence in one of the languages I just listed (including Java) is a great predictor of how good a C++ programmer a person might be. I think C++ almost requires a different type of thinking, and certainly the ability to hold a huge amount of information in one's head while coding, versus focusing mainly on the business requirements.

I have been trying to become proficient in C++ for years, despite never needing to use it at work (i.e. studying in my own time). It is very tough going and after all this time I am not sure that I would be successful and productive as a C++ programmer. I think I am reasonably competent overall in those other languages.

So, based on my small and clearly biased sample of one person (me!) I would suggest leaning towards developers who have demonstrated a substantial amount of past C++ experience if that is what they are going to be doing at work, day to day. You will need to spend more time finding those candidates but you will have a better chance of success in the long run, I think.

unintentionally left blank
Great honest answer. Can you elaborate on what you think the stumbling block is? Syntax? The flexibility of the programming model?
Larry OBrien
I think it comes down to too many details to remember all at once and too many gotchas. As Stroustrup says (I think), it's a bit too "expert friendly".
unintentionally left blank
Don't feel too bad. I don't think the gurus know more than maybe 40% of the language.
Doug T.
I don't feel bad - but I am getting tired of having a big pile of C++ books on my bedside table with not much to show for it. Latest is "Accelerated C++" by Koenig/Moo which is actually pretty good (so far) in terms of giving practical examples versus endless language trivia.
unintentionally left blank
@Doug: That may be, but it's interesting that this may be because C++ was designed to be so purpose-agnostic that people learn the subset of it that best applies to their needs and generally don't require the rest.
tloach
Also, just as a side-thought, I doubt even the gurus know more than 10% of Java :D
tloach
@tloach, that's a side effect of garbage collection. And yes, I am posting this months later, but dammit I need to make that joke.
James McMahon
+2  A: 

"You can't teach tall." -- some famous basketball coach.

When hiring, you're looking for someone who can both quickly learn new concepts and quickly unlearn habits. It's the latter that can sneak up on you. In the case of a Java->C++ transition, you may face "unlearning" such things as heavy IDE reliance, 'everything is an object,' a mental model of objects and programs that's too high-level, etc.

I would suggest that you look for things that suggest flexibility -- have them write a little program in both an IDE and a plain-text editor, show them a simple C++ function that passes a pointer and modifies the underlying value and see if they stumble, etc.

Larry OBrien
+13  A: 

Speaking purely from the perspective of a C++ programmer, I would think that a Java developer looking to learn C++ would face a fairly steep learning curve. Yes, at some level developing code is similar in all languages. I was once called upon to write code in Excel's macro language (pre-VBA). I managed but it was like trying to write War and Peace with a fifth-grade vocabulary.

There are other issues with C++ (pointers, memory management, operator overloading) which are just not present in Java as far as I know and they're not small issues either. Especially if you're looking at someone to help with legacy C++ code these could present big obstacles. And I think I would start any new hire with at least some maintenance work initially.

Onorio Catenacci
upvote worthy for the metaphore alone :)
tloach
@tloach--Thank you.
Onorio Catenacci
A: 

My post here is almost answer to your question. Like Joel sad in the link your provided it's really bad that today they don't learn the basic in the school. But the good ones still learn, they take classes in Operating Systems and hack the linux kernel scheduler, they do projects in assembly etc ...
Most of hire in my company are just graduated, and it's impossible to pass our exams without understanding the basic, so cheer up there is still good candidates around you need to know how to find them.

Ilya
+1  A: 

I started with C/C++ and moved to Java.

I'm not sure new grads really know anything--consider them clean-slate for training. You might even be better off with an uneducated hacker.

That said, it's fairly easy for a good engineer to shift back and forth between pointers, memory allocation and the like--but I think it's amazingly difficult to shift from garbage-collected OO back to non-OO.

When you are working with a system with GC, you get much better at thinking about your design at a high level. You can actually code in a way that is much more understandable. You start really having classes that focus on a single responsibility (most classes will be a few screens--most methods will be trivial).

I've never seen good OO C++ code, which is probably good because OO code isn't going to be all that performant and simply has too many small allocations/deallocations, short method calls and other little performance roadblocks to make a C++ programmer happy.

It's kind of like taking your race-car and putting AC, power steering and Power windows on it. Much more usable, but defeats the reason it was chosen in the first place.

By the way, I'd love to actually see some good OO c++ code if anyone has a reference...

Bill K
A: 

It's more difficult than turning a good C/C++ programmer into a good Java programmer. The emphasis is "good" here. Any people can program in any language poorly. Good C++ programmers must understand pointers well. One of the most important concepts in C++ is iterator which is a generalization of C pointer via operator overloading, which makes many algorithms truly generic in C++.

One great indicator whether NCGs get it, is their performance in operating system courses. If they passed an OS class with heavy project workload (like implementing any OS components in whatever languages) with flying colors and that they loved it, chances are they're among the best students you can get.

ididak
+1  A: 

I think the problem Joel Spolsky was referring to in his article is that "getting" pointers and recursion requires a certain mental aptitude, and that a curriculum based on C would weed those who didn't have it out, and a Java school wouldn't necessarily do it.

So what is a hiring manager to do, since people don't put on their resumes, "I don't get pointers, and I never will."

So if you buy Joel's hypothesis that the ability to "get" pointers and recursion is an innate personal trait that people either have or they don't, I see the following options:

  1. Hire exclusively from C/C++ schools rather than Java schools.
  2. If there aren't C/C++ schools, then hire experienced C/C++ programmers rather than from college.
  3. If you're committed to hiring from college, then accept than you are going to have a non-negligible failure rate in converting them.
JohnMcG
+1  A: 

I think this idea of a "Java school" is largely manufactored. The university I am at uses java to teach it main sequence CS courses(Data Structures, Algorithms, etc) However, they are many other courses that use other languages like C/C++/Scheme and in higher level courses the work can be done in any language.

Do you really think it matters what language basic programming concept are taught in?

Mark Lubin
It does matter. Learning with a language that forces you to understand the deep concepts creates a far deeper understanding of the machine and what coding really is.
Paul Nathan
As long as the school later teaches other languages, the issue is largely moot.Even so, it matters which language basic programming is taught in. If I had my way the intro courses would be in Javascript. Partly because that would require later courses in other languages.
Max Lybbert
A: 

Maybe impossible :P

Szundi
Sorry, I just love java so much, I couldn't resist. Certainly, bad answer. :)
Szundi
+2  A: 

As someone who's primarily a "Java schooler", and a pretty recent graduate at that, I definitely think it'd be possible for me to learn C or C++ without too much pain...

However, I really don't want to. I can only speak for myself, but C can be a pretty ugly language if you've grown up with Java. I think motivation is going to be the bigger obstacle. Motivation and maybe some whining about that "in Java this is soo much easier, why isn't C Java?" :)

If you can find someone with the proper motivation, the rest will work out okay. :)

Ace
Motivation is definitely a big one. Also... no one else on the team is going to have any sympathy when the newbie comes in whining about everything C++ doesn't do that their "old" language did (and conveniently ignoring everything C++ does better than their old language).
Tom
+1  A: 

I'm a student myself and most of my course work in the early years was in Java but I always tried to do things in C++ just for the fun of it. This semester started a new course that required everyone to program in C++ + OpenGL + Qt and many of the other students, who have never used C++, have a very hard time adapting and often spend literally hours fighting simple compile-time errors. This could have many reasons (including stupidity) but I think it can be quite hard for someone who only used Java (and a lot of students just use the stuff they are told) to change to C++. Unfortunatly I cannot think of any way to ease the pain of transition and can only think of Dijkstra saying:

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

pmr
I think Dijkstra was wrong on that. Seems to me it only took about 15-20 years to work the BASIC kinks out of most programmers.
Nosredna
+4  A: 

My rule of thumb is I'd much rather get a C/C++ programmer to write Java than a Java programmer to write C/C++. I can't tell which Java programmers can handle dealing with memory management and pointers until they try it.

If all I had to choose from were Java school kids, I'd tell them a few horror stories about assembly and C, then try to break them down into three categories.

  1. Fearless. They weren't paying attention.
  2. Fearful and panicked because they know they couldn't handle that kind of complexity.
  3. Fearful and eager because they understand that even people smarter than them can get punched in the gut by weird-ass memory and hardware issues, but hell, it does sound like a good challenge.

I'd hire from group 3.

Nosredna
Great answer!!!
Nikhil
A: 

I don't buy the "You either get pointers/recursion or you don't." The mind is a clean slate. Anyone can learn anything given enough time and interest. The question is - are these kids interested.

We've been looking for an intern at my work, and I've gone through like 30+ resumes from this year's crop. The main thing that shocks me is how few of them have done a god damn thing that wasn't required from them by one of their classes or a job. Find someone who has done something on their own and enjoyed it, and you will be satisfied.

That said, personally I wouldn't waste the time with someone who didn't understand C and assembly. There is a big difference between debugging a core dump with gdb from a C++ crash, and looking at a Java stack trace. C++ is really a horrible language for many reasons, but that which is good about it is that which it has in common with C. It is a powerful way to tell the computer to do exactly what you want it do, without generally having to worry about what other nonsense is being done by some runtime.

Also if you want to save time, don't bother with anyone not from the top 10 engineer schools. Not to say that there aren't great students from tier 2 schools, but from a practical perspective you don't need your hire to be one of them.

MIT, Stanford, UC Berkeley, Georgia Tech, Illinois Urbana Champaigne, CMU, Caltech, USC, Michigan Ann Arbor, U. Texas Austin.

I also wouldn't hire anyone to write software who uses Microsoft Windows. As a computer science student, you simply couldn't be that interested in software or how computers work without becoming a Linux user (even better if you go with FreeBSD or something else)

nosatalian
"The mind is a clean slate." I thought that until I had three kids of my own. I now believe in aptitudes.
Nosredna
lol.. your dumb kids notwithstanding...
nosatalian
You were doing ok until your final 3 paragraphs.
20th Century Boy
Well my goal isn't to make people happy. It is to help the poster. By applying some simple filters 'good school' and 'non-windows-user' you can increase the probability that your candidates are good dramatically. Of course since most people a) didn't go to one of those schools and b) use windows, the truth is bound to be hurtful.
nosatalian
-1: A good programmer could write code on a typewriter. The skills are in the head, not the operating system. I have used Linux, Windows and Mac and I have learned things from each.
Jørgen Fogh
A: 

If you are hiring young people just out of school, you should hire for IQ, not for any particular skill. You want people who are Smart and Get Things Done, not someone who knows how to frob pointers in a way that is particularly pleasing to you.