Learning to Program
Author |
Message |
Roman
|
Posted: Sat Aug 09, 2008 11:20 pm Post subject: 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) |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Zeroth
|
Posted: Sat Aug 09, 2008 11:30 pm Post subject: 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
|
Posted: Sun Aug 10, 2008 3:18 pm Post subject: RE:Learning to Program |
|
|
It's amazing how much a little bit of syntactic niceness can streamline learning.
C:
code: | #include <stdio.h>
int square(int n)
{
return n * n;
}
int main(int argc, char **argv)
{
printf("%d\n", square(4));
} |
C++:
code: | #include <iostream>
int square(int n)
{
return n * n;
}
int main(int argc, char **argv)
{
std::cout << square(4) << std::endl;
} |
Java:
code: | import java.io.*;
public class Test {
private static int square(int n) {
return n * n;
}
public static void main(String[] args) {
System.out.println(square(4));
}
} |
C#:
code: | using System;
public class Test {
private static int Square(int n) {
return n * n;
}
public static void Main(string[] args) {
Console.WriteLine(Square(4));
}
} |
Now... (in no particular order)
Python:
code: | def square(n):
return n * n
print square(4) |
Ruby:
code: | def square(n)
n * n
end
puts square(4) |
Io:
code: | square := method(n, n * n)
square(4) println |
Scheme:
code: | (define (square n) (* n n))
(begin
(write (square 4))
(newline)) |
Common Lisp:
code: | (defun square (n) (* n n))
(format t "~A~%" (square 4)) |
Haskell:
code: | square n = n * n
main = print (square 4) |
O'Caml:
code: | let square n = n * n in
print_int (square 4);
print_newline () |
SML:
code: | let
fun square n = n * n
in
print(Int.toString(square 4) ^ "\n")
end |
|
|
|
|
|
 |
btiffin

|
Posted: Sun Aug 10, 2008 6:05 pm Post subject: RE:Learning to Program |
|
|
The force is strong with this one. |
|
|
|
|
 |
Roman
|
Posted: Sun Aug 10, 2008 6:19 pm Post subject: RE:Learning to Program |
|
|
Hehe yea, the easiness of Python syntax made it a lot easier for me to get into some challenging stuff without having to learn syntax as much. I want to start learning C++ next summer though.
I'm a little worried because I'm taking the normal CS courses despite having no programming background other than what I've managed to build up over the summer. Too late to change anything now though x_x |
|
|
|
|
 |
btiffin

|
Posted: Sun Aug 10, 2008 6:33 pm Post subject: RE:Learning to Program |
|
|
wtd didn't mention REBOL though. Stuck in the dark side he is.
code: |
REBOL []
square: func [n] [n * n]
print square 4
|
|
|
|
|
|
 |
juzten

|
Posted: Mon Sep 08, 2008 9:59 am Post subject: RE:Learning to Program |
|
|
I started into the computer programming degree at my college and I'm going in to my second year, I didn't have any programming experience let alone much computer knowledge. I now know a little bit of VB, Im learning java and studying python on my own. I saw a link about python in an earlier reply, im going to check it out.
Don't give up
juzten
Daily Free Software |
|
|
|
|
 |
Mobius
|
Posted: Fri Sep 12, 2008 12:42 pm Post subject: RE:Learning to Program |
|
|
You can always buy a JAVA book and learn, i used to use Forte 4 JAVA and get yourself a textpad or Eclipse for writing your code.
Don't bother with theory, in my opinion, they were a waste of time for me. You should program something that's actually practical. Like a simple game or something, instead of doing some complex math graphing that I did when I was in my second year. UofT's Web Programming course, i think its CSC309, that was actually fun and pratical course to me. It taught me about web programming and our assignments were basically a chess game with add-ons for each assignment. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
rdrake

|
Posted: Fri Sep 12, 2008 3:31 pm Post subject: RE:Learning to Program |
|
|
Theory is absolutely essential for anything you could ever program. For example, knowing how various algorithms compare and which to use in a certain situation is very important. |
|
|
|
|
 |
Zeroth
|
Posted: Fri Sep 12, 2008 9:34 pm Post subject: Re: Learning to Program |
|
|
Theory IS absolutely essential. If you ignore it, all you've learned is one language's syntax. When you learn the theory, you have a common underlying system for comprehension that is language, platform, and design neutral. In effect, you learn the underpinnings of all languages that will ever be invented. However, when you're starting out, don't just learn the syntax. Learn the concepts, the why it works. |
|
|
|
|
 |
Roman
|
Posted: Sat Sep 13, 2008 7:32 pm Post subject: RE:Learning to Program |
|
|
Theory and practice are interrelated, no?
I'm having fun in CS135 so far ^^ |
|
|
|
|
 |
jbking
|
Posted: Sun Sep 14, 2008 4:09 pm Post subject: RE:Learning to Program |
|
|
Sometimes theory and practice are interrelated.
For example, are there non-deterministic automata that could be analyzed in theory but hard to bring into the real world.
Also, consider how practical aspects of Pure Mathematics are compared to Applied Mathematics.
JB
PS - My degree from UW had majors in CS and C & O with a Pure Math minor and I couldn't get all three on the diploma. *sigh* |
|
|
|
|
 |
Roman
|
Posted: Sun Sep 14, 2008 11:33 pm Post subject: RE:Learning to Program |
|
|
I'm working my way towards an Applied Math degree with a possible Philosophy minor, but Computer Science and Filmmaking certainly are interests.
I actually have another question, which I will post separately. |
|
|
|
|
 |
|
|