Anybody ever heard of MS Quickbasic or done any programming on it? You can run it with DOSBox for Mac.
Anybody ever heard of MS Quickbasic or done any programming on it? You can run it with DOSBox for Mac.
Yes, I had to convert a Quick BASIC program to C years ago. The problem was that interpreted BASIC was so slow that it would take three months of processing time to do the job. Yes, computers were slower back then. I rewrote the program as compiled ANSI C and used all of the optimizations I could, to make it run in 1% of the time. They hired me. I would advise you not to bother with programming in BASIC. For a lot of reasons it is severely deprecated today. If you want to program I would start out with C.
Why do you recommend C and not C++?
Because the current paradigm for application programming is object oriented programing with frameworks. This type of programming is done with C# (PC .net framework), Objective C (Mac, Cocoa) and C++ (cross platform) and Java (cross platform) which is a lot like C++. Some schools start out with C++. This seems like it would be very difficult to me. If you got started in C first you would be able to make the jump to the supersets of C more easily. My impression after talking to C++ .net programmers is that due to the nightmare of multiple inheritance in C++ and the vast number of classes in .net that someone with the IQ of Einstein who has no life except programming with this environment can do it but mere mortals will find it very difficult. This doesn't sound like a good place to start. If you learn C you will understand important concepts like pointers that will make sense in object oriented programming. The learning curve to go from zero to OOP is very steep. Nevertheless it can be done. I would begin at the beginning with something approachable.
On the other hand someone will doubtless disagree with me:
So what route do you recommend I take? What compiler should I use? What tutorials / resources?
...and when using the .Net-look alike WinRT in Windows 8 you use C++/CX...
So what route do you recommend I take? What compiler should I use? What tutorials / resources?
So do you work for the evil empire? Is that how you get to program for the not-yet-released Windows 8?
Anybody ever heard of MS Quickbasic or done any programming on it? You can run it with DOSBox for Mac.
BASIC is as good a place as any to learn about programming if all you want to do is learn about programming.
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
PRINT "Hello!"
Hello!
>> puts "Hello!"
Hello!
=> nil
>>
>>> print "Hello!"
Hello!
>>>
#include<stdio.h>
main()
{
printf("Hello World");
}
Compare that to something like C - you've got include files, a main function, compiling, linking, running a separate program. An IDE makes this easier, but remember this is what 'hello' looks like in C:
Code:#include<stdio.h> main() { printf("Hello World"); }
$ gcc -o hello -Wall test.c
test.c:4: warning: return type defaults to 'int'
test.c: In function 'main':
test.c:6: warning: control reaches end of non-void function
$ ./hello
Hello World$
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello World\n");
return EXIT_SUCCESS;
}
$ gcc -o hello -Wall test.c
$ ./hello
Hello World
$
C is so complicated, you managed to get Hello World wrong in multiple ways.
Code:$ gcc -o hello -Wall test.c test.c:4: warning: return type defaults to 'int' test.c: In function 'main': test.c:6: warning: control reaches end of non-void function $ ./hello Hello World$
So let's fix it up for the sake of the op :
Code:#include <stdio.h> #include <stdlib.h> int main() { printf("Hello World\n"); return EXIT_SUCCESS; }
That is what Hello World looks like in proper, portable ANSI C :
Code:$ gcc -o hello -Wall test.c $ ./hello Hello World $
Compare that to something like C - you've got include files, a main function, compiling, linking, running a separate program.
printf("Hello world");
#!/bin/pyhon -tt
def main():
print "Hello!"
if __name__ == '__main__':
main()
To be complete, should you not have the "int argc, char *argv" arguments in main, even if you ignore them?
The advantage BASIC always had...