klinky wrote:
Err and let me try my hand at a c++ version:
Code: Select all
#include<iostream.h>
char age
void main() {
cout << "How old are you?;
cin >> age;
cout << "\nYou are " <<age;
}
Nope. The correct version is:
Code: Select all
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int age; // compensate for stupidity on the user's behalf --
// we should be using an unsigned short int
// but people like to break things
cout << "How old are you?";
cin >> age;
cout << endl << "You are " << age << endl;
return 0;
}
Much of it is semantics, but most of them are semantics that really make a difference.
Mathematics is very important to learning how a computer operates, especially discrete and combinatorial mathematics. (I'm learning that myself, so don't ask what the heck it is.) Mathematics and logic factor (ha ha, factor) hugely into important fields such as algorithm analysis and data structures.
As for me, though:
I started in QBASIC on an Intel 8088 machine (whee). Worked in VB for some time, and then discovered a C compiler (I can't remember who was the compiler vendor). Played with that for a while, started playing with C++, had fun with that.
Installed GNU/Linux and FreeBSD on a few systems. Started having fun with PERL, PHP, and some Bourne shell scripts.
Then came along this
awesome book:
Programming Languages, by Dr. Allen B. Tucker. If you just want to be a programmer, it may not be that cool. But if you're a total geek like me who likes to learn about programming language theory for the sheer hell of it, it's really, really cool. With that I picked up a working knowledge of PROLOG and LISP and a couple others.
So it's basically been one big playtime for me. The amazing thing is that what I thought was just one big game about eight or nine years ago (and still do) is a respected major.
