How do I start to learn programming?

  • Thread starter Thread starter GreatEscapist
  • Start date Start date
  • Tags Tags
    Programming
Click For Summary
To start learning programming, it's recommended to choose a language like C, C++, or Python, depending on your interests and goals. C and C++ provide a deeper understanding of how computers work, which can enhance programming skills, especially for game design. Online tutorials and introductory books are valuable resources for beginners, alongside community college courses for structured learning. While C may have a steeper learning curve, it can lead to better programming practices if you're willing to invest effort. Ultimately, the choice of language should align with your specific programming aspirations, such as game development or algorithm design.
GreatEscapist
Messages
178
Reaction score
0
My high school does not offer computer programming, because we are a, ah, *small* high school.
But I want to learn how to do it. I really want to go into programming, or CE.
I read bits and pieces, learn a bit here and there, but I really want to actually learn how. So, where do I actually start? Where's a good place to start? I don't know if I would know it already or not, but can you give me some ideas?
 
Technology news on Phys.org
You could pick up an introductory book on Java, C, C++, Python or whatever other language you prefer (I recommend C++, but I'm biased because that's what I use for most of my research). I'm sure someone here can recommend you some good books.

I learned most of my programming skills through trial and error, and through online tutorials. For C++, you could try http://www.cplusplus.com/doc/tutorial/", or just google "<language> tutorial", and you should find a few results.

Whatever approach you follow, if you have any questions, you can always come back here and someone will be glad to help you.
 
Last edited by a moderator:
if you want to learn C then i recommend "kernighan and ritchie" a fantastic book. C is used mainly by the "sciences" it is excellent for calculations ( root finding of functions, matrices, you name it), so it depends what you are looking to do with programming
 
Awesome. Thanks. :)
 
Take a summer course (or two) at a local Community College.
 
K&R is more of a C language definition book than a learn how to program book. What you'd proably want instead is a "primer" for C. Better still would be a training book that starts off a minimalist C program, then goes through a series of programs, each one a bit more advanced and teaching one new aspect of programming at a time. You might consider an assembly primer as well.
 
Well that didn't make a whole lot of sense.
But I do think that starting with the how/why programming works with computers is a better way to go.
But after that, I shouldn't learn C first? I always thought that's where everyone started. (Minus HTML and java. Everyone knows that.)
 
I would recommend C or C++ for the exact reasons that Kajahtava is campaigning against them: In order to program well, you have to learn about how the computer works. Ask lots of questions on the forum here: if you see a couple of ways of doing something, try to find out which is better for your particular problem and why.

If you're making a conscious effort to learn, as opposed to simply "getting the job done", you'll come out of learning C or C++ as a better programmer, with a better understanding of computers.

In a lot of other languages you can learn to program "well" without ever learning anything about how the computer works or why you should do things a certain way. Your programs will be slower too. For research applications it's important that my code be as fast as possible. While you're writing simple programs, a factor of 2 in performance is nothing. You'll never care if you computer takes 5 milliseconds to run instead of 10 milliseconds. But if you're ever doing complex numerical calculations (I had some programs running for weeks on a super-computer last year to calculate some results) then even a small fractional improvement in performance can be significant, meaning you take 1 week, instead of 2 to get results.
 
Kajahtava said:
Also, FORTRAN is also a candidate here.

I would have recommended it if it weren't obsolete and hardly ever used anymore, except for a few aging academics.

I had to learn some FORTRAN to make some of my advisor's old code work with my C++.
 
  • #10
:frown:
Now I'm just friggin confused. But it was my fault for not being specific in my OP.
Okay. Well, I have somewhat of a grasp on Java, and I can do DOS. (Hey...I have a real old computer. :wink:)
I eventually want to end up in game design (God, don't tell my mom I want to work on video games...) but I know that I would have to do regular programming first. So, what's good for ending up in games?
And I do want to know how everything works. I'm one of those annoying kids that high school teachers hate because i want to know exactly HOW stuff works. Not why. (That's why I love physics.) So I'm definitely going to pick up a few books on computers anyway. I know ideas of how stuff works, but not a great one.
And hey, now, I'm a pretty damn smart high school kid. :P
 
Last edited:
  • #11
Maybe I can make a suggestion that we can all agree on?

NOT Visual Basic!
 
  • #12
Sounds like I'm going to make a trip to Barnes and Noble today...
 
  • #13
Kajahtava said:
C# is completely useless outside the Common Langauge Infrastructure.

It's essentially a version of Java that is catered towards the CLI and made very type safe. No one designs games on C# and both BSD and the FSF take an active stance against using C# as they fear it's a ploy from Microsoft to make people dependent on a lighter version of Java they have some control over, though it's an ECMA standard.

I'm going to stress it again and again, it depends on what you want to do, different aspects of a game are written with different languages. I've explained the pros and cons of various languages and said why.

Whether you want to listen to the guy who in his first post already said 'depends on what you want to do' and explained the difference between different languages, or to the horde that said 'C!' before they even knew what you wanted to do and to this point keep defending that C is supposedly the best for about every-thing. (And name C# and C in one sentence while the languages are nothing alike except for syntax), that's your own choice.
Sorry, but C# makes me think of music. :D

But on a serious note, what type of game aspects is it used in? Obviously it WOULD be useful/not in different aspects, so elaborate please.
shoehorn said:
Your contribution to this thread amounts to nothing other than helping to confuse the OP...
*promptly screams in confusion* This is true- I am confused.. I don't want to have to un-learn stuff that I might learn wrong, so Kajahtava's comments show the cons. That's awesome. But how much weight do they hold? (In a non-rude way) Here's the thing- I want to become a very good programmer. Extremely good. Epicly good...so, where do i start to become a very good game designer?
And, *screams* I feel very lost. I don't this sh** you guys talk about. Or your codes.
Kajahtava said:
They aren't advanced, they're just concepts that C lacks, if you start in a different language, you'll be experienced in closures in two days and scratch your head around pointer arithmetic.

Also, advanced concepts? I'm saying he shouldn't start with C because it's just too difficult to understand it at first.

I took a dig at no one, I responded to every single point people direct at me, that's a different thing. I have quoted every paragraph that was directed at me and responded to each and every individual point instead of just cherry-picking them.
Let's just assume for sake of argument that this is true. Do you think that this makes these people impartial on to recommend a first language?

To be honest, better leave the OP confused about what to do, do his own research and pick the language that suits his or her own needs than to just follow the advise of the first couple of people here that said 'pick this language' and never gave a single argument why that language would be suitable or not.

And he got a reasonable answer, I gave two paragraphs at firs, no more no less about why I thought that C was not a good place to start, and I still have not recommended any language to start, I've explained the strength and weaknesses of various paradigms of programming and told him to make up his own mind after that.

Psychoanalysisforums.com?

Please, keep your ad hominems out of this thread, maybe that's true, maybe it isn't, but there is no way you can know this.
First:
It is advanced. TO ME. I'M STUPID. PRETEND LIKE YOU'RE TALKING TO A 16 YEAR OLD WHO ONLY KNOWS HTML, DOS, AND SOME APPLESCRIPT. OH WAIT. I AM.

Second:
No offense, but this is my research. I looked on the internet, got lost, and confused, so I decided to ask here. Isn't that what this site is FOR? I'm very sorry that I'm annoying you guys, but I really want to know how to do this, and I don't want to have to learn a bunch of stuff (Study the languages completely) just to learn that I shouldn't have learned that.

Is that bad? :frown:

And third:
I'm sorry that you gave a "reasonable explanation". I guess I'm dumb. Cause it didn't much help. It made me realize that this is no better than looking forever on google, where I get the same "C SUCKS DON'T USE IT" vs "C IS AMAZING DON'T EVER DO ANYTHING THAN THAT." Not that you all are saying that. But yeah.
 
  • #14
GreatEscapist,
C/C++ will have a steeper learning curve than the rest of the languages suggested here, but as long as you put in the effort to actually learn what the code/machine is doing, you will come out of learning it a better programmer than if you learn most any other language. If you don't mind putting in the effort, and making the conscious choice to keep figuring out what is going on "under the hood", as opposed to simply trusting the computer to do what's best, then I would strongly recommend starting with one of them.

If you're not too concerned about what the computer is doing, and want to write programs that "just work", and you have a particular subsection of game programming you're interested in, then read through Kajahtava's post, and pick the language most relevant to what you have in mind. If you want to learn more about algorithm structure, and less about the computer architecture, then go with python or perl.

Since you say you want to become a very good programmer, then I stand by my recommendation of C or C++ combined with lots of effort on your part.
 
  • #15
GreatEscapist said:
Sorry, but C# makes me think of music. :D

But on a serious note, what type of game aspects is it used in? Obviously it WOULD be useful/not in different aspects, so elaborate please.
XBox 360, for one. Microsoft is pushing the C#/.net stuff very hard when it comes to XBox 360.

*promptly screams in confusion* This is true- I am confused.. I don't want to have to un-learn stuff that I might learn wrong, so Kajahtava's comments show the cons.
If you learn to program on your own, you are almost certainly going to "do it wrong" -- no matter what language you use.

I am not, repeat am not, trying to dissuade you from learning to program on your own. I learned to program on my own in high school 35 years ago. Learning from your mistakes is a powerful way to learn. One problem with learning on your own is that you don't know you are making mistakes. That's okay, though. You will still be ahead of those of your classmates in college who have never taken a computer programming class in high school and have never bothered to learn how to do it on their own.

It made me realize that this is no better than looking forever on google, where I get the same "C SUCKS DON'T USE IT" vs "C IS AMAZING DON'T EVER DO ANYTHING THAN THAT." Not that you all are saying that. But yeah.
Yes, some of us are saying that. Every language has its pluses (and this includes Visual Basic) and minuses (and this definitely includes Visual Basic). If you want to be a computer game programmer, C/C++ and its kin are where almost everything is at these days.

If you want to be a good programmer you will learn a lot of different languages, and not just another variant of C/C++/C#/Objective-C/Java. You should learn some completely different paradigms. Eventually you should learn Lisp/Scheme to get a flavor for a rather different way of programming. Eventually you should learn assembler because that is as close as you are going to get to the computer (machine language is even closer, but nobody does that, not for a long, long time).
 
  • #16
GreatEscapist said:
I don't want to have to un-learn stuff that I might learn wrong.
You don't have to "un-learn" anything. You may end up changing your coding style or using a different algorithm to solve a problem. For example, there are various algorithms to sort data, with the two "best" being quicksort and (bottom up) mergesort. Merge sort takes double the memory space (at least for the pointers), but can be faster. As mentioned above, each job will usually have some type of coding standards, and these vary from job to job. Some jobs will be better than others.

I want to become a very good programmer. Extremely good. Epicly good...so, where do i start to become a very good game designer?
You need to learn the basics of programming first. For game programming, it depends on the game. Common things would be how to render a dynamic view of a 3d landscape filled with 3d objects, some (or all) of which may be moving. You'll also need some means to apply some set of physics rules on how those objects move around and how to deal with collisions. Other forms of interaction may also be involved. The most likely scenario is you'll be part of a team, and you'll be specializing in some aspect of game development. Some game designers are more artists than programmers, and all they do is implement the 3d objects used in a game.

I don't want to have to learn a bunch of stuff (Study the languages completely) just to learn that I shouldn't have learned that.
For most games, you'll be using a sub-set of C, and using libraries developed at the workplace to deal with the game components. You will not need to learn every function or template in standard C or C++ libraries. Unless the game is dialog based, you won't be doing much work with strings.

As far as game designing goes, I wouldn't know. There doesn't seem to be a lot of innovation in games anymore, it's mostly enhancements of previous games with similar gameplay. Racing games, first person shooters, strategy games, adventure / puzzle games, character leveling up multiplayer games.
 
  • #17
Last edited by a moderator:
  • #18
Integral said:
I have brutally chopped out a off topic digression if you wish to continue the discussion go here.

Lets see if we can keep this thread on topic.

Integral
Thanks. I'm not sure how I got an argument going...

Is Python hard to learn? I know some aren't (like Perl)
 
  • #19
Python is made to be simple to learn.

Python, together with Ruby and Smalltalk follow the so called 'principle of least surprise', the languages are designed in such a way as most human users expect things will happen.

Python is quite versatile, (as is Ruby), it are languages that are both suited for beginners as well as allowing a properly structured coding style to some degree.
 
  • #20
Python is a fairly easy language to learn. There are a couple of things I don't like about Python that have a bit of a hard time seeing past. Sometimes those http://pragmatic.nationalinterest.in/2008/09/05/gok-4-coffee-stains-tea-cups/" can be a bit hard to overlook, particularly for an old fart like me. That said, Python is a powerful yet easy to learn language.

You mentioned earlier that you are interested in computer games. At least for now, that means either C++ or C#. The Sony game console graphics interfaces are in C++ while XBox 360 is C#. Computer games without graphics are sooo 1980s. One can only go so far with "you are in a maze of twisty little passages, all alike."

You mentioned that you already know Java to some extent. I would suggest you stick to that for the time being. The path from Java to either C++ or C# is not all that hard to traverse. They all descend from C, after all. To do Python well you will learn some tricks and techniques that are quite specific to that language. Learning those is a bit of a waste if your goal is computer game development.

If your goal is to be a good (topnotch) programmer it is a good idea to learn many, many different languages over your career. I have lost count of how many languages I have learned over my career. Many (most?) do not even exist anymore. That, BTW, is one reason to learn how to quickly learn to use a new programming language. Becoming an expert in one, but only one, language is, well, stupid. Languages come and go. I doubt computer games of the 2030s will be written in C++ or C# -- or in Python.
 
Last edited by a moderator:
  • #21
Okay.
I still want to learn C++ first, just for the halibut, and since I'll definitely be using it later. And because C books seem to be hard to find where I live.
 
  • #22
I also think that your perception of game development might be different from what you think it will be in the end. Let's say you score a job working on the Havok engine, a job you might get will then be. 'Hey, can you write a function that returns the centre of gravity of a collection of objects if given a certain description of it.'

This all has very little to do with games, and because literally thousands of people in the end have contributed code to the final game and the other 999 people shouldn't be too concerned with how it works. Work is subdivided into such tasks 'a function should do one thing, and do it well', it's your job to make that function, to make sure it works as fast as possible, and to make sure it does not contain any bugs, so that others can just assume that function and use it, without being too concerned with how it works on the inside.

Programming computer games in the end has as little to do with games as programming a sound mixing environment for most developers on the team, they have a well-defined task of what they're supposed to do, and they've just to make sure that this meets the ends.
 
  • #23
D H said:
You mentioned earlier that you are interested in computer games. At least for now, that means either C++ or C#. The Sony game console graphics interfaces are in C++ while XBox 360 is C#. Computer games without graphics are sooo 1980s. One can only go so far with "you are in a maze of twisty little passages, all alike."
What the crap do the actual "game" game companies use then? Like Nintendo and SEGA?

And C++, after looking at a bit more, seems like an interesting language. I'm going to focus on that until I get it down.
 
  • #24
Kajahtava said:
I also think that your perception of game development might be different from what you think it will be in the end. Let's say you score a job working on the Havok engine, a job you might get will then be. 'Hey, can you write a function that returns the centre of gravity of a collection of objects if given a certain description of it.'

This all has very little to do with games, and because literally thousands of people in the end have contributed code to the final game and the other 999 people shouldn't be too concerned with how it works. Work is subdivided into such tasks 'a function should do one thing, and do it well', it's your job to make that function, to make sure it works as fast as possible, and to make sure it does not contain any bugs, so that others can just assume that function and use it, without being too concerned with how it works on the inside.

Programming computer games in the end has as little to do with games as programming a sound mixing environment for most developers on the team, they have a well-defined task of what they're supposed to do, and they've just to make sure that this meets the ends.
I actually do know that. That's where I want to end up. :P
 
  • #25
You won't end up there immediately, GreatEscapist. As Kajahtava mentioned, computer game development is now a big production effort. The days of a couple of guys hacking together a game in their garage are long gone. If you do get a job with a computer gaming company your first job will be to develop some tiny, tiny part of a game. It might have nothing to do with graphics. Your little part might not even look like part of a game. Focusing on the graphics, and the graphics only, is a good way to guarantee that you will not get in the gaming industry. You won't be versatile enough and you won't understand how those graphics work. You would better serve yourself to learn about programming in general with some (but not complete) attention paid to computer graphics.
 
  • #26
D H said:
You won't end up there immediately, GreatEscapist. As Kajahtava mentioned, computer game development is now a big production effort. The days of a couple of guys hacking together a game in their garage are long gone. If you do get a job with a computer gaming company your first job will be to develop some tiny, tiny part of a game. It might have nothing to do with graphics. Your little part might not even look like part of a game. Focusing on the graphics, and the graphics only, is a good way to guarantee that you will not get in the gaming industry. You won't be versatile enough and you won't understand how those graphics work. You would better serve yourself to learn about programming in general with some (but not complete) attention paid to computer graphics.

I seriously know that. I know I won't be much at first, and I'm not all about graphics.
I really am just trying to learn lots of programming stuff, and then if i can, go into game design.

So, does this sound good? I'm going to work on C++ for now, then move on to C#, and Python, and Perl if I have time before college.
 
  • #27
Whoa! One step at a time! You appear to be biting off more than you can chew, particularly as a first-time programmer.
 
  • #28
Perl is next to useless in games, Python also for a great degree. Perl and Python are mostly 'scripting languages' as in, languages fed into other things to automate some tasks, like generating a dynamic web page or organising the files on your computer.

Also, C# is easier than C++ I reckon. C++ is except for some minor details a superset of C. (Though C99 added some things that C++ lacks but the next version of C++ will probably take those with it.), Java is a significant workaround to C++ and removes some things and adds some things, from that came C# which is in fact a lot closer to Java than to C and except for the syntax really bares little resemblance to C any more. C and C++ are fairly low level (that does not mean easier or more proper), C# is a high level language.

It may also be important to look at the design goals of languages

http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Design_goals
http://en.wikipedia.org/wiki/Java_(programming_language)#Principles
http://en.wikipedia.org/wiki/C_programming_language#Characteristics
D H said:
Whoa! One step at a time! You appear to be biting off more than you can chew, particularly as a first-time programmer.
Maybe I'm just feeding him or her too much, I've been told often enough that I do that.
 
  • #29
D H said:
Whoa! One step at a time! You appear to be biting off more than you can chew, particularly as a first-time programmer.

I don't mean all at once. =P I mean over the next two years. But I real stuff really fast. *shrugs* But I want to do it well, so I'll take time on it.

Kajahtava said:
Perl is next to useless in games, Python also for a great degree. Perl and Python are mostly 'scripting languages' as in, languages fed into other things to automate some tasks, like generating a dynamic web page or organising the files on your computer.

Also, C# is easier than C++ I reckon. C++ is except for some minor details a superset of C. (Though C99 added some things that C++ lacks but the next version of C++ will probably take those with it.), Java is a significant workaround to C++ and removes some things and adds some things, from that came C# which is in fact a lot closer to Java than to C and except for the syntax really bares little resemblance to C any more. C and C++ are fairly low level (that does not mean easier or more proper), C# is a high level language.

It may also be important to look at the design goals of languages

http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Design_goals
http://en.wikipedia.org/wiki/Java_(programming_language)#Principles
http://en.wikipedia.org/wiki/C_programming_language#CharacteristicsMaybe I'm just feeding him or her too much, I've been told often enough that I do that.

Well, I'm learning Perl and Python more just to learn it and have it than to like, use it a lot. And it will be a awhile before I can good into the game world.

Thanks for the links. Wikipedia's got it all.

I'm a "her". And no, you're not *feeding* me. :P
 
  • #30
GreatEscapist said:
Well, I'm learning Perl and Python more just to learn it and have it than to like, use it a lot. And it will be a awhile before I can good into the game world.
Well, there are two stories to this, learning 'how to use a language' and 'learning to program', as in, learning the strategies, the structures and all behind it.

I'd still recommend you read http://mitpress.mit.edu/sicp/full-text/book/book.html or books based on it like 'How to Design Programs' to learn the structure behind computer programs, what a program is, how to approach a problem et cetera. I'd still not think that *a certain language* is the best language to learn well-structured programming in because it consciously removed a lot of features that enable well-structured programming for performance sake.

Thanks for the links. Wikipedia's got it all.
I'm surprised that wikipedia turned out to work that well, it's easily one of the most reliable sources on the web, at first I wouldn't believe it that any good could be on an place where all people can just edit it and it displays instantly, but the amount of good-willed users who check their sources so much outweighs the vandals that it works. All people can vandalise yap, but all people can also instantly correct a subtle error. (and vandalism)

I'm a "her".
You know that about every-one here assumed the other gender?

And no, you're not *feeding* me. :P
Good, social roles dictate girls can't be fat you know, but then again, we all know said roles dictate that girls can't possibly program either.
 

Similar threads

  • · Replies 43 ·
2
Replies
43
Views
6K
  • · Replies 102 ·
4
Replies
102
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
33
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 25 ·
Replies
25
Views
715
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
16
Views
3K