#1 Posted by Jams (2966 posts) -

I have been trying to learn how to program games since I was tween. Without any success past "hello world". I did end up learning how to make good use of HTML and CSS in high school But I still couldn't catch on to the programming language. Fast forward 9 years and I'm still trying to learn (with maybe a little more success in understanding). I've again lost some hope for learning and right now I'm wanting to jump back in (because I made more success with my last effort than I have before).

So what I'm wondering is, any of you programmers out there have any false starts before it clicked for you and you were on your way? Is there any advice for us who are having trouble thinking like programmers other than keep trying (I'm already taking that advice)?

#2 Posted by cmblasko (1354 posts) -

Have you looked into taking classes? Not everyone is able to teach themselves how to program, and even if you did there's a good chance that you would develop bad habits along the way that could have been prevented with guidance from an experienced instructor.

#3 Posted by Video_Game_King (36272 posts) -

@jams said:

Is there any advice for us who are having trouble thinking like programmers other than keep trying (I'm already taking that advice)?

Not from what I've seen.

#4 Edited by Jams (2966 posts) -

@cmblasko said:

Have you looked into taking classes? Not everyone is able to teach themselves how to program, and even if you did there's a good chance that you would develop bad habits along the way that could have been prevented with guidance from an experienced instructor.

Yeah but there aren't really in my area. The only way I could take a class would end up costing more time and money then I can afford.

Also my biggest problem is when I try to write my own program without looking at the book I sit there and guy uuhhhhh what goes first?

#5 Posted by EXTomar (4951 posts) -

I wouldn't say false starts an issue as much as failure in planning. It turns out even a carefully planned project takes more time and energy than initially allocated and you have to abandon it. The only real advice I can give is plan plan and plan some more where you must realistic with your timelines.

#6 Edited by cmblasko (1354 posts) -

@jams: What language are you trying to learn at the moment? And there is no shame in keeping a book around for reference until you commit things to memory.

#7 Edited by 49th (2851 posts) -

I don't consider myself to be a programmer, or even want to be one, but I've done quite a bit of programming.

I started with learning the programming fundamentals with Java (loops and functions and variables and such). I have also used ActionScript a bunch and then also did some C++ with OpenGL and made 2 simple kind of games. Now I am doing Java for Android which is confusing as hell since I don't know object-oriented programming (which I didn't have the opportunity or desire to take).

What I think is most important when you are programming is having a strong understanding of the basic concepts, and knowing how to use those concepts to make something more complex. Going through example code is helpful as well - rather than trying to do everything yourself. Try to make your own version in tandem with the other and make slight changes along the way which you understand.

#8 Posted by Chibithor (573 posts) -

I've tried to learn myself two or three times and attended some basic course one year, but I'm now on an online course by an university I'm planning to attend next year. I feel like online courses are a good way to do things if you're having trouble going about it independently and want to get at it at your own pace and for free.

If you're still at "hello world" you could check the course I'm on in English here, there's also stuff like Udacity, Coursera and edX but you can find more online if they're not to your liking.Something to consider at least

#9 Posted by stri26 (31 posts) -

Have you checked out coursera.org? Colleges put courses on their, with assignments, video lectures, grading, etc, for free. I have taken two courses in Python that were pretty great (made Pong in one of them, hehe).

I was in graduate school for nutrition last year. After completing my first year of the program I decided that I would not enjoy a career as a dietitian. I'd always been interested in CS/programming, but was also a bit afraid to get into it. I realized, however, that I needed to do something that would keep me stimulated and keep me thinking, so I left the nutrition program and began a graduate program in computer science a few months ago. It's pretty wild having no background in it, but I'm learning so much, and figuring out how to make something work is damn exciting. Definitely not anywhere near making games (though now my mind is even more blown by the code behind games when I play them), and I don't necessary plan/hope to make games in the future (though it would be rad), but this whole thing has been a great life change.

Sorry for the tangent...but yeah, definitely check out coursera, maybe check out some other tutorials/free textbooks (there tend to be a lot of these for beginners in python). If you get into it, or want to talk about ideas or anything, I'd love to talk about it. Definitely looking for more like-minded beginner programmers with whom to talk.

Good luck!

#10 Posted by Codeacious (960 posts) -

I can't really give to much knowledge on this sort of situation, since I took a (very basic) CS course in my school in 8th grade (which was actually for freshmen, but the district let me take it), and have been programming ever since.

My number one tip for learning anything in a language though, is look at examples. Just examining code someone else wrote can go a long way to teaching yourself how to do certain things in a language, or coding in general. Also, don't try to completely understand what's going on when you're writing code; coding, by nature, is a "black box," in that you put in some input and get some output. You don't have to worry about how it's getting that output, especially when you're first starting out.

#12 Posted by Jams (2966 posts) -

@cmblasko said:

@jams: What language are you trying to learn at the moment? And there is no shame in keeping a book around for reference until you commit things to memory.

Python. But I have tried a bunch of different languages (the last being Java). What I notices is that it wasn't the language that was the problem, it was my ability to understand the concepts and how to use them in tandem.

But the last book I read, "Invent Your Own Computer Games with Python, 2nd Edition" the concept of things like for and while, etc I actually get but I still don't understand how I'm supposed to know when to use them. Especially since it seems like you can do it any way but some are the right way and other are time consuming.

#13 Posted by Salarn (469 posts) -

@jams: I've been programming for a very long time. The number of false starts declines with practice and experience, however false starts is very different than code that you want to go back to and refactor. It's very rare to have something work the first time and never need to go back to it at a later point.

Especially if you have designers always wanting one more feature, or the engine needing a bit more optimization to get that frame rate up. However, if you find yourself starting completely over it's generally because your current task is too big, always break tasks into the smallest bits as possible and you'll see an improvement in successful 'starts'.

Feel free to PM me if you have any specific questions.

#14 Posted by Ubersmake (754 posts) -

I've had plenty of false starts, but they've mostly stemmed from me becoming disinterested in projects. These are the sort of projects that "sounded good at the time," and then sort of diminished as other things in life came up. Like that time I wanted to created a tabletop RPG engine in JavaScript, or doing something for Android, or maybe finding something to justify the purchase of the iOS-related books on my shelf.

So, the first step is finding something you want to make. Not finding something to make so that you can learn a language. That's what happened to me in those aforementioned instances. Find something you really want to make, and do whatever is needed to make it happen.

Step two is to ask a lot of questions. All the questions.

Programming is hard. The syntax is different, and you're never going to deal with massive if-else blocks in actual communications with human beings. There are false starts to be had here, and they can be overcome with enough perseverance, and maybe a little stubbornness. But the other stumbling block that's easy to overlook is the goal itself. Make something you really want to make. Maybe get some friends to hold you to it. But if your goal is to, say, make a game, it's the passion to make the game that should be fueling the desire to learn a language, not the other way around.

#15 Edited by idBloc (124 posts) -

@jams: Guess what... I started the exact same way as you do and ended up doing that for a living. Don't focus on the language; don't let people tell you that standards and security go first because it will push you towards a language/framework that is harder to understand and you will likely give up. Security and standards will come with time... Be patient and you will get there.

I started doing stuff with HTML/CSS, I did a bunch of prototype by taking snippets of code online and modified it. Then after 6-7 prototypes I started my own HTML/CSS stuff; I eventually got good at it and I needed a next step so I went to web programming and PHP worked for me... I wasn't smart enough to go C, C++ or Java so PHP was a fit.

I went to CS school and nothing I learned there was useful today; I learned everything all by myself with patience so you can do it.

It doesn't matter how, just do it, make it work, learn from it, make it work, learn from it, improve it and so on.

Remember, think small and go big; don't think big to go big you will give up.

It's worth it, go do it!

#16 Edited by TooSweet (399 posts) -

I am just starting to learn now. I did some HTML in my time but not more than that. The future is changing fast and in order to not be a one trick pony I figured I should really just learn programming in order to make me more marketable for future work. At the moment I'm learning Ruby from codecademy.com. Some parts were tricky but with repetition I started to get it. Some parts came easy some not so easy. But I'm trying to keep in mind that this will take time and even when I get it there will still be more learning to do. So I dedicate time each week for it. Especially when I'm at home and wondering what to do with my time.

I never had a brain for programming I thought and I'm not the fastest learner but I'm sure I can become good at this. I chose Ruby since I've heard it's not as tough to learn as other languages. I'm starting with Codecademy but plan to use other sources in the coming months. For example Harvard has released a free Computer Science course. I hear MIT has done so as well. So there you have it. The internet being used for something other than porn. Best of luck!

#17 Posted by Gamer_152 (14113 posts) -

I'd advise looking into classes on the subject. There are a lot of people who will tell you it's pointless and you can get everything you need online (a worrying number of these people don't program themselves by the way), but there are a lot of important things you get in a class that are almost impossible to get anywhere else. In my experience, teaching you the underlying concepts are something that courses are better at than online tutorials and documentation.

Moderator
#18 Edited by Morbid_Coffee (955 posts) -

I tried teaching myself some programming early last year and made some progress before hitting a wall where things either made no sense, or I just wasn't motivated to continue because I didn't understand all of it completely.. Made the decision to go back to school this year and having somebody to motivate you and deadlines to meet resulted in me learning a hell of a lot more than what I tried to teach myself.

#19 Edited by Salarn (469 posts) -

I'd advise looking into classes on the subject. There are a lot of people who will tell you it's pointless and you can get everything you need online (a worrying number of these people don't program themselves by the way), but there are a lot of important things you get in a class that are almost impossible to get anywhere else. In my experience, teaching you the underlying concepts are something that courses are better at than online tutorials and documentation.

This is definitely true. I exit my 4 (well, 5) year degree thinking I was wasting my time, after a few months when I was working on professional code with other people the stuff I learned from class suddenly started to bubble to the top and I ended up checking in with my old professors and thanking them followed by apologizing for being a jerk student at times.

However, make sure you're augmenting your classes with side projects where you do what you want to do. Having a porfolio is crucial to getting a job these days.

#20 Posted by TheHBK (5563 posts) -

I went to MIT but never learned programming. I am currently taking an online course through the EdX program. MIT also has all the materials and lectures online for a lot of classes. The class for Python is called 6.00 Introduction to Computer Science and Programming. You can find all you need below, including reading materials, homework and lectures. The edx is a class where you get a certificate at the end for completing it but it goes on a semester cycle and started 6 weeks ago so probably too late to join now. But you can go through it though understand you won't get credit or won't be able to submit homework which sucks. But the opencourseware, the 2nd link serves the same purpose and is the same class, only with everything laid out and you can go at your pace doing the assignments and stuff.

edx MIT 6.00x

MIT OpenCourseware 6.00 2008

#21 Posted by mosdl (3259 posts) -

@jams said:

@cmblasko said:

@jams: What language are you trying to learn at the moment? And there is no shame in keeping a book around for reference until you commit things to memory.

Python. But I have tried a bunch of different languages (the last being Java). What I notices is that it wasn't the language that was the problem, it was my ability to understand the concepts and how to use them in tandem.

But the last book I read, "Invent Your Own Computer Games with Python, 2nd Edition" the concept of things like for and while, etc I actually get but I still don't understand how I'm supposed to know when to use them. Especially since it seems like you can do it any way but some are the right way and other are time consuming.

Woah there pardner, I think you are jumping ahead of yourself with that kind of book. You should stick to fundamentals (for/white/etc) first and get a hang for them before jumping into anything complex like games. Going too fast is a great way to get confused and frustrated.

My recommendation would be to start a simple project and work on that, preferably something that interests you. In python, maybe parse the Giantbomb RSS feed for starters and go from there. If you have a smartphone, try building something basic for that.

#22 Edited by Jams (2966 posts) -

Thanks guys for all the info. Hopefully this'll help anyone else who's been wanting to start too.

#23 Posted by Jams (2966 posts) -

@mosdl said:

@jams said:

@cmblasko said:

@jams: What language are you trying to learn at the moment? And there is no shame in keeping a book around for reference until you commit things to memory.

Python. But I have tried a bunch of different languages (the last being Java). What I notices is that it wasn't the language that was the problem, it was my ability to understand the concepts and how to use them in tandem.

But the last book I read, "Invent Your Own Computer Games with Python, 2nd Edition" the concept of things like for and while, etc I actually get but I still don't understand how I'm supposed to know when to use them. Especially since it seems like you can do it any way but some are the right way and other are time consuming.

Woah there pardner, I think you are jumping ahead of yourself with that kind of book. You should stick to fundamentals (for/white/etc) first and get a hang for them before jumping into anything complex like games. Going too fast is a great way to get confused and frustrated.

My recommendation would be to start a simple project and work on that, preferably something that interests you. In python, maybe parse the Giantbomb RSS feed for starters and go from there. If you have a smartphone, try building something basic for that.

Games interest me. That book actually teaches basic programming concepts in the form of text based games so it was really helpful (and probably one of the best language learning books I've read). Not sure how to apply programming to anything other than games.

I don't even know what else to come up with. I would've never in a million years thought to try something like parse and RSS feed. What other kinds of projects would be better? I've heard of people using python for simple scripts and stuff, but I wouldn't know what to apply it to. I did hear about a guy using a python script to get Simcity 4 to auto save every 15 mins.

#24 Posted by LassieME (234 posts) -

I got my dad to teach me ASM when I was around 10 years old, so a lot of what I remember from that is kinda nostalgic at this point, but I would recommend getting someone to give you feedback on your work from time to time, it really helps with both motivation and the quality of your work.

#25 Posted by Salarn (469 posts) -

@jams: Have you considered using Unity and C# ?

#26 Edited by Enigma777 (6059 posts) -
#27 Posted by joey (987 posts) -

Just start simple. Try completing various small projects. Make tetris or space invaders.

#28 Edited by Jams (2966 posts) -

@salarn said:

@jams: Have you considered using Unity and C# ?

I have it on my Mac right now. There was a really good RPG tutorial that was really in depth. I got all the way up to have 2 blocks with health bars that could hit each other. The problem I realized was that I wasn't learning C# scripts the guy was making for everything. The concepts were too advanced and I came out of it feeling like I didn't learn anything. It was still really good and I have it bookmarked in case I ever get better and want to get back to Unity.

#29 Posted by Metzo_Paino (322 posts) -

I've been trying to learn to programme for about a year now. After finishing my little iOS game made in GameSalad I wanted more freedom, and perhaps eventually a job coding things. Unfortunately when figuring out what to make I'd always hit a road block. Still trying to slug at it though.

#30 Edited by Szlifier (515 posts) -

Get into Object Oriented PHP and once you're familar with coding there just try C# as it's pretty solid choice now for indie games. I wouldn't recommend C++ and C as they require to write much more stuff to do the same thing than PHP, but they are not that apart really. They are just used for different things.

Again, don't start with C++, it will kill you.

#31 Edited by TyCobb (1975 posts) -

I would suggest making stupid applications that store data. Make something dumb like a program that tracks your game library. You have to learn how to walk before you can run and to me making a game is running.

The reason I suggest this is because it is a lot easier to make progress and see it. This allows you to learn how to code, the language you are working in, and figuring out OOP. You get to also finish projects faster and compare them so you can say "Why did I do that when I could have done this" or "What was I thinking when I wrote this? The way I did it over here was way better".

Some people start off making games of course and that works for some, but I think for most, it's not the best way.

Maybe I am insane, but I prefer making business apps rather than games anyway. Plus if you are looking for a career, us application developers make more than game developers anyway =P

#32 Posted by Jams (2966 posts) -

@tycobb said:

I would suggest making stupid applications that store data. Make something dumb like a program that tracks your game library. You have to learn how to walk before you can run and to me making a game is running.

The reason I suggest this is because it is a lot easier to make progress and see it. This allows you to learn how to code, the language you are working in, and figuring out OOP. You get to also finish projects faster and compare them so you can say "Why did I do that when I could have done this" or "What was I thinking when I wrote this? The way I did it over here was way better".

Some people start off making games of course and that works for some, but I think for most, it's not the best way.

Maybe I am insane, but I prefer making business apps rather than games anyway. Plus if you are looking for a career, us application developers make more than game developers anyway =P

Thanks for the tip. I'm liking all the ideas other than games. I think I'm going to try that parsing an RSS feed somebody else suggested and also maybe something like what you're saying. I don't want to make a career out of it per say. What I'd like to do is make games and charge for them. But the making money isn't my main reason (though a good motivator). I would like to eventually make a living off of making programs and games but not in a business or corporate setting.

#33 Edited by glacialhelmnun (52 posts) -

Ignore the people who tell you not to start with C/C++ . I took this advice and regretted it. Learn it right from the start.

There are basically only two concepts you will ever make use of in practical programming (functional languages don't count): iteration and conditionals. It doesn't matter what language you use, the meat of any solution to any problem is going amount to checking conditions and doing things over and over.

The flexibility afforded by scripting/interpreted languages is just not worth it; for a good portion of common tasks they will be literally hundreds of times slower and they complicate debugging of runtime errors by an order of magnitude. I learned python and perl first and ran into bottlenecks almost immediately drawing a few dozen sprites, and developed some truly bad habits.

Too much emphasis is placed on learning advanced OO design patterns too early. Stick with simple structs for data encapsulation with getter-setter methods and avoid the trap of learning about templates/selective inheritance/v-tables/function objects/etc. before you need them (if ever). It's always better to build something ugly that works than something elegant that you can't debug. If you need something that's not in the STL, then make it as simple as possible and test it before letting everything hang on it.

DO use external libraries whenever possible. If you start by trying to write image/audio loading code yourself you will likely get frustrated and quit before getting anywhere.

SFML is an excellent tool to start with as it takes care of resource loading, has basically every base object/class you need to get a 2D game up and running, and provides a nice (the nicest imo) OpenGL rendering context and allows you to phase out built in functionality gradually if you decide to get into 3d programming. Most crucially, unlike most 'game-builder' type tools, you will be writing in C/C++ so everything you learn will be useful and (with modification) be usable later.

If you just want to have fun making simple projects that may be all you ever need.

Learning modern 3D programming is pretty tough to start. Performing tranformations and lighting using shaders is just not intuitive at all and you'll probably have to kind of fake it till' you make it. As far as I know there is no definitive book on the subject which manages to be example based and platform independent.

Here are two websites I have used a bunch:

This website provides an incremental path to understanding fully modern game programming using OpenGL, provided you are willing to learn some elementary linear algebra (which you'll have to do anyway). So does this one. The ideas can be applied to Direct3D also although I am a serious amateur when it comes to HLSL and DirectX.

General advice:

Never walk away from a program which doesn't compile. You will wind up with a mountain of sketches of programs you don't understand any more and will have a hard time moving forward.

Set very simple goals for yourself and set deadlines. My first project was a remake of Tennis which wound up taking more than a week, but I came up against some version of every common problem I have ever experienced and overcame/hacked my way through it. Maybe pick a simple game you enjoy and start with that?

#34 Posted by jgf (394 posts) -

After an introduction programming course at school I taught myself programming by making simple games. Now I'm teaching programming courses at a university and do some research in program analysis and compiler stuff. So I would say games are just fine to learn programming. At least when they are simple enough. Its more important that what you do keeps you interested and motivated then how good you can make a living out of it. At least when you just started to learn the basics. If you can program a game you can also program some business software. Essential is that you learn how to abstract and model your problem so that it can be written down in code. This though process is the same for every program. The rest is learning infrastructure and concrete syntax (which can still be quite a hassle).

So I would also agree to what was said before: Choose a simple task and try to solve it, but try to keep it fun, because you'll likely need the motivation.

If you've chosen your project start with a simple plan of how you want to approach it and report back. Start programming until you hit a bump. make an attempt to solve it and then ask for feedback. Both steps are important, figuring stuff out yourself and learning from feedback. One will not work without the other.

#35 Edited by Empirepaintball (1397 posts) -

Classes really help. Believe me, it took a few tries before I finally started enjoying it and before it actually clicked for me.

#37 Posted by TyCobb (1975 posts) -

@glacialhelmnun

"Ignore the people who tell you not to start with C/C++ . I took this advice and regretted it. Learn it right from the start."

To each his own. Some people start off better not learning low level languages.

"The flexibility afforded by scripting/interpreted languages is just not worth it; for a good portion of common tasks they will be literally hundreds of times slower and they complicate debugging of runtime errors by an order of magnitude."

It all depends on what you are building. There's nothing inherently wrong with interpreted languages. You sacrifice some speed for easier coding, memory management, and readability. Also, depending on the language/IDE, debugging is a lot easier. Not sure why you would think it complicates things.

Too much emphasis is placed on learning advanced OO design patterns too early.

That's the point of learning an OOP language. Sorry, but after the first simple game, it's time to dive into some OO.

"Stick with simple structs for data encapsulation with getter-setter methods and avoid the trap of learning about templates/selective inheritance/v-tables/function objects/etc. before you need them (if ever). It's always better to build something ugly that works than something elegant that you can't debug."

In C++, classes and structs are almost exactly the same. The only difference is members are public by default and classes are private by default.

Sorry, but templates are friggin awesome and everyone should learn about templates in C++ or generics if their language supports it. Fuck writing the same code over and over again. Inheritance/Derived classes are also your best friend. You can debug all that just fine. Also makes it easier since you have a single point of inspection rather than the same code copied all over the place. Visual Studio also has Conditional Breakpoints.

#38 Edited by tourgen (4542 posts) -

go look at other people's code. Examples or whatever you can get your hands on.

just start with C++. you know why. the people pimping Python, Lua, and Java know why. Just do it, start with C, C++.

but the most critical part is looking at other people's code that works and does something similar to what you would like to try and do. It's how painters, sketch artists, writers, and every other artist in the world learns their craft.

EDIT:

SDL

Codeblocks IDE with compiler

K&R book on C

codeblocks give you the IDE and compiler. read and work the examples in K&R. congrats now you're a programmer.

the rest is just learning libraries and APIs. SDL will kickstart your game interest - it has the specific things you need access to for games like high-speed timers, event driven core loop, and graphics primitives to play with.

go to the SDL web page and download some simple game examples from their listings ("games" on the left sidebar). go over the code. puzzle it out. re-create it on your own. congrats now you're a game coder. the rest is just learning OpenGL 4 and toolchain stuff.

#39 Posted by Confirm4Crit (143 posts) -

No one threw up 3Dbuzz.com and their large video collection. While a lot of it is behind a paywall, and you can find some/all of the stuff for free if you look and dig hard enough, most to all of the videos do have multiple people, with one person playing dumb, asking stupid questions, and then things are explained throughout because of that. You can get though a lot of the console based C# C++, and Unity stuff for FREE. :D

I just tried shelling out the clams and idk if it's worth it to go all the way, but defiantly check it out.

And if you wanna work on a project together, I'd be interested, sometimes it's good to have a buddy tag along with you and stuff. PM if you're interested.

#40 Posted by Salarn (469 posts) -

@tourgen said:

just start with C++. you know why. the people pimping Python, Lua, and Java know why. Just do it, start with C, C++.

The value of focusing hard on C/C++ is diminishing more and more as hardware is both improving in performance and diversifying in available platforms. Unless you need to code to the metal for some god awful reason like you want to be an engine or graphics programmer on an embedded system that performance critical, I'd say anyone who's more than ~5 years out from entering the professional arena is not going to be best served by learning C++ over other languages that trade speed for convenience.

Knowing a specific language is handy but it doesn't hold a candle to being able to properly break down tasks and understand logic that is shared in any programming language.

#41 Posted by Maginnovision (490 posts) -

My uncle bought me a C++ book when I was like 12, never had a problem though. I had made some games, graphical and text ones, in basic before that though. Messed with pascal in middle school too, since I hated homework my teachers let me make programs of various things that I had to turn in instead.

#42 Posted by Shadow (4988 posts) -

It's an entirely different way of thinking. What you need is an actual thing you want to make. I'm a goddamned guru at Objective-C, but that's only because I needed to learn it for iOS development. Without that outlet, I doubt I would have gotten very far at all.