Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am a software developer, experienced with C# (5 years experience) alongside a few other languages.

My "dream job" is working in video games as a developer.

Most jobs require knowledge of C++, which i currently don't have (except for some of the basics).

I've looked around, and most big game companies require something along 3-5 years of previous experience with C++.

My question is -- what would be a good route to get myself up to this required experience level, coming from C# ?

I've thought of some possible ways to do it:

Get more knowledge about C++ from books. Participate in open-source projects that are written in C++. What would be the best way to learn C++ and have working-level experience with it, in particular for the game industry?

share|improve this question

closed as not constructive by bobobobo, Sean Middleditch, Josh Petrie, BlueRaja - Danny Pflughoeft, Maik Semder Jun 2 '13 at 13:51

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Thanks i will check it out. Although i am not sure this is the exact same question as i am not a beginner in programming. –  spaceOwl Jun 2 '13 at 6:29
3  
Nobody cares much how or where you got your experience from, or whether you were paid for it or not. If you want experience in C++, start programming C++. –  Maik Semder Jun 2 '13 at 13:56
    
@liortal Repost: See also What are some great tips for a beginner? (some weirdo deleted all my comments on this thread). –  bobobobo Jun 3 '13 at 0:42

2 Answers 2

As a game developer, my main concern hiring a C# guy would be a lack of low-level knowledge.

So, consider a project where your work entails low-level optimization like re-arranging the data layout of classes or rewriting code to take advantage of SIMD instructions. Take a C++ open-source game, optimize it, and post the framerate increase on your resume.

If I were interviewing you, I'd care less about the C++ on your resume and more about whether you can answer my C/C++/low-level interview questions. I'll take a stab at some standard interview questions you might have trouble with (warning: I'm no C# expert):

  • How are C++ classes laid out in memory? Draw a diagram of bytes. Include vtable pointers and padding/alignment of member variables. What about a derived class? What about a multiply-derived class?
  • How does a virtual function call happen, at a low level? Talk about assembly operations like reading a value in memory and jumping to an address.
  • Know about C-style cast, static_cast, and dynamic_cast between pointers to types with various inheritance relationships. For example, classes B and C both derive from class A. What happens when you try to cast from A* to B* (or B* to C*) using these various casts? (I mention because I don't think C# would even allow these specific casts.)
  • Why is it terrible to pass an stl vector by value, instead of by reference? (I mention because most types in C# are reference types and thus it is basically impossible to make this kind of mistake in C#.)
  • What does it mean for a structure or function to be cache-friendly? Why might a structure-of-arrays perform better than an array-of-structures?
  • Understand heap, stack, and static memory. If an object was allocated with new, where does it live in the process's memory? What about a local variable? A global variable?
  • What's a memory leak? What are some best practices for avoiding them? (I mention because there's no delete in C#!)
  • How would you debug a memory access violation crash? What about if the crash happened in some middleware library for which you don't have source code?
share|improve this answer
    
Repost: I already know the usefulness of knowing where vtable pointers are in memory because I ran into a bug involving that before. However, how is the 2nd question useful at all? How does knowing "assembly level operations like reading a value into memory" make one a competent C++ programmer? –  bobobobo Jun 3 '13 at 0:37
    
My Blizzard interview for WoW UI intern spot touched on point 1, 2, 3(to a lesser degree), 5, and 7. He also asked questions about debugging/testing(similar to point 8) I think this answer is exactly spot on even in the general case for upper-level game development companies. –  Dean Knight Jun 3 '13 at 18:01
1  
@DeanKnight I don't doubt that. But I'd still like to know how the OP thinks that kind of question makes someone a good C++ programmer (original question being about how to become a better C++ programmer) as opposed to just helping someone ace the interviews. –  bobobobo Jun 4 '13 at 23:47
2  
You sound skeptical, bobobobo, but your link about the vtable pointer bug is a great example of how knowing the internals of virtual function calls is useful. Consider a similar bug where, instead of the vtable pointer being null, it's garbage. One way to realize it's garbage would be to step through the disassembly of the virtual function call and see your program go off into nowhere instead of going to a valid vtable or a valid method. –  Eric Undersander Jun 5 '13 at 5:38

What Eric said. I would also add to avoid "new" where it's not neccesarly. It's very common in C# but considered as bad practice in C++11 and also slower than stack allocation and more dangerous because you have to manually deallocate it.

I would be also careful with old books, they teach old practices. I personally prefer reliable forums/websites, stackoverflow/isocpp.

share|improve this answer
    
Thanks. I was looking for broader, more general advice/recommendations on what to do, rather than language specifics to study. –  spaceOwl Jun 2 '13 at 7:26
    
"Avoiding new" is a really not a sensible recommendation. You use new when you have pointers. If class Derived : Base, then a Base var = Derived(); is illegal, but Base *var = new Derived(); is legal. So you need pointers to get polymorphism to work right, a lot. –  bobobobo Jun 3 '13 at 0:48
    
Yes, but you can use std::unique_ptr to accomplish polymorphism and avoid the naked pointer (although you will still have the new keyword in the unique_ptr constructor) –  Eric B Jun 3 '13 at 16:04
    
I'm sorry, I made a mistake in the above comment. Base var = Derived() would work, but it would be sliced and, unbeknownst to you, information lost in var. To fix the slicing problem, you could use pointers. –  bobobobo Jun 4 '13 at 23:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.