Jump to content
  • Advertisement
Sign in to follow this  
loxagossnake

How do you 'learn' a programming language?

This topic is 1722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 rolleyes.gif 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?

Share this post


Link to post
Share on other sites
Advertisement

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).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!