4 ms·
Am I missing something, how is: #include <stdio.h> int main() { printf("Hello World!\n"); } just as easy as: 10 PRINT "Hello World!" Later versions of B
by lockhouse 3y ago
Am I missing something, how is:
#include <stdio.h>
int main() {
printf("Hello World!\n");
}
just as easy as:
10 PRINT "Hello World!"
Later versions of BASIC like QBasic dropped the line numbers even. BASIC won because there was no friction and no ceremony involved with writing simple programs. Displaying text, getting input from the user, and doing simple mathematical calculations were relatively intuitive. Control flow was easy with GOTO. You could learn how to do all these things in an afternoon. Most microcomputer bundled BASICS even had primitive facilities for handling graphics, sound, and joysticks, so you had all you needed to make simple games. You could even PEEK and POKE at the memory, meaning you could even do some pretty advanced programming without reaching for C, Pascal, or Assembler.
Incidentally, I believe this is why Python is so popular today. It's just a saner iteration on BASIC in many aspects.
- osigurdson 3y agoLoops and control structures are all much simpler to learn than grade ~6 math. Essentially, there is nothing to learn so what is the point in trying to make it easier?
- lockhouse 3y agoMost BASIC dialects do have loops and control structures as well, but GOTO is the original control flow mechanism, it is conceptually very easy to grasp, and it is available across pretty much all BASICs. Even C has a GOTO statement, despite a certain famous computer scientist considering it to be "harmful," so Kernighan and Ritchie must have seen some value in their language having it available.