6 ms·
> We all know that BASIC is a load of rubbish. I don't think this is right - BASIC was quite well designed considering these machines' capabilities and project
by 0815test 8y ago
> We all know that BASIC is a load of rubbish.
I don't think this is right - BASIC was quite well designed considering these machines' capabilities and projected use. The model of a BASIC-powered home computer was essentially that of a programmable calculator with "computer" features tacked on. You could start by PRINT-ing math expressions at the REPL, and these would give you the sort of result you would expect, using software floats. Then you could make more complex programs, using simple line numbers, variables, and a handful of reserved words like PRINT/?, INPUT, IF, GOTO, FOR. You also had PEEK, POKE, SYS and/or USR to access the hardware directly. Sure, in theory FORTH might have been more elegant, but its RPN-like approach was far from intuitive.
- int_19h 8y agoBASIC has a very inconsistent syntax, and did so from the very first version. Over time it got worse. For a specific example, just look at the syntax for drawing primitives like PSET, LINE or CIRCLE. Something like this is neither particularly discoverable, nor consistent with the normal function call syntax in the language: LINE (0, 0) - (100, 100), 2, FB (I wonder how many people with BASIC experience from that era remember what "FB" means here.)
- DanBC 8y agoBF fills the box, and does something wierd with the x1, y1, and x2, y2 coords. I'm not persuaded by "discoverable"; you'd get a book that included a page for every statement with a worked example.
- int_19h 8y agoYou have to know where to start looking though, and it's not at all obvious that LINE is what you need to draw a filled rectangle. It also throws you off once you learn about subprograms (in dialects that had them), and realize that all this stuff is almost but not quite like them - and all the differences are there for no good reason.
- lokedhs 8y agoI recently experimented with Living Computer Museum's CDC 6500. It has Basic available, and it's remarkable how similar it is to C64 Basic. In fact, if you have experience with the C64 you can use the CDC without any documentation.
- Theodores 8y agoThe debate existed then, I quote Dijkstra: "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." I never got to own a Jupiter Ace or to have a go at FORTH. I don't think the options were 'BASIC or FORTH', neither do I think that computers had to have 4K of ROM and 1K of RAM by the time the 8 bit microprocessors came along in the hobby era. Sure 8K of anything cost more than a paltry 4K but were those machines with 4K ROM of BASIC and 1K of RAM useful for anything whatsoever? The ZX81 with 1K just mentally mutilated programmers, other than that you learned that you needed more memory. Your first programming language constrains how you think, I was deeply wedded to the 'GOTO' concept and could not understand how a program could work without line numbers. BASIC took me a long way off the object-oriented paradigm! Anyway, thanks for grumbling about my sweeping statement - that I still stand by - I have now found some Dijkstra that is totally relevant to today and how web development has gone: https://www.cs.utexas.edu/users/EWD/ewd04xx/EWD498.PDF https://www.cs.utexas.edu/users/EWD/ewd04xx/EWD498.PDF
- goto11 8y agoObviosly Dijkstra didn't see the benefit of a REPL, since be believe that you should sit down an prove the correctness of software by hand before you were allowed to execute it.
- ams6110 8y agoA lot of custom business software for the IBM PC was written in BASIC and it worked very well. I helped a restaurant that had their inventory, crew scheduling, payroll, and accounting all written in BASIC. Ran on a PC AT in the back office. It worked flawlessly.
- tokyodude 8y agoI wrote some basic for the first time in like 25 years. Forgot how there were no local variables nor parameters to functions. Everything is a global variable and GOSUB is just GOTO with a return stack (no parameters). Also forgot depending on the BASIC that some BASICs only allowed 2 letter variables. Those were my biggest issues trying to get back into it.
- JohnBooty 8y agoAlso forgot depending on the BASIC that some BASICs only allowed 2 letter variables. For those not familiar with these systems, the way you coped was usually by keeping a "data dictionary" on a sheet of paper. On a sheet of paper you'd have... $AA = Name of foo $AB = Selected color of baz $AC = Blah blah $AD = Length of qux etc. It wasn't TOO bad. Until you lost the damn thing, or had to work on somebody else's code and you didn't have the data dictionary. You could keep the data dictionary in the code's comments, but on systems with just a few kilobytes of RAM (ie, the systems that restricted you to 2-char identifiers) this was not always a feasible luxury. Luckily, I managed not to have to deal with this personally. All the BASIC environments I used as a kid in the 80s did not have this limitation. But I heard horror stories.
- Angostura 8y agoCouldn't you pop those in REM statements (assuming you had RAM to burn)?
- JohnBooty 8y agoYes, but the systems with two-char identifiers were also the ones with the most extreme RAM restrictions. Some commercial Apple II software was actually written in BASIC, and you could read the code. It was usually fairly liberally commented. Example code in magazines was liberally commented as well. Folks didn't seem to comment individual lines of code, but tended to "name" and sometimes describe their GOSUB (subroutine) blocks. But, Applesoft basic didn't force you to use two character variable names. Because most Apple II's on the market had a luxurious 64KB or 128KB of RAM, and none had less than 48KB. I think it was a different story on systems with 4KB or perhaps 16KB of RAM. On those systems I bet you were often squeezing out every byte. I also think some older languages (COBOL?) often had restrictions like this.
- Annatar 8y agoBASIC on those systems was rubbish, every platform had its own dialect, some like Commodore BASIC 2.0 didn't provide full support for hardware capabilities, the systems shipped without a compiler. As a consequence, when you got your first computer you learned the bare minimum through BASIC and then quickly moved on to assembler in order to get the efficiency and be able to make the hardware do something useful. Many of us have fond memories if BASIC, but let's face it, it was, well, quite basic (pun intended).
- C1sc0cat 8y agoActually the core of all those early systems was Microsoft Basic even the original IBM PC had a Basic in ROM. If you wanted low-level access you just poked Assembly code Most of the really early Home Pc's had such limited hardware that running a compiler was not practical - you could get compilers for CPM systems but they where more professional systems with a price tag to match. Even than a top of the line Cromecho s100 was a lot cheaper than say a pdp11/03