Where and How did you learn to Program?

The title says it all, but I would like to know this so I can get a good start on programming so I won't waste time and money.

Of course C++ is the most popular language, but if you started with something else please let me know. I am just wondering how you got from Point A to Point B!
Actually if you dont want to use books and all that stuff, Xoax.net is a pretty good place to learn the basics. His videos explain all the basic stuff.
I learned by reading "Java How to Program", then the tutorials here http://cplusplus.com/doc/tutorial/ then "C++ How to Program".. practice, practice..

then start to learn other languages.. php, vb, etc.. making games :)
I had been doing windows batch scripts for years (I messed around with Basic, very seldom), then I got into linux, and started scripting with bash shell, then progressed into Python (very shortly), then C++ which I stuck with for about 3 months before trying out C#, VB, Perl, more Python, etc.

Right now my major languages are C++ & C#, bash scripting of course, with python and perl mixed in when needed. All this really kicked off in the last year, before that I knew next to nothing about programming in general.

I basically learned everything I know, from researching on Google, and trial and error. C# was incredibly easy for me to learn after learning C++. And C++ was easier after shell scripts (I had tried C++ before that, and was overwhelmed by it and gave up). I tried Basic and VB again, and soon realized it was **** compared to C++ or even C#.

So yeah, that's basically my story.
RyanCaywood: "...and started scripting with bash shell"


I have the Cygwin Bash Shell, for about three months and never really understood it. All I knew was that you can basically look through your entire computer and see whats in it? I had no idea that you can script with it. Do you think you can tell me a bit more about that? Would that be a good place to start?
Last edited on
I started when computer programmes used to be etched into clay tablets. Most of what I know I absorbed through my skin.
Started with learning how to use the Windows Console a long time ago, started GML and VBasic shortly after (of which I enjoyed GML the most). Originally I wanted to learn how to create C++ DLL's to speed up GML, but I quickly found that C++ wasn't that hard and I got me a C++ book (Beginning C++ Through Game Programming, Second Edition - Michael Dawson). I also used Xoax.net here and there (great site!).
I started with JASS, blizzards scripting language for warcraft / starcraft custom maps/games

The internet has the most and best resources, google is always your friend
Last edited on
Galik wrote:
I started when computer programmes used to be etched into clay tablets. Most of what I know I absorbed through my skin.
LOL!

@RialnisMada
I'm not sure what you mean by looking through you computer... You mean the ls command? Cygwin is an entire Linux environment for Windows. It is another operating system (basically) within Windows. More info in PM...
Come to think of it, I did try programming with Unreal... It is very similar to C++ but customized for the game engine... I didn't get far with it besides modifying code that someone else already developed... Now, it'd be a breeze since I know C++. At the time I didn't understand what classes were, or what int, string, float, bool, or any types were.. and barely understood if statements, and nothing about loops. Nor did I know what brackets were for, just knew they had to be there or it didn't work.

It's always fun looking back on things like this... you think "how could I have been so dumb??". lol..
Last edited on
Come to think of it, I did try programming with Unreal... It is very similar to C++ but customized for the game engine... I didn't get far with it besides modifying code that someone else already developed... Now, it'd be a breeze since I know C++. At the time I didn't understand what classes were, or what int, string, float, bool, or any types were.. and barely understood if statements, and nothing about loops. Nor did I know what brackets were for, just knew they had to be there or it didn't work.

It's always fun looking back on things like this... you think "how could I have been so dumb??". lol..


That is exactly how I am right now... I have basically no clue what the things are you listed, except for maybe two or three things.

I just need to look for something that will explain it to me in noob words!
An integer is one of the many variable types. The specifications of an integer are that they lie between -2147483648 and 2147483647 and cannot contain a decimal part (things like halves and quarters). -31235, 0 and 89923 are examples of integers.

A float is a variable type that stands out from the basic integer, because it can store decimal parts too. The special thing about a float is that it can store up to 7 significant digits. 181.3155, 3.1239 and 9135830 are examples of floats.

A boolean variable has the attribute to only indicate false or true (0 or 1). They are used for truth comparison. 1, false and true are examples of booleans.

A string is a text container which is, basically, a "list" of characters (like 'a' and '!').

A statement is a line of code, beside from pre-processor directives and function prototypes of any kind. "int Bla = 4;", "cout << endl;" and "" are examples of statements (as for the PPDs and FPs that I mentioned above, don't worry about them till you meet them in action).

A loop is a block of code (multiple statements) that keeps executing as long as a certain expression evaluates to true (or false, depending on the loop type). This expression is typically a boolean value. An example of a loop is:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream> // Include library that allows you to output to the console window
using namespace std; // Namespace stuff you don't need to care about for the time being

int main()
{
    for(int i = 0; i <= 10; i++) // Loop
    { // Opening bracket
        cout << "i"; // Statement
    } // Closing bracket
    cin.get();
    return 0;
}


Finally, a class is a definition of an object type. A keyboard is an object, that which defines it to be used and/or recognised as a keyboard is considered the keyboard class. In the given example, the class could interact with fingers and send data to computers. Note that this is an abstract example, though.
Just to be nitpicky, ints and floats and the like are built-in data types, not variable types, since there are constants too.
Hmm...for some reason, I bought "C++ for Dummies" and read it a bunch. It's not a great book, but I picked up enough from it to start.

My advice: Learn lots of math. Use Linux as your primary OS, it will teach you a lot through just using it. Think things through, in the form of "If I were going to do this problem myself, how would I do it?" Computers aren't smart, they're just very, very fast. But you are smart. When learning, keep using what you learn. Just make stupid little programs that use what you just learned. Try www.projecteuler.net problems, begin with the easy ones.

I wouldn't spend money on anything...borrow books from the library, or just use the tutorials on this site. Don't pay for any fancy IDE's or anything.
Eclipse Galileo is my favorite IDE for C++. It's free, open source, etc.

Anyway, brackets are a way to tell the compiler where to start a block of statements and where to end it. In other languages, these are often replaced by words, like ENDIF, or FI, or END, etc, and usually use the control statement as the initializer, omitting any kind of opening delimiter. If there were no opening/closing delimiters, the compiler/interpreter would not know where the block starts or ends.. C++ does not nessesarily have to have brackets around a single line block, i.e. you can do this
1
2
3
4
if (condition)
     cout << "True" << endl;
else
    cout << "False" << endl;

or this
1
2
if (condition) cout << "True" << endl;
else cout << "False" << endl;

But you cannot do this
1
2
3
if (condition) 
    cout << "Condition:" << endl;
    cout << "true" << endl;

it has to be enclosed in brackets like so:
1
2
3
4
5
if (condition)
{
cout << "Condition:" << endl;
cout << "true" << endl;
}


Also note, that it doesn't matter where the brackets actually are, as long as they are before and after the statements in the block... such as:
1
2
3
4
if (condition) { 
    statement1;
    statement2;
}

or if (condition) { statement1; statement 2; }

Semicolons are End-Of-Statement or End-Of-Line (EOL) delimiters. They tell the compiler where a single statement ends, thus you can span single statements across multiple lines, or put multiple statements on the same line, unlike other languages.

Other languages would process
1
2
cout <<
endl
as two separate statements, while C/C++ will process things depending on where the delimiter is located, as in
1
2
cout <<
end;
it treats the two lines as a single statement, or single line. And will treat statement1; statement2; as separete statements, as if they were on different lines. This is powerful, but also dangerous because one can often forget to include a semicolon, and the program will not work...
Last edited on
I read C++ for dummies too :D
Atleast, until page 170 or so. Then I realized this wasn't a very good book and I switched over to "Aan de slag met C++". Unfortunately it's only written in dutch. But if you are dutch you should check it out, very clear and structured book!
Awesome programming-for-newbies site:
http://msdn.microsoft.com/en-us/beginner/default.aspx

The C++ book on there, free for download:
http://msdn.microsoft.com/en-us/beginner/cc305129.aspx

I learned C++ from that book.
Last edited on
chemical

I really liked those links so I wanted to give you props on that. Thanks.
Topic archived. No new replies allowed.