PDA

View Full Version : Learning programming - advice and resources?



hexagonalbolts
12-10-2012, 10:04 AM
There's another programming thread at the moment but this topic is something I have been wondering about for quite some time and I think it deserves a thread to itself. Googling around 'learning programming' can bring up a whole lot of outdated rubbish. So can anyone suggest any great resources, websites, forums or books for learning programming?

For me in particular, I'd like to learn some very basic C++. I worked through some of http://inventwithpython.com/ and then decided to buy 'beginning C++ game programming' by Michael Dawson. However the vast majority of the programs in the book aren't game-like at all, they're mostly just a page of words that are in the context of gaming, there is no interaction from the user or anything that could ever be different. I feel like it would be much easier to progress if I could get some extremely crude game or model up and running that I could mess around with, change the values and chop new bits in and out.

OrangyTang
12-10-2012, 10:53 AM
For me in particular, I'd like to learn some very basic C++.
At the risk of starting a holy war: don't start with C or C++. As a (bad) analogy, it's like saying "I would like to learn how to fly, so I'm going to get in a concorde and try". You don't, you find yourself a nice little two seater plane that's just got a stick, a rudder and a throttle and go from there. Sure, you can learn in the concorde, but you won't have any fun.

The dirty little secret that you don't know as a newbie is that the fundamentals of programming are the same pretty much anywhere. Flow control, data structures, etc. is stuff you can learn in any language just how you should be learning in a two seater. Because you aren't going to find a simple c++ game that you can tinker with that makes *any* sense to you right now, and you're not going to learn anything from it.

I'd suggest finishing the python book (which means doing the exercises just reading it means you won't really absorb it). Then either experimenting with pygame on your own or trying something else. You could try XNA, as that's C# and so it a bit nearer C++ than python, and there's lots of good learning books for XNA. Or you can try Unity which has some really good documentation for beginners and lets you get doing visual stuff very quickly and lets you write in C# or javascript.

Mantracker
12-10-2012, 10:57 AM
I suggest MIT's opencourseware (free recordings of lectures, syllabus etc.)

Here's their introductory course to computer programming:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/

aoanla
12-10-2012, 11:00 AM
I second Unity and python. There's some good resources for both of them, and you can very quickly get something game-ish going in Unity that you can play with (while python's interpreter lets to play interactively with the language without going through compile-cycles, which I think helps you to explore what a particular function does in a more natural way).

Stevo
12-10-2012, 11:21 AM
Start with something more user friendly like Java or C# and then move your way up. Frankly if I could go the rest of my career without programming in C++ id be a happy man.

victory
12-10-2012, 12:19 PM
What the guys above said is correct. The point of using C++ is high performance. It is just about the worst language you could pick for starting programming.

If you want to get into something that "works" right away, you need not just a language, but a powerful toolkit or environment suitable for making games and game-like software with graphics and UI.

I'd generally recommend going with Python. It has many game toolkits; the best known (therefore most tutorials, etc.) is Pygame.

OrangyTang
12-10-2012, 12:27 PM
Oh, just to give you a few more options, there's also Pyglet, which is a more recent alternative to pygame. It's got quite a decent starter guide: http://www.pyglet.org/doc/programming_guide/index.html

hexagonalbolts
12-10-2012, 12:34 PM
Ok this is all great stuff, thanks! I had presumed unity would be a bit advanced for someone with zero knowledge of coding - can anyone recommend any tutorials for that in particular?

Kaira-
12-10-2012, 12:35 PM
Eh, I'm not so sure about if C/C++ is actually all that bad. I mean, it means you don't have the benefit of large standard libraries of C#/Java, but it'll give you a lot of insight what happens deeper down in the programming language. That being said, they are also a big pain in the ass in the beginning and if you aren't really motivated, they can kill your motivation. Java is what I began programming with, and moved to C(++) from there.

All in all: pick a language (probably not a functional programming language like Haskell), and stick with it. Programming isn't about language - it's about a mindset and understanding how the system flows.

gundato
12-10-2012, 01:40 PM
If you want to learn to be a good coder: C or C++, depending on what field you intend to work in (C++ if you want gaming). There are better languages out there, and there are more powerful languages. Those both provide a good "bare bones" that will generally not have you develop too many bad habits (I learned on Java, and I always have to keep a sticky note handy to remind me to free what i malloc :p). But those are "real" languages, so they'll be taught in the context of programming, not game making (even an OpenGL or DirectX tute will be more about how to render a scene, not how to make it interactive).


If your problem is that you want to feel like you are working toward a game: Go with Unity, as suggested. I think it supports a few different languages these days, pick whichever one has the best tutorial. You'll pick up some (or a lot of) bad habits, but you'll actually learn. Because you can see the impact of everything you do in the context of a game.

riadsala
12-10-2012, 01:44 PM
Probably too late for this year, but Coursera.org have some introductory classes in python. An excellent resource.

Revisor
12-10-2012, 01:49 PM
If you are an absolute beginner, try www.codecademy.com for the explanation of the thinking and basic stuff
To anyone choosing their first language I recommend either Python or Javascript.
Codecademy is for JS
http://learnpythonthehardway.org/ is for Python

For everyone who hasn't read it yet, beginner or expert, read Code Complete. It's the most versatile and useful book about practical programming (not about a specific language) I have read.
http://www.bookdepository.co.uk/Code-Complete-Steven-McConnell/9780735619678

Also have a look here for more reading inspiration
http://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read?answertab=votes#tab-top
(Code Complete is the top voted book there)

pakoito
12-10-2012, 01:50 PM
Learnpyrhonthehardway is probably one of the best books/online tuts out there.

b0rsuk
12-10-2012, 01:51 PM
I like MIT OpenCourseware, too. Their introduction to Computer Science uses Python, which is a plus for me. They make non-trivial topics sound easy. The course is about learning to think like a computer scientist.

Skull
12-10-2012, 01:51 PM
On a slightly unrelated note, if anyone living around the Cambridge area with good C++ and MySQL knowledge is looking for a job as a software engineer, please send me a pm and I can give more details. Salary would be 35k, a pension scheme and share options within the firm.

Sorry if I'm not allowed to advertise job roles in the forum, please remove this post if it violates any rules.

Berzee
12-10-2012, 02:25 PM
I will just say -- I don't recommend the following if you are trying to learn "proper programming" to do it for the rest of your life.

But for those who feel that programming a game is the only way they'll ever learn to program, and want something fairly fast and flexible, you could do worse than looking for a Flixel tutorial here: http://forums.flixel.org/index.php

The best thing about Flixel is that you can super-easily put a man on the screen and have him run around without flickering. Once you've gotten that far, the rest is just tweaking. :)

Of course I found Flixel after programming with REAL LANGUAGES for years, so I may not be the best judge of its intuitiveness for beginners.

Sparkasaurusmex
12-10-2012, 02:35 PM
C#
How do you pronounce this? Because I keep thinking "C Sharp"

Berzee
12-10-2012, 02:41 PM
How do you pronounce this? Because I keep thinking "C Sharp"

Correct you are!

Sparkasaurusmex
12-10-2012, 02:49 PM
My first programming language was music notation (and my last) :P

Unaco
12-10-2012, 03:01 PM
I happen to teach University Undergraduate (and Masters) Introduction to programming courses, among other things. Our University, after having tried a couple different approaches, uses Java. I will elaborate a little, later... but just now I'm away to teach some Undergrads...

hexagonalbolts
12-10-2012, 04:33 PM
I happen to teach University Undergraduate (and Masters) Introduction to programming courses, among other things. Our University, after having tried a couple different approaches, uses Java. I will elaborate a little, later... but just now I'm away to teach some Undergrads...

Ah, a true sensei! It'd great to hear more on this Unaco

aoanla
12-10-2012, 04:52 PM
I happen to teach University Undergraduate (and Masters) Introduction to programming courses, among other things. Our University, after having tried a couple different approaches, uses Java. I will elaborate a little, later... but just now I'm away to teach some Undergrads...

Oh, I'm demonstrating our department's Introduction to Programming course - we teach C, although I'm really not sure it's the best language to teach in Sciences. (I'd have probably taught Fortran if I had free reign to design the course myself...)

Bremze
12-10-2012, 05:46 PM
Do you want to learn programming so you can make games or is learning programming itself the goal?

If it's the former, just jump into Game Maker, Construct and ( another similar tool with a visual programming interface, the name escapes me though ). No point in making engines when the game design and creation is what interests you, you'll be able to pick up some programming as you go.

If it's the later, you can stay with C++ and SDL or learn Python and Pygame or C# and Unity. C++ isn't the horrible beast it's made out to be, but do try out the alternatives and stick to what you like.

pakoito
12-10-2012, 06:50 PM
I happen to teach University Undergraduate (and Masters) Introduction to programming courses, among other things. Our University, after having tried a couple different approaches, uses Java. I will elaborate a little, later... but just now I'm away to teach some Undergrads...

I started with Pascal, then C, then a whole fan of languages: C++/Java/C#/Assemobly and all the tangential ones like SQL, R, Matlab and stuff.

Ritashi
12-10-2012, 10:16 PM
I started with C++, because in the sixth grade that's what the internet told me games were coded in. Of course, going through school means I haven't touched it in years, since everyone teaches Java at first, and for game creation I've been using XNA (C#) and Unity (Also C#, though it's just a syntactical overlay on whatever their underlying scripting language is). I will say, though, that every important concept you will ever learn in coding goes across all languages (object-oriented vs functional aside, I suppose). The important stuff is all in the logic. Honestly, I'd say pick up Game Maker or RPG Maker (both have good free versions; RPG maker is great for top-down stuff, a la JRPGs, and Game Maker is more malleable to be whatever you want). Both are 2d, both are very simple. Don't even worry too much about learning the actual scripting language; just focus on the logic of the game. Once you understand basic logic, you can honestly go anywhere. I would not recommend trying anything 3d unless you have a strong understanding of Linear Algebra (look it up if you haven't heard of it, it's not what you learned in grade school). 3d orientations are complex to model, and you'll wind up struggling with the math as much as with the code if you aren't already familiar with it. After fooling around in those for a bit, pick up an introductory programming textbook (there may be good free resources I'm not aware of) and work on picking up a real language. Java is likely to have the best tutorials out there (and the online API is excellent), but it's not necessarily a language you're ever going to want to really use. C++ is a bit complex to learn all at once, but it's honestly not that bad to learn, and it's a great language. C# is basically MS making their own version of Java, but it is pretty good and you can grab the XNA framework to help you make games much easier. I do not recommend Javascript simply because it teaches some very poor habits. I recommend learning a "real" language before spending too much time on any scripting language, just to be sure you don't fall into any bad habits.

hexagonalbolts
12-10-2012, 10:53 PM
Do you want to learn programming so you can make games or is learning programming itself the goal?

If it's the former, just jump into Game Maker, Construct and ( another similar tool with a visual programming interface, the name escapes me though ). No point in making engines when the game design and creation is what interests you, you'll be able to pick up some programming as you go.

If it's the later, you can stay with C++ and SDL or learn Python and Pygame or C# and Unity. C++ isn't the horrible beast it's made out to be, but do try out the alternatives and stick to what you like.

It's a bit obscure, particular and long term but what really fascinates me with games is procedural generation, ultimately I want to fiddle with lots of procedural generation and randomisation, even if it's just on a extremely basic level at first (or at all). Would something like Game Maker be flexible enough to accommodate this?

Walrus
12-10-2012, 11:30 PM
It's a bit obscure, particular and long term but what really fascinates me with games is procedural generation, ultimately I want to fiddle with lots of procedural generation and randomisation, even if it's just on a extremely basic level at first (or at all). Would something like Game Maker be flexible enough to accommodate this?

Absolutely. Spelunky for example was made in Game Maker. Though later on you might find the program a bit lacking if you want get in to more advanced stuff.

victory
12-10-2012, 11:30 PM
It's a bit obscure, particular and long term but what really fascinates me with games is procedural generation, ultimately I want to fiddle with lots of procedural generation and randomisation, even if it's just on a extremely basic level at first (or at all). Would something like Game Maker be flexible enough to accommodate this?
If procedural generation and randomization are your interests, then Processing (http://processing.org) might be of interest to you. Download and install the environment, open one of the included tutorials and start tweaking. You can literally have stuff up on the screen within a minute of launching it. It lets you to output graphics easily, and that's important for getting a good sense of what you are generating at a given moment.

trjp
13-10-2012, 02:32 AM
To emphasise what other people have at least hinted at, I think it's important you have goal/project in-mind when you start-out, because just "learning programming" is a daunting task (I've been doing it for 32 years and I'm not there yet).

As Victory says, if procedural generation/graphics and stuff like that are your interest, Processing is much worth a look - if you have other interests, there are other tools equally suited to other things.

If you want to make games, for example, a dedicated games creator will take you through that too (The GameMaker package new to Steam is probably the ideal starting point).

I'd say you have to want more than just 'learn programming' tho - because that's a bit like saying "learn foreign languages", there's a lot of them, they're very different, there are many different levels of knowledge (casual conversation, reading, writing, giving a lecture, writing a book on their Irregular Verbs(*) and so on).

(*) this could even result in you becoming the President of a South American country - but we're WAY off-topic now... ;)

trjp
13-10-2012, 02:34 AM
p.s. if someone wants to learn just one set of tools which can do 'almost anything' I'd suggest they learn Javascript - because if you add HTML and CSS to that, you can build websites, games, apps - almost anything expect platform-specific low-level stuff like disk analysers, in-fact...

mashakos
13-10-2012, 04:53 AM
As others have mentioned, starting out with C++ is a bad idea. C++ is like industrial machinery, it's huge and chock full of moving parts required to do the simplest thing, yet these moving parts will only make sense if you've worked a few years in the industry. To put it another way, don't be surprised if you have to write 60 lines of code to get a "Hello World" app in directx.
Javascript is the best bet as it has the least overhead to get to actual code and does not require compiling.
Actionscript is also a great starting point - you have more freedom than Javascript (you can do a lot more binary data manipulation in AS3 than in javascript), and incorporating 2d animated assets is way easier than JS. Another good reason for going with AS3 is portability. Javascript is nice in that you can literally open up notepad, save an html file and have an "app" up and running, but then that html file will behave differently on each browser due to cross-browser compatibility issues. Javascript is easy to start with but hard to maintain, so if you want to start on an actual game project with your new skills Flash is a safer bet.


Regarding tutorials, with the vast array of blogs dealing with actionscript and flex development, googling will do just fine.
FlashDevelop is an open source IDE (dev tool) which can get you up and running relatively quickly:
http://www.flashdevelop.org/

For inspiration:
http://wonderfl.net/c/imOx
http://wonderfl.net/c/kvkU
http://wonderfl.net/c/h9dR
http://wonderfl.net/c/juFu
http://wonderfl.net/c/nmsw
http://wonderfl.net/c/2F0r
http://wonderfl.net/c/2HBv
http://wonderfl.net/c/59Oz
http://wonderfl.net/c/t5IZ