
-----------------------------------
Roman
Sat Aug 09, 2008 11:20 pm

Learning to Program
-----------------------------------
I recently read the "going into the comp. sci. field with no programming background" blog, and was compelled to relate to my own situation.

I haven't taken any computer science classes in high school despite the fact that they were available. I never had much of an interest - I thought programming was "cool" but the couple of times that I tried to start it kinda died out. I'm not going into comp sci as a major, but I'm going into Applied Math and my career goal is in Game Programming. This summer I picked up Python, joined CompSci, and, with help, wrote a Tic-Tac-Toe game that actually works hehe. However, I'm kind of stuck.

I have very limited knowledge of the language, and of programming in general, so it's hard for me to come up with projects that will be challenging because after a certain level I don't know how to go about the program, and below that level it's not much of a challenge. Should I read up on things like tutorials? I borrowed the Core Python Programming book, and it has practice exercises after every chapter. Should I go through that?

My goal is simply to expand my knowledge of Python and programming so I can join some sort of open-source project during the school year. I guess my question is should I learn theory with exercises, or try to write programs? Or mix both? 

As Bruce Willis says in Live Free or Die Hard... "taking off's the hard part" (can't think of a better quote at the moment)

-----------------------------------
Zeroth
Sat Aug 09, 2008 11:30 pm

Re: Learning to Program
-----------------------------------
I'm kind of the defacto python guru around here, but theres lots of so-called "experts" on the board. I've been watching your progress, and you've been doing well. 

What I suggest is you come up with a set of interesting little mini-games or tasks you want to do. Thats what I did when I started.

I remember making:
random name generator
text-based rpg(dirt simple, but playing with classes)
lawnmower game
used it for lots of text-editing, for example, a program that could parse the pokemon text pokedex from gamefaqs. Stuff like that. Just keep finding a task to do in Python or whatever language you pursue. I also recommend picking up a BIG book on C. I learned lots from a 500 page C book I have, picked up for 7 bucks at London Drugs. Implemented basic data structures in C... that was probably my biggest advance in skill, right there, dealing with compiling, header files, memory management. Huge.

I'd recommend reading this: http://www.diveintopython.org/

Its what I used. You're doing really well for a beginner. Making(from what I see), far fewer mistakes than I did. However, I did all this because I had no internet. lol

-----------------------------------
wtd
Sun Aug 10, 2008 3:18 pm

RE:Learning to Program
-----------------------------------
It's amazing how much a little bit of syntactic niceness can streamline learning.

C:

#include 

int square(int n)
{
    return n * n;
}

int main(int argc, char **argv)
{
    printf("%d\n", square(4));
}

C++:

#include 
int square(int n)
{
    return n * n;
}

int main(int argc, char **argv)
{
    std::cout 