3 ms·
Honestly, I don't know why the industry bothered with BASIC way back when. The old C64 should have just booted to a simple C IDE. "Hello world" is just as easy
by osigurdson 3y ago
Honestly, I don't know why the industry bothered with BASIC way back when. The old C64 should have just booted to a simple C IDE. "Hello world" is just as easy in C as it is in BASIC and much easier to do more.
- lockhouse 3y agoAm 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.
- pjmlp 3y agoMostly because when C64 came to be no one cared about C outside Bell Labs and a couple of select universities. Secondly, even BASIC does strings, arrays and type safety better than C.
- osigurdson 3y agoC had fewer abstractions meaning that kids could develop a much better mental model of what the machine is an actually doing.
- pjmlp 3y agoI was a 10 year kid doing BASIC, including DATA, PEEK and POKE, got into Z80 Assembly by the age of 12. Rest assured we were more than aware of what the machine was doing. It is an urban myth that C improves anything into that regard.
- cweagans 3y agoDeveloping a mental model of what the machine is actually doing is more advanced than just printing text to the screen, getting input, and handling basic control flow. Beginners don’t necessarily need to understand everything that the hardware is doing, and learning everything all at once is overwhelming. I’m pretty sure you know that, too. Otherwise, why not just jump straight into assembly? There’s no better way to learn what the hardware is actually doing, right?