How do I start to learn programming?

  • Thread starter GreatEscapist
  • Start date
  • Tags
    Programming
In summary, I think you should start with a basic computer programming book, like Kernighan and Ritchie, and then move on to more in-depth books as you get more comfortable with programming.
  • #36
I'm so sorry, but most of that went ooooooover my head. :frown:
But I think I picked up main points...things to look for when I'm learning the languages.
 
Technology news on Phys.org
  • #37
GreatEscapist said:
So how long did it take you people to learn C/C++/C#?
I already knew how to program in various languages. For me I just picked up what I needed to know over time as I wrote various programs in C. I've never used C++ for work, but have done some windows programming at home. One common practice for some programs is to use C++ for the user interface stuff, and use C for internal stuff.

Things to look for when I'm learning the languages.

For a student new to learning, I'm not sure what books or web sites to recommend. The main thing is a series of programs that you write as part of the learning experience, either adding onto something you're already learned, or branching off to a different aspect of programming. Maybe there's some online community college class you could take. Since you're goal is to learn how to program as opposed to wanting a tool to help you right away with something like a physics class, then C is a good enough place to start.

Regarding programming concepts in general, which I think was the point of some of the previous posts:

Modular programming - You separate the code for a relatively large project into a number of smaller functions (subroutines). This generally makes the code easier to follow, and makes it easeir for a team of programmers to work on a single project. Virtually everyone does this now, so it's not often mentioned.

Structured programming - whatever meaning it might have once had, it's mostly part of an ongoing debate, with experts disagreeing on the basics, like the usage of goto's. I wouldn't worry about it. As a game programmer, you'll be part of team and they'll have some type of coding standards already in place.

http://en.wikipedia.org/wiki/Structured_programming

Object oriented programming - data structures and/or methods are combined to create "objects". You could consider a mailing address to be an object, it contains a name, street address, city, state, zip, ... Methods could include how to read/write mailing address objects from/to a file, or how to display them on a screen.

http://en.wikipedia.org/wiki/Object-oriented_programming

Multi-threading. Since you want to be a gaming programmer, you'll have some involvment with multi-threading. With multi-threading you have separate programs that behave like or actually run on separate cpu's as part of a game, that include some form of communication with each other. For example one thread might be inputting a players controller inputs sending the inputs to another thread does the physics calculations, which then sends object position update information to a graphics thread which updates the image seen on the screen.

Parallel math. The cpu's in PC's and also the gpu's in video cards have the ability to do math on a list of numbers instead of just one number at a time. This can be used in a game's physics engine to speed up the calculations for object position updates. The cpu and gpu's makers supply libraries to simplify implementation.

Kajahtava said:
prime number generation examples
GreatEscapist said:
I'm so sorry, but most of that went over my head.
Most of the examples show how to create a list of prime numbers via an iterative process that tests one number at a time. Since the letter "l" looks like the number "1", it's a bit more difficult to follow. The "declaritive" example uses a language type that you're unlikely to encounter in a game programming environment.
 
Last edited:
  • #38
Moderator input:

Please keep this discussion on track. Also, please remember that this is a 15 or 16 year old we are trying to help, not someone pursuing a PhD in computer science.
 

Similar threads

Back
Top