### GameDev Marketplace

#### Men's i.make.games T-shirt

$20$15

### Image of the Day Submit

IOTD | Top Screenshots

## How do you 'learn' a programming language?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

22 replies to this topic

### #1loxagossnake  Members

Posted 16 October 2013 - 01:09 PM

The topic header might be a bit ambiguous and rage-inducing, so let me clarify it for you before I end up with life threats  I have only recently put my foot in the waters of game development, and it's mostly theoretical stuff about it. My story with programming -and desire to develop games- though has begun at least 6 years ago, in High School, in an extracurricular class, but that was mostly Pascal-based procedural algorithms. Lately, and after finding a few good men who would like to join me in my quest (and they are serious about it) to learn and finally develop a game or two, I started putting a more serious effort in it. Before you bash me about gathering a small team when even I can't stand on my feet, I have to say that it's just two friends (one is a coed of mine in Physics school) and it really helps keep the motivation up, since we insist on learning together and every time someone gets disappointed, another member of the trio keeps him enthusiastic.

Now, on to the actual question. Since I have fallen flat on my face many times when I thought making a small game would be a piece of cake, I have gotten a more realistic picture of what is in store for us. So, I wanted to start from the basics: learn a programming language, and learn it really, really well. I know I can't master it in the next 5 or even 10 years, but I want to achieve a solid understanding of its elements. That language is C++. I know it's rough and low-level and I didn't pick it because 'it's what the pros use'; I actually love it with all its shortcomings, and I find its attention to detail to be parallel to game development itself. Thus, I shelled out some cash to pick a book after some brief research: that book is C++ Primer, 5th Edition. I have to say it is pretty readable and goes very deep where it is needed, so no complaints about the book itself. It's me who has the problem. Whenever I establish a good reading routine, some kind of OCD kicks in and all in all, I give up. What usually happens is that I read a lot of material, and even if I leave it for a couple of days because of college work, I believe I will forget everything and insist on starting all over again. And yeah, I do most of the problems in the book and write my own code. Also, whenever I get stuck at something I don't understand, I get disappointed. This pattern repeats and it is usually one or two month gaps that I don't do any work. The result? I end up actually having to re-read.

This may be suited better for a psych forum, but before I visit the shrink with such a ridiculous problem, I wanted to ask you people. Which do you think is the best way to absorb the material of such a big book? Do you have to actually understand every single line to even consider stepping into a game development framework? Or can someone go through the book once, fully understand the basic concepts like OOP, and just hop up in the pages again if further reading is needed?

Posted 16 October 2013 - 01:15 PM

POPULAR

I taught myself C++ from Bjarne's book (and some others). I did it in 2 stages:

1) read the book cover to cover to get an overview

2) go back and start at the beginning, not advancing until you understand the concepts (doing the exercises would be done in this step).

So I skim once, then go back and read carefully. Reading a lot of other people's code helps a great deal too.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

### #3fastcall22  Moderators

Posted 16 October 2013 - 01:25 PM

POPULAR

not advancing until you understand the concepts

... and completing every exercise at the end of every chapter and redoing every exercise once you learned how to build it better.
zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

### #4Lodeman  Members

Posted 16 October 2013 - 02:36 PM

POPULAR

I took a different approach to this.
Reading too much books without doing something you want to do with it can be a source of demotivation.
Therefore, read enough so that you understand the basic concepts such as pointers, vectors, basic data types, object oriented class design, that stuff.
Now take that, and start making a game.

As you do this, you will automatically run into problems, which you will then seek to fix. These won't just be design related problems, but some will result as a lack of fully understanding C++. When you tackle this problem, you will learn alot from it. This pattern will repeat and you'll always improve your skills. The most important bit is to never, ever give up. Some problems might be tough, but eventually you will crack it.

My starting point was using SDL to make a simple tile-based farming game, I used these tutorials as a reference: http://lazyfoo.net/SDL_tutorials/

Don't expect your first game to be a work of art, both in terms of graphics, nor in terms of game design. But you will learn so much from it, alot of things you shouldn't do.

Take it one step at a time, but keep working on something. That's how it worked for me.
Hope this helped!

Cheers

Posted 16 October 2013 - 03:53 PM

POPULAR

Agreed with the above - start working on a small game! I'd you've never successfully completed a game yet I'd suggest starting with Pong/Tennis, but any relatively small/simple game idea will do.

Just get an image displaying on screen, then allow the user to control it via mouse or keyboard, then add another image, then detect collisions between the two, and so on and so forth.

Whenever you get stuck refer back to your book, check online resources, or ask here. Working on an actual game should provide more motivation for you, and actually applying the information in a useful way should help you to properly understand it.

Posted 16 October 2013 - 04:02 PM

really the best way to learn programming is to just code and keep coding.  You said you read something and you do the examples.  Ok good, but is that all?  I used to do the same thing and well I thought I knew all the concepts but I found later on when it came to applying them to a different program I hadn't really learned them.  Then what I started to do was create my own examples.  Ask yourself questions while reading.  While your reading try creating your own examples before you even get to your exercises in the book.  What you will end up doing is helping yourself understand this concept in a lot of different ways.  The ways/examples you do might not be meaningful or useful but that is ok.

Next after you do the examples in the book, try to extend on them and make them into a more "complete" program/example.

Finally if you don't understand a certain concept try writing it down.  Work through that concept on paper like the program would run it step by step.  Then put that concept into a program and use your debugging tools to attempt to run the program step by step.  Look at what values changed?  Why did they change?  Work that out on paper and compare the results.  If you are getting the same results on paper as you would get in the program then you're understanding the concept more.

It all comes down to, just keep programming.  Their will be concepts you don't get or understand right away.  Just keep programming.  We all need breaks and everyone here understands that.  Though in the end make sure you come back and keep programming.  When you come back instead of thinking that you have to reread everything try testing yourself on what you read previously without looking at your book.  If you keep doing all of this before you know it you will solving problems all on your on.

Just remember though we all need help sometimes.  Don't be afraid to ask questions.  Everyone here be it professional or not need to ask questions sometimes and we have all been there before and we all understand (ok their are a select few people I've noticed that do believe they are above everyone and think they understood everything first try, but ignore those people).

### #7cyberpnk  GDNet+

Posted 16 October 2013 - 10:12 PM

Yep, the best way to learn is just to start doing it and figuring things out as you go along.

### #8blewisjr  Members

Posted 17 October 2013 - 09:52 AM

I know many programming languages and it is really not the language that is difficult to learn this is often just various API, and Syntax.  The best way others have mentioned is to learn by doing and researching as you get stuck.  By doing this you learn various algorithms and data structures they carry over across programming languages and then it is really just about the syntax.  This follows suit for all imperative languages and does not really break down till you try to learn a functional programming language where all the design patterns, algorithms, and data structures must be represented in a completely different way.  So as long as you are sticking along the lines of C++, C, Java, C#, Python, etc... Learn by doing/researching eventually it will start to click and make sense.  There is no way to just learn by just reading a book it really takes personal projects to get the total picture.

### #9EddieV223  Members

Posted 17 October 2013 - 10:06 AM

Start some projects that would be fun to you, if you aren't good enough to start a project yet then read a book on the subject.

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

// Easy to learn 2D Game Library c++

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

// SFML 2 book

### #10Godmil  Members

Posted 17 October 2013 - 01:25 PM

How about a challange?  See if you can  solve 5  problems on Project Euler

### #11Malabyte  Members

Posted 17 October 2013 - 10:05 PM

I know many programming languages and it is really not the language that is difficult to learn this is often just various API, and Syntax.  The best way others have mentioned is to learn by doing and researching as you get stuck.

And be sure to indeed do that research, because there's little that is more frustrating than trying to "learn by doing" when you don't actually know what you're supposed to be doing.

- Awl you're base are belong me! -

- I don't know, I'm just a noob -

### #12Buster2000  Members

Posted 18 October 2013 - 02:32 AM

I used to read the book cover to cover then go through the book again but this time actually write the code and also edit the code and make my own changes.

I think recently things have changed with proper online courses.  I'm currently learning Scala and have found the easiest way is to do the free Moocs offered by coursera.  Some of programming Moocs offered are really good.  If I was a complete newb and I wanted to learn to code I'd probably try code academy, Udacity or Rails for Zombies.

If you want to do C++ there are several courses on Udemy, Coursera and iTunes U.  The quality of these vary but they are all a lot better than any for Dummies, For Idiots or in 24 hours books.

### #13axefrog  Members

Posted 18 October 2013 - 04:56 AM

The problem when you start out programming is that your brain is not really trained to think at the sort of logical level required to effectively deconstruct problems and create logical solutions. The only real way to train yourself to think this way is to force yourself into situations where you must think this way to solve the problem. In other words, however little you know, use it to write something.

First, why not try to write a simple guess-the-number game? Look back over your code and try to work out what you could have done better. Post your code in a Gist (over at Github) and ask people here to help code review it for you, but be sure to explain what you're happy with and what you think could be improved (i.e. what effort you've put in so far to that end). Code review with peers is very important to your growth as a developer, so don't try to do this in complete isolation or you'll slow your growth down severely. Last but not least, be extremely self-critical and always seek to do a better job with your coding than you have previously. After 15 years of coding myself, I still find things I can do better and I always assume that there are plenty of others out there who are much better than me, that I can learn from. With that attitude, you'll pay attention to programming articles, you'll investigate how others have solved problems similar to what you're working on and you'll stay on top of the curve in general, just because you're genuinely interested in being the best that you can be.

Finally, expect road blocks and frustrations every step of the way, but don't let them stop you. Be relentless in trying to understand the individual aspects of what you're doing and in figuring out the issues you're trying to solve. StackOverflow is an invaluable resource, use it! Khan Academy is fantastic for fundamentals such as math and physics, when you need them, and there are plenty of other online learning resources that cost you nothing as well. Remember, when your head feels like sand after feeling like you've been beating it against a problem for hours, know that your knowledge and skill is growing. When you relax and especially when you sleep, your brain is reprocessing what you've experienced during your coding and is optimizing its neural connections little by little so that, with persistence, you'll become more and more proficient in every aspect of what you're doing.

It will take time, but persist and you'll win!

### #14aspringgamer34333  Members

Posted 18 October 2013 - 04:01 PM

i haven't actually coded a single game yet or a single applicatin yet...

i've been reading as many books as possible on c++ and watching a crap load of video, algorithms by robert sedgeiwck on coursea.org. Now I know how to implement merge and quick sort and binary tables.  I'm working on red-black trees now.

I'm trying to get recursion 100% down. I understand tree traversal with recursion to a certain extent. IT's still a challenge though. Working through Stanford c++ YOUTUBE - cs106b. I'm stuck on recursive backtracking. Trying to figure out how that all works.

so far i guess i have a rudimentary knowledge of c++, java, and javascript.  Any suggestions on what I should do next? I think i need to start realy learning STL with Boost.

### #15Malabyte  Members

Posted 18 October 2013 - 08:19 PM

I'm trying to get recursion 100% down. I understand tree traversal with recursion to a certain extent. IT's still a challenge though. Working through Stanford c++ YOUTUBE - cs106b. I'm stuck on recursive backtracking. Trying to figure out how that all works.

I thought it was just a matter of memory allocation and that, the longer the recursion travels, the more memory it requires because the computer needs to store all that information simultaneously and then calculate it all once the recursion has reached the end. But I get the feeling that this isn't what you're wondering about.

Edited by Malabyte, 18 October 2013 - 08:19 PM.

- Awl you're base are belong me! -

- I don't know, I'm just a noob -

### #16Tutorial Doctor  Members

Posted 19 October 2013 - 12:54 AM

I typed in Game dev in google and got this site. I was looking through the forums and saw this post. I just had to join to let you know that I have made several tutorial on programming (I am new myself), and I have produced quite a bit. I am using the Maratis3D game engine myself. Anyhow, here are a few links to some tutorial I have written

Introduction to Computer Programming

http://snapguide.com/guides/understand-computer-programming/

http://forum.maratis3d.com/viewtopic.php?id=793

http://forum.maratis3d.com/viewtopic.php?id=830

Object Oriented Programming

http://forum.maratis3d.com/viewtopic.php?id=839

Boolean

http://forum.maratis3d.com/viewtopic.php?id=840

I will be looking through these forums to learn more about game development. If you need any other tutorials (I know of many) let me know.

Edited by Tutorial Doctor, 19 October 2013 - 01:05 AM.

They call me the Tutorial Doctor.

### #17Anri  Members

Posted 19 October 2013 - 05:44 PM

Learning a language is quite a mammoth task, especially if its your first, but I find that continuallly making progress daily is a good thing, even if it is just a small amount of time you dedicate to studying.

Here is a great tip I have learned over the years for any kind of studying or task: get to bed earlier than usual - even if its just 30 minutes sooner - and do about 30 minutes the following morning. That way, you can relax safe in the knowledge that you have made an effort. You don't want to drag the day out constantly thinking "sigh, I still haven't done anything...maybe I'll find time tomorrow....".  30 minutes each morning and you'll clock up three and a half hours a week of programming experience.

At the moment I am currently working with a friend on a 3D modelling project, and where they(being a professional) will update once every few days, I will update a little on a daily basis. Although I'm not on the same skill level as my friend I am at least keeping up with them, and the project is moving forward on a daily basis.

Right, I must get my beauty sleep now or I'll not be thinking straight in the morning!

### #18Tutorial Doctor  Members

Posted 20 October 2013 - 09:54 AM

Learning a language is quite a mammoth task, especially if its your first, but I find that continuallly making progress daily is a good thing, even if it is just a small amount of time you dedicate to studying.

Here is a great tip I have learned over the years for any kind of studying or task: get to bed earlier than usual - even if its just 30 minutes sooner - and do about 30 minutes the following morning. That way, you can relax safe in the knowledge that you have made an effort. You don't want to drag the day out constantly thinking "sigh, I still haven't done anything...maybe I'll find time tomorrow....".  30 minutes each morning and you'll clock up three and a half hours a week of programming experience.

At the moment I am currently working with a friend on a 3D modelling project, and where they(being a professional) will update once every few days, I will update a little on a daily basis. Although I'm not on the same skill level as my friend I am at least keeping up with them, and the project is moving forward on a daily basis.

Right, I must get my beauty sleep now or I'll not be thinking straight in the morning!

That response is rather profound! I took a screenshot of it. There is a life lesson to be learned in that. I actually did this once, to try to become focused on something. I made it the FIRST priority. At first I only made excuses. But when I started doing it as a FIRST priority then I was able to make progress. And it came to the point where that priority didn't only get 30 minutes, but sometimes whole days. I need to refocus my priorities again this way.

I like how you say you are not on their level, but you make steady progress. Seems to me you are more dedicated.

They call me the Tutorial Doctor.

### #19Anri  Members

Posted 21 October 2013 - 01:42 PM

Thank you, Tutorial Doctor.

Yes, I understand how you feel about losing your way. This usually happens when you take on more than 30 minutes a day due to greater expectations of yourself which can lead to giving up or burning yourself out.

On the subject of skill level and dedication: Well, I keep in mind that as good as my friend may be, nothing will change the fact that many hands can make light work! So long as I have a useful skill - in this case low-polygon modelling - I can at least make their work lighter...

### #20Serapth  Members

Posted 21 October 2013 - 02:55 PM

I personally learn by osmosis.  Buy a couple programming books, pick one each night and use it as a pillow.  The knowledge is sure to seep in eventually.

In all honesty, its like any other skill, try fail, iterate, succeed, repeat.

I started learning to program before the Internet and to be honest, I think that was probably a good thing.  There were less resources, true, but also less options, less distractions and less porn.  As a result, I spent a lot more time doing instead of thinking about doing.  I think starting out today, you are spoiled for choices... in a bad way.  Just way to easy to get distracted... or spoonfed.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.