views:

1598

answers:

20

Hello,

I have spent the last 8 months learning as much C++ programming as possible from all free internet sources I could find. Though I work part time at a crappy job, I have been putting in about 20-30 hours a week into learning programming, and now I am a bit uncertain about what I should learn next. What I know fairly well at this point;

  1. sorting algorithms(heapsort, mergesort, etc)
  2. using the STL (sets, vectors, next_permutation, maps etc)
  3. binary search trees
  4. BFS and DFS on directed and undirected graphs
  5. beginner level dynamic programming (shortest path, longest sub-sequence,best order of multiplying matrices ) with multi-dimensional arrays
  6. basic greedy algorithms
  7. single and double linked lists
  8. Tries
  9. intermediate level string manipulation with file i/o
  10. hash tables (using an array of linked lists in case of collisions)
  11. bitwise operators (bitmasks, and some XOR tricks)
  12. Much of the OOP syntax, though often I choose to use structs rather than classes
  13. recursion( basic, basic + memoization, backtracking)
  14. dynamic memory management( both C style and C++ style)
  15. #define macros (yes I have seen some the potential problems, but they can be fast and fun)..

I can implement basic versions of the above with no notes (other than maybe implementing a Trie, which I have not worked with as much). Most of the time I have spent doing problems sets, and reworking until I really feel I understand the concepts. Initially I spent a large amount of time on recursion and pointers, because they were the concepts that I found the most challenging.

what I have not yet learned;

  1. working with third party APIs
  2. graphics(I have worked a little with this, but I chose to learn more basics first)
  3. throwing exceptions
  4. anything related to interacting directly with hardware
  5. anything that directly uses internet data
  6. genetic algorithms
  7. any other IDE other than Visual Studio 8(it was free and came with learning materials)
  8. the 'virtual' keyword within classes

Since most of the available online free CS material relates to algorithms, that is what I have solely focused on this year . But I am a bit worried that I made the wrong choice, and would have been better off learning the less-difficult-more -popular languages such as Python, Javascript, or Ruby on Rails. Plus so many people relentlessly bash C++ that I fear I may be wasting my effort on a language that will no longer be used. My previous work was in Finance (derivative securities) but I no longer want to work for the White Collar Terrorists and want to change careers.

Ultimately I would like get into game programming, or anything else than uses the algorithmic material I have learned. I actually really enjoy what I have covered so far.

I would appreciate answers to the following questions;

  1. Did I choose the wrong material and language to study? If so what should I learn and why?

  2. How should I narrow down my field of study to include only skills that are currently in demand from employers? Will they appreciate my attention to the fundamentals, or do they only want very specific skills? Specific recommendations appreciated.

Ultimately I want to be working as a junior programmer by the end of the year, and need to orient my studies to what is in demand.

Thanks!

+2  A: 

Ha.

  • You're doing fine.

Go write pong for your first game. Yes, with graphics.

  • To know what game developers want, go look at the job postings from EA, Blizzard, Bungie, etc.

Typically it's a 4 year CS degree or equivalent experience, skills in math, and a passion for games.

Paul Nathan
+4  A: 

It sounds like you've covered a lot of the basics quite well, and efficiently. To really make the self-education equivalent to a degree, try implementing some standard academic projects: an interpreter, a server, some part of an OS. Many modern games involve such things as components. Or, of course, write some games!

The topics you have covered appear to be mostly fundamentals, and not covered seems to be mostly due to "working with third party APIs." Reading API documentation is a skill unto itself, so maybe it would be best to pick out a relatively complete game toolkit (sorry, I can't recommend one) and start from there.

Potatoswatter
+2  A: 

I think the material you choose to study is spot on. You spent a lot of time learning the concepts taught in most computer science programs. I think C++ is a good language to get a strong foundation with. It will help you appreciate and understand the "easier" languages with more depth (You'll also be able to pick them up very fast). Most game engines are written in c++ anyway.

Your background on algorithms will make solving problems with almost any language much easier. You could always try poking around with another language like python, Lua or ruby or whatever. You could even look at integrating your C++ code with an interpreted language ie. Boost::python. From my limited experience with game programming, a scripted language is usually part of larger game engines.

GWW
yeah, aeonnoob is doing amazingly well and is really dedicated. I wish I had learned that stuff that fast.
Paul Nathan
Me too, I wish I had that kind of dedication to get into game programming.
GWW
+1  A: 

You are obviously on the right track.

If you are passionate about developing games then C->C++ is the way to go. When you have enough and intensive experience with the language then I believe you should go check Game physics, Algorithms, Collision Detection and edge detection algorithms etc. You should also check openGL/DirectX programming and you may find the book "Game Programming Gems" useful.

MSI
The book "Game Engine Architecture" may be a nice choice as well.
GWW
A: 

Don't try to go in too many directions at once. Being REALLY good in one area far outweighs being good in many different areas.

There may be fewer jobs that require one skill set (for example, graphics), but you're more likely to land it and be happy with it because you know what you're doing.

And working 80-hour weeks in the video game / graphics industry may be less tedious than 40-hour weeks in the web-dev industry if you enjoy the former more.

Hope this helps

Edit:

I should also mention that the video game industry is not a narrow enough direction -- for instance, you can specialize in different platforms, APIs or environments -- OpenGL, Unreal Engine / UDK, Unity, XNA, DirectX, HLSL/GLSL/etc shader programming, etc. Investing time in mastering one platform will help a lot more than than skimming the surface of each one

vdeych
"Jack of all trades, master of none, but oft'times better than master of one." :)
RCIX
Maybe so, but thus far that hasn't been my experience as a game developer :T My experience is that being the "jack of one trade" has the potential to earn more money and will make the developer more satisfied
vdeych
+13  A: 

Of course this is a very subjective question. So I can only give my opinion, and that would be a resounding NO, you did not make a mistake learning C/C++. The core concepts you learn here will help with later laguages that you might want to or be required to tackle.

The strong focus on Algorithms is going to help you later down the line. But you need to make sure you now only know the implementation details, but how to select the most appropriate algorithm for the job.

I would suggest you keep the C++ knowledge as up to date as possible, for the gaming industry a scripting language will come in handy Python is a good choice and of course Lua. You might want to play around with integrating Lua into a small C++ app.

Learn a managed language as well, Java/C# just to get the concepts of the managed environment below the belt. Great .NET libaries like XNA exist for indie game development for platforms like PC, XBOX 360, Window Phone and Zune, and this is an easy way to ease into some of the concepts of game development for both 2D and 3D. And it's FREE.

Make sure that at some point you cover some database concepts!

I could go on for hours, but I won't bore you. For now I would say stick with what you are doing and branch out as you feel ready, use small projects and set goals for projects you want to be able to complete and work towards building you skils with those goals in mind. Keep the goals attainable and you will be well on your way.

Chris Taylor
Is it just a coincidence that your name is the same as that of GPG's CEO? ;)
RCIX
@RCIX, yes, just a coincidence.
Chris Taylor
+2  A: 

If you want to work in gaming or system level stuff you chose the right path.

But there is no substitute for building something real - as opposed to doing exercises with algorithms etc. Build something that actually does something. Even a simple game; breakout, pacman, pong, .. will be a huge eye opener for you. DO IT. Start today

Or if thats too much, look for other similar questions with people asking for suggestions for starter projects

Even a text-based game, no graphics

pm100
+2  A: 

Plus so many people relentlessly bash C++ that I fear I may be wasting my effort on a language that will no longer be used.

I'm not sure why you think so, but C++ isn't going away any time soon. It fact, it is the language of choice for most large game projects, because it offers much required OOP facilities while still allowing low-level code for efficiency.

The material you've learnt so far (algorithms etc.) will also come in very handy for most jobs. There are different kinds of jobs within the game industry, and it doesn't matter if you haven't worked too much with graphics, because there are positions which deal exclusively with gameplay aspects (game engine, AI, physics etc.) and these deal mostly with algorithms.

casablanca
I agree -- the reason you hear this is that game development nowadays mostly involves scripting or C#/Obj C. The C# for XNA XBLA games, and for scripting in Unity and certain other engines. Obj C for most iPad/iPhone development. However, the really hardcore well-paid stuff is done in C++, such as real XBox development, Unreal Engine stuff, etc. It's not going anywhere, but it's true that there is less room for it. It's a strength, since fewer people are able to master it.
vdeych
+1  A: 

Build your first game. Pong is good. Tic Tac Toe is also good because it requires little graphics work and teaches UI and basic AI. Then build a more complex game like Asteroids that only requires simple bitmap manipulation or simple poly rendering and 2D collision detection. Those 2 games will give you a solid foundation moving forward. Once you've done this and you want some hardware experience, check out this GBA Hobbiest site. It has the basic info needed to do GBA/DS games for minimal cost on hardware.

You are doing great. The kind of determination and motivation you show will definately look good come interview time!

Michael Dorgan
+4  A: 

Taking these one at a time...

Much of the OOP syntax, though often I choose to use structs rather than classes

If you're using struct instead of class, and it makes a difference, then you're not using access control (public:, protected:, private:) correctly. The only difference between struct and class is that struct members are public by default and class members are private by default.

If you are using access control properly, you should still prefer class to struct because the compiler will complain loudly if you forget to mark something public: or protected: that needs it, and because other programmers will be expecting to see class and will double-take when they see a struct with a bunch of methods.

#define macros (yes I have seen some the potential problems, but they can be fast and fun)..

They can also obscure things from others. I've seen several programmers use #define to create a "mini language" (e.g. #define repeat(n) for(int i = 0; i < (n); ++i), which has a whole host of things wrong with it for starters), not understanding that it's only a good idea if nobody else will maintain your code, ever.

what I have not yet learned;

1) working with third party APIs

Read the docs.

3) throwing exceptions

Lots of folks don't do this for performance reasons. I have no idea if their fears are well founded.

4) anything related to interacting directly with hardware

Unless you're writing drivers, don't bother with this. Even then, you might be required to drop down to C.

5) anything that directly uses internet data 6) genetic algorithms

You have to learn these by themselves no matter what language you use.

7) any other IDE other than Visual Studio 8(it was free and came with learning materials)

Most IDEs work more or less the same. The only other build system that is different enough to throw you would be make's Makefiles.

8) the 'virtual' keyword within classes

This one is pretty important. It should be your next topic.

I'd like to add to your list:

9) Object Oriented Design.

Because knowing the syntax and mechanics of an object-oriented language does not tell you all you need to know about how to take a complex problem and identify the needed classes and their relationships. This is not easy, is easy to mess up, and hard to fix after the fact.

Since most of the available online free CS material relates to algorithms, that is what I have solely focused on this year .

Algorithms more-or-less apply to all languages. For example, while you don't have to write a heap queue in Python (there's a built-in module for it), it still help to know how they work, what problems they solve, and when to use one.

But I am a bit worried that I made the wrong choice, and would have been better off learning the less-difficult-more -popular languages such as Python, Javascript, or Ruby on Rails.

Ruby on Rails and JavaScript are only really useful for web applications. Python covers a lot of the same problem set as C++ (and pulls in a lot of POSIX libraries, for example), so you'd probably feel the same about it had you learned it first.

Plus so many people relentlessly bash C++

This is true for any language. If that's all it takes to scare you off, you won't get anything done. Real programmers ship; the specific language is just a means to that end.

that I fear I may be wasting my effort on a language that will no longer be used.

FORTRAN has been around for decades, releases new versions every several years, and is still in wide use. C++ will die about the same time FORTRAN does.

Ultimately I would like get into game programming, or anything else than uses the algorithmic material I have learned. I actually really enjoy what I have covered so far.

This is going to be tough. From what I've heard from my friends in that industry, game programmers are an insular group; it's very hard for an outsider to get in. You might have better luck just starting on your own.

1) Did I choose the wrong material and language to study?

No. it might not be as optimum as something else had you knowledge of future events, but it's not a "wrong" choice.

2) How should I narrow down my field of study to include only skills that are currently in demand from employers? Will they appreciate my attention to the fundamentals, or do they only want very specific skills? Specific recommendations appreciated.

You can only really narrow down if you have a narrow field, or a single employer, that you are targeting. Otherwise, you're putting yourself at greater risk of being irrelevant. Cast a wide net.

Ultimately I want to be working as a junior programmer by the end of the year, and need to orient my studies to what is in demand.

Four months? Then you need to focus on an industry and study the companies involved.

Mike DeSimone
>Lots of folks don't do this for performance reasons. I have no idea if their fears are well founded.------- It isnt. See accepted answer at http://stackoverflow.com/questions/307610/how-do-exceptions-work-behind-the-scenes-in-c
acidzombie24
Key phrase from that answer: "While there was no extra overhead simply because an exception might be thrown, there is obviously a lot of overhead in actually throwing and catching an exception." Which is how it should be. (What I had heard before was that you incurred overhead on entering or exiting a `try` block, which was true for `setjmp()`/`longjmp()`-style exception handling.)
Mike DeSimone
A: 

The thing that jumped out at me was that you choose to use structs - this tells me you just need more experience with larger more complex designs that benefit from being broken down in OOP. Maybe start involving yourself with an open source project? I also think you'd benefit by doing a quick surface level intake of all those other languages you mentioned, like Java, PHP/Perl/Python, C#, and don't forget JavaScript. The point is, eventually you'll realize that there's so much in common that it's impossible, really, to learn the wrong language; I think it's only possible to neglect to learn more advanced topics in programming itself.

Gabriel
+7  A: 

Congratulations, from your listed skills I see you have a great foundation in learning C++ and the zeal and interest to become an excellent programmer. :D

Let me start here.

You did not make a mistake with learning C++.

I would make that message size 72 font if they'd let me. C++ is a fine and widely used language, and if you want to do gaming its a great choice. The main reason I discourage C++ is because I'm not sure if all beginners can handle its difficulty compared to other languages. But it seems like you haven't been scared away, so you're fine.

Some comments on what you haven't learned yet: As for 3rd party APIs, graphics, internet, hardware, and genetic stuff, you will learn what you want or need, and until one of those happens I wouldn't worry about it if you understand what they are used for. 3rd party APIs are an absolute must, the others will depend on where you end up. Boost is a great place to start as it is very widely used and helpful. Exceptions I recommend as they are a core part of many other languages and can be very helpful. What IDE you use is mostly your choice, but I'd recommend at least getting some basic skills with the latest version of VS. As for virtual in classes, this is a multiple inheritance thing that you should learn how to use correctly. Whether you use it in your projects is your choice.

As to getting a job, many skills vary from job to job, but some things don't. Knowledge of the basics, stuff like algorithms, OOP, memory management etc, is essential anywhere (recursion is a little overrated IMHO, you don't use it as much as the textbooks would make you think. Object Orientation is an absolute must). You should be familiar with the graphics library that the company is using if you need to, as well as any other technologies they want. If you don't know where you might be working, pick some of the most popular libraries and tools and get familiar with them. Experience with one with help you with the others.

IF and only IF you want to learn another language I would recommend either C# or Java. Both are wildly popular and similar to C++, C# is also used for some game programming. Learning new languages and paradigms is essential to being a good programmer, but if you're pressed for time you can put it off a little while longer. For now I wouldn't stray far from those three unless you need/want to.

My overall recommendation? PROGRAM. Write some games or whatever the heck you want and get your hands dirty with some problems. This will give you experience of what things are really like. If you've never had to debug a program of a thousand lines of code, then you will be less valuable. Finish some of your projects so you have something to show on a resume. If you have a solid foundation in the basics, some experience in your own projects, and familiarity with the specific skills required, you should have no trouble at the job interview.

Good luck, and you can always come to Stackoverflow if you need help. :)

CrazyJugglerDrummer
+1  A: 

Thanks all for the suggestions and support!

A few of you narrowed in on the fact I tend to use structs over classes, and that is a good call. My programming has mainly been algorithm problem sets, which usually are not more than 300 lines of code.

Classes it is..haha I need to move beyond the console.

Programming is more interesting than the finance I had previously studied, and is more difficult.

Recursion.. some of the online material I studied (like Stanford 106b) really gets into recursion, so I have spent much time on that. Then I discovered dynamic programming which could solve many of the same problems in shorter time.

There is just so much out there that I do not want to waste time trying to learn too many things.

can anyone recommend an open source C++ project that would be somewhat related to gaming?

good advice that I start programming my own game. will do.

Thanks again for the responses, realy helpful.

I think you should also focus on general Software Engineering principles as well, as this appeals to a lot of employers. Knowing algorithm X is all fine, but if you can't make affordable, extensible, maintainable code then you will be a hazard to your team. Also get some experience with a Source Control system, this I can't emphasize enough.
hydrogen
I still think you should learn C# just because exceptions make life much easier (Most classes in C++ dont use it. I still dont know a C++ lib that will throw an exception if it cannot load an image. And why would you check the error code obviously no one will be silly enough to remove the image ;P. Then something happens and your left confused. This can be applied to other things not just images.). You could make a game with SDL.NET which is what i used in my last one.
acidzombie24
I wouldn't recommend C# for exceptions, although they do make life a lot easier. I would recommend that you learn C# because it will give you valuable experience in a managed, garbage collected environment that is used widely in the corporate world. You may be called upon to write tools for games (or maintain existing ones) and this can be a lot easier with C# and the .NET Framework.
jasonh
+5  A: 

The most important thing is to get a solid understanding of fundamental concepts that you can use throughout your career. Development tools and programming languages will come into and out of fashion, but time spent learning computer science concepts will never be wasted - even if new ideas come along also.

It sounds like you've made an impressive start studying data structures and algorithms. That was a smart first choice. But real programs don't just consist of text book algorithm exercises. They have to manage data, communicate over networks, display user interfaces and reports, serve info over the web, manage concurrency and handle many other complex issues.

I suggest you consider broadening your study to learn about other topics too. Every programmer should know enough about relational databases to understand how to represent data correctly in relational tables, how to read and write basic SQL queries, know what a network socket is, and be familiar with the major aspects of HTML, XML and HTTP. And absolutely start to learn about object oriented design.

You should also expect to learn several languages. You don't want to be like a carpenter who only knows how to use one tool. Different languages are better suited for specific types of tasks. Learning other languages can show you new ways to think about problems.

I'd recommend learning a good scripting language early, like Python, which can come in useful for all sort of small tasks where C++ would be overkill. Java is pretty important to know, and a little JavaScript can be helpful. Its becoming more and more useful to get experience with a functional language, like Clojure or Scala.

You don't need to be an expert in every detail of each language you tackle, but you certainly need to be very fluent in at least one.

One last point. You mentioned that you don't haven't had experience using third party libraries. That's essential. Outside of learning exercises, most programming doesn't involve writing sort() routines or coding up complex data structures. Its much more efficient to learn to use good libraries than to insist on writing everything from scratch. In fact, I think its the mark of a good programmer to reuse rather than reinvent code. Since you've chosen C++ as your first language, I'd make it a high priority to learn to use the Boost libraries.

Alex Blakemore
+1  A: 

Absolutely not!

I found that the discipline needed to work with C++, and the insight needed to understand at a lower level what my apps were doing, was a great preparation for working in managed environments where that plumbing is present but hidden from view.

I've often found that it helped me solve issues that my younger colleagues don't know how to tackle. As a consequence, I've made it a habit to hire people who have some 'unmanaged' experience in their background.

Andrew Matthews
+1  A: 

I think you should have spent more time doing and less time learning.

The things you learned should not be learned by themselves, they should be learned as means to do something else. In fact, you'll find that most of what you learned you will not use and mostly forget. The most important things that make me a good programmer are the things that you can't possibly practice. They are subtle issues of design and foresight.

But no, you certainly haven't wasted your time learning C++. You did waste a bit of time learning. Now I'd suggest you try to apply it.

karpathy
afriza
+1  A: 

Those are all great fundamentals that you have learned. Certainly not a waste of time.

I think the best way to get to your end goal of game programming is to choose a simple game, plan it out and build it. Then expand on it or start a new project with higher aspirations. A friend in the finance world did exactly this with a flash game (for his amusement rather than a career change). I think you basically need to get your command hours up in something relevant to what you want to jump in to.

Seeing as you have started with MS technologies you may find this a natural progression:

http://msdn.microsoft.com/en-au/xna/default.aspx

I would try a simple Xbox360 arcade game :p

Good luck mate.

Ben E G
I hear the GC is a nightmare and can crash games 4mins in. -edit- assuming your running it on the xbox
acidzombie24
@acidzombie: i hear the same thing, but you just have to take pains to optimize it to not make too much garbage then :)
RCIX
@RCIX: I heard to 'not create anything new ever' except when 'you do it once and reuse forever'. He never mentioned optimizing, just dont try to free or create objects in your main loop.
acidzombie24
@acidzombie24: Judging by the number of XNA games on the Xbox that I've played and ran well, it must not be *that* difficult. ;)
jasonh
@jasonh: I'm not saying its *that* difficult but it could be annoying and take a day or two of debugging if you dont know about it from the start (maybe other games crash every 40mins rather then 4 as my friend game did). But anyways i am going to say my answer is the best bc i am bias and bc i think it kicks ass and is most pragmatic.
acidzombie24
A: 

YES BUT i have told people in the past to look at C++ tutorial since some good ones are very easy to find and learn C# after it. C# is similar enough syntax and its easy enough to ask SO or to google how to do something in C# especially when you can explain using another language (or in C or C++).

If you want to do a game then you will eventually need to learn C++ so that wasnt a mistake. What i consider a mistake is learning HOW to program with C++ since its very difficult. Also when you make a mistake you get weird behavior or crashes. In C# and other languages you get exceptions ;). Writing code in C++ is more prone to error such as if(intVar). much of the time you forget to write == 0 or -1 and in C# it forces you. Theres other as well but thats just one example.

In short what i recommend now is - use your C++ knowledge to quickly learn C# - Ask SO - Write a few programs/prototypes in C#. - Possibly find a job from C#/.NET (or vb.net if you want to learn that. Most from what i seen are C#) - After not hating your code every few weeks (possibly now you hate it after 6+months instead) go back into C++. You might feel frustrated by how most libs dont give you exceptions and those petty typos/errors but you have coding experience and not make them as often. - do what you want

I'll suggest NOT using a dynamic language as the learning curve is steep. I find when learning you make tons of errors and need to restart the project a lot where compile errors are more upfront. I dislike dynamic especially for anything not so simple. I dislike even python. A guy once suggested to me to keep all code in one large file to more easily debug in python.

Use a good IDE, figure out how to use call stacks, breakpoints, watch variables and bonus if you have an 'immediate' window which lets you write code to change vars or whatever. But thats something i hardly use. Visual Studio has all of these.

acidzombie24
A: 

Write for Apple platforms!

FastAl
A: 

No, you did not make the wrong decision.

I learned C++ first too, and I'm quite glad I did. Have you studied pointers yet? Heap vs stack?

I think C++ is one of the more difficult languages, and will give you a better idea of what goes on under the hood with these other managed languages. I think going the other way around, from a managed language to something lower-level such as C++ would be more difficult, because all that stuff you took for granted, like garbage collection, would no longer be there.

All the concepts you've learned thus far are perfectly transferable to any other language, so nothing is wasted even if you never write another line of C++ again.

That said, if you want to go into gaming, you probably will be writing C++ again.

Mark