by syx on 12/23/23, 10:13 AM with 262 comments
by sdsd on 12/23/23, 11:44 AM
But there is one thing I'm very grateful for, in retrospect. Both languages required very few "concepts". Functions? Pointers? Classes? These are basics for coders, but BASIC didn't ask even this of you.
With a small syntactic baseline you could make full on games pretty easily. Compare this to making games even with Python using PyGame, or Godot, or whathaveyou.
Of course, nothing prevents you from learning Python and just limiting yourself to a few data types and control structures. But what really made BASICs easy (for me) was that "draw to the screen" was such a primitive operation. Same with detecting keypresses.
Again, these are easy if you're a software engineer, or even if you know how to code. But what if you don't?
Even Visual Basic had this virtue. When I was in Mexico I volunteered at a homeless shelter. The man who operated the shelter had no coding education, but was able to self teach Visual Basic two decades ago, and had created an entire system for managing the facility.
He had tried to rewrite it to use a more modern language (I believe C# or VB.Net) and was totally unable.
I've never used VB but I've heard countless tales like this, where non-coders create entire functioning software in it.
by glimshe on 12/23/23, 4:27 PM
But it's not a language just for kids. While most dialects are somewhat limiting, there is nonetheless a TON of real useful stuff you can do with it.
by pavlov on 12/23/23, 11:13 AM
Is TypeScript in 2023 the same language as JavaScript in 1996? The various BASICs were even more different than that. It’s impossible to say that they were all categorically horrible or perfect. But they did enable millions of people to discover computing, on everything from ZX-81 to Windows 95.
by flohofwoe on 12/23/23, 11:36 AM
by jeffwass on 12/23/23, 11:43 AM
Back in the 80’s you fired up your computer and you had a readily-available interpreter for which you could immediately do ‘real’ stuff like printing characters anywhere on the screen and turning on and off pixels (even in colour on some platforms).
There was no need to compile or build a project or start with a lot of boilerplate. You just did stuff right away from a REPL or could make programs from line numbers and save them.
I learned a ton from it. Eg how to think algorithmically and break up something complicated into small parts. A key milestone was grokking the difference between GOTO and GOSUB. I also understood much about its limitations once I started learning Turbo Pascal in high school.
If you’re judging BASIC compared to a modern IDE with a modern structured language of course it falls short, but for what it was at the time it was nearly perfect.
by vajrabum on 12/23/23, 5:52 PM
C AREA OF A TRIANGLE - HERON'S FORMULA
C INPUT - CARD READER UNIT 5, INTEGER INPUT, ONE BLANK CARD FOR END-OF-DATA
C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT
C INPUT ERROR DISPAY ERROR MESSAGE ON OUTPUT
501 FORMAT(3I5)
601 FORMAT(4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2,
$13H SQUARE UNITS)
602 FORMAT(10HNORMAL END)
603 FORMAT(23HINPUT ERROR, ZERO VALUE)
INTEGER A,B,C
10 READ(5,501) A,B,C
IF(A.EQ.0 .AND. B.EQ.0 .AND. C.EQ.0) GO TO 50
IF(A.EQ.0 .OR. B.EQ.0 .OR. C.EQ.0) GO TO 90
S = (A + B + C) / 2.0
AREA = SQRT( S * (S - A) * (S - B) * (S - C) )
WRITE(6,601) A,B,C,AREA
GO TO 10
50 WRITE(6,602)
STOP
90 WRITE(6,603)
STOP
END
by ikari_pl on 12/23/23, 11:00 PM
A personal background: writing this article was fun! I started with BASIC too, I was about 6, and the Amstrad CPC6128 my dad had was 8 already. You can tell by how I treat Locomotive BASIC like a reference implementation of the 80s. I knew Pascal only from a label on diskette 5 (but someone replaced it with invoices), listings from 80s Bajtek magazine stash that I mostly got from a friend (he had an Atari 65XE but was switching to a... Pentium III 500Mhz), and the manual for the Amstrad and having A LOT of free time were my source of knowledge. I remember trying to replicate (in BASIC!) the UI of first computerized cash registers from the shops, when I was 12.
I knew Dijkstra made the quote, but never before asked myself: when did he do it? Was it the BASIC I know? What did people use, probably just assembly, right? Wrong!
It's amazing how much old documents, newsletters, and documentation you can find from the 70s, and how many the problems it did not change that much today, even though the computers changed incredibly.
I'll read through the comments here, and for sure won't miss any on the site itself.
by weinzierl on 12/23/23, 12:32 PM
What was very different about BASIC compared to today was that it was "Beginners' All-purpose Symbolic Instruction Code" (that's what BASIC stands for). At the same time it used to be used by adults to solve real world problems.
If you outgrew BASIC you could easily segue into Pascal which was much more powerful but still designed with education in mind.
I think today the gap between what is used to teach and what is used to solve problems is much bigger. Once children get older the motivation for toy languages understandably goes away but learning a modern programming language that is actually used in the industry is a big step that is not easy to overcome.
I have no perfect solution for that but for us and for now we settled for Godot and GD Script. It is simple enough to get started and I think when I showed my daughter the Tesla App [1] it was a big motivation.
[1] I've heard the current version it is not made in Godot anymore, but it was when we started on this journey a while ago.
by MarkusWandel on 12/23/23, 12:27 PM
For examples of fancy BASIC graphic programs, search for:
https://www.youtube.com/results?search_query=cursor+tape+mag...
Cursor magazine programs did occasionally have an assembly language subroutine; at least one flashed the screen using one. But most of them were just BASIC.
Purists may scoff, but kids with zero experience could make animated graphics after just a day or two of playing around, and curiosity about how more sophisticated programs worked (in my case: The "Miser" text adventure game) would soon motivate to find out more. Is that bad? It was the whole point of the language, the B stands for "Beginner". Plenty of time to graduate to other things later (in my case: Assembly language -> Pascal -> C).
by nathell on 12/23/23, 11:40 AM
It was one of the most important, if not _the_ most important, source of computing knowledge in my early childhood. I was born in 1984, got my first computer – a C64C – in 1991, and my dad procured a heap of past issues of „Bajtek” from previous years. In rural Poland those days, knowledge was hard to come by, so those proved invaluable to me.
Not only were there type-in programs and games, like in the German 64er, but most of them were actually accompanied by prose articles that offered clear explanations, background, and trivia. I learned BASIC from Bajtek and a few books. Bajtek literally had a monthly column called „For Preschoolers Only” with a BASIC tutorial in it.
by phkamp on 12/23/23, 6:48 PM
Several teachers who taught BASIC/COMAL in the 1970ies and 1980ies have commented to me, that the line numbers made them much easier to teach than for instance PASCAL.
The line numbers enables the teacher to say "Now, look at line 240" which is much more precise and concise than "Look at the statement in the IF inside the WHILE" etc.
by acqq on 12/23/23, 12:05 PM
The reason Basic wasn't horrible but amazing at the time as the home computers appeared is hard to understand without the context of that time:
Basic on these computers was, in today's language:
- an actual "complete" operating system and
- a command language and
- a script language and
- a programming language
Additionally, if one wanted to use the "full power" of the CPU one had to use machine code, as there was so little RAM that most of the programs that did fascinating stuff were true masterpieces. Those using Basic knew that it's not "all there is".
by todd8 on 12/23/23, 10:47 PM
I gave the deck of cards to a friend and a couple of days later I got the fan-fold paper output that listed a bunch of syntax errors and nothing else. I just didn't understand programming very well.
BASIC is what got me on track. I found a book in my local public library on the relatively new language BASIC. It was easy to understand and I practiced writing out the solutions to simple problems with paper and pencil. I didn't have access to a BASIC system, but I learned enough that I could try FORTRAN again (this time on simpler problems). After a few attempts (with the two day turnaround) I was successful and programming became a hobby that eventually led to a career as a real computer scientist.
BASIC was just right. It was concrete enough for a novice to understand while being much more expressive than assembly language. I've never actually run any program that I wrote in BASIC, but I have written programs in scores of languages since and BASIC got me started.
Today, there are better choices for a first language: Python provides students with a lot of power right away, and my daughter learned Scheme as her first language and never had difficulties in later classes with recursion or functions as values.
by ChuckMcM on 12/23/23, 7:32 PM
As I've told unbelieving students that I learned to program using a Teletype and line numbers were really really useful. Later I actually used an "editor" on a DEC Writer and it was even more convoluted. (it would print the line you were editing, down arrow would move to the next line, up arrow to the previous line, right arrow would print out the current line character by character and if you typed other characters they would either be inserted or replace characters depending on the mode.)
I think a case insensitive python with group delimiters rather than using indentation for groups and a line terminator character would be a good replacement. The goal is to minimize the number of new things you have to learn to get going. Concepts like grouping and individual statements seem to "stick" better with students when they can easily express that with characters in the code. (my experience teaching people to program YMMV of course).
by downut on 12/23/23, 1:09 PM
Weekends I spent at the beach, though.
I see from Wikipedia that the system costs were enormous! But that was an exquisite summer romance with BASIC.
Not too many years later I discovered Turbo Pascal. Yeah, off to the races. And then came Turbo C++, and g++ around '92. Haha you kids today would really enjoy debugging templates in early g++. (The idea that you could write the same code for 'float' and 'double' was intoxicatingly cool.)
The transition from Fortran (what I learned to program with) => HP Basic => Pascal => C++ was pretty easy. Pointers, well if you study 'The C Programming Language' carefully, are not difficult. People writing serious computational mathematics codes are constantly using pointers, just not as 'pointers'. Debugging, well that is another problem entirely, and I believe from way out here in the future, that that is the most difficult problem of all. How to program in such a way that the bugs are not silent. Those silent ones were the cause of most of the grief in my programming life.
The thing about HP Basic is none of the bugs were ever silent. Same with Turbo Pascal. I did a lot of really cool things with those 'toy' languages. They never caused me any grief.
So I think Dijkstra didn't understand (maybe) the importance of painless pleasure when (some) mortals are learning programming. It sure turned me on.
by wslh on 12/23/23, 11:43 AM
The language is primitive by today's standards but it gives you all sort of ways to express yourself. When BASIC progressed and was more structured, for example AmigaBASIC from Microsoft [2], there were more alternatives and more evolution so it is natural that BASIC faded.
Also important to highlight that every popular computer magazine (media) published BASIC code, also books.
[1] https://en.wikipedia.org/wiki/ZX81
by RedNifre on 12/23/23, 11:23 AM
Also, when I was implementing FOR, my first naive implementation was compiling the body first, then append the loop related things that check the conditional and jump backwards to the start of the body. "Hang on, what about the case when the condition is initially false?" I thought, only to discover that the BASIC standard actually specifies that a FOR loop runs at least once, even if the condition is false! Officially, the language is advertised as for beginners, but to me it looks like it was meant as a lingua franca of computers, as in not only easy to understand, but also easy to implement.
Here's a BASIC compiler for the HP 15-C calculator written in Idris: https://gitlab.com/michaelzinn/voyc/-/blob/master/src/Compil...
by Aardwolf on 12/23/23, 11:11 AM
It's not horrible at all if a child can learn to make a game in it from scratch.
However, qbasic doesn't have the line numbers (edit: at least not mandatory!). Never used a basic variant that requires the line numbers, but that seems like a total kludge!
by wruza on 12/23/23, 12:26 PM
Idk what Dijkstra means. My whole generation started with BASIC and learned languages as they’ve become useful enough for every new wave of accessible hardware, which wasn’t cheap for a hobby. There was no like “oh, now you’re lost”. My next language was 8080 assembly then Pascal then 8086 then C. You just can’t learn Pascal and C on a Sinclair clone when loading a compiler from a tape recorder takes half an hour and most of the available memory. And you can’t learn Python either, because it doesn’t really exist yet. I know it’s from 1991, but never heard of it until ten+ years later.
I also know that some ROMs had FORTRAN instead. Maybe Dijkstra would like to re-teach FORTRAN programmers more.
by ofrzeta on 12/23/23, 5:54 PM
Part of the problem is that the OS API is kind of restricted to basic sounds and graphics drawing primitives. For everything else you need PEEK and POKE.
by cameldrv on 12/23/23, 6:36 PM
The beauty of BASIC is that everything is so concrete. Every line has a number, and you just keep going down the page unless you hit a GOTO. It's easy to reason about what's going on inside the computer. Abstractions make a language powerful, but also harder to learn. This is why spreadsheets are still the most popular way of programming a computer -- they're concrete and you can see exactly what is happening in every cell.
by odux on 12/23/23, 12:28 PM
[1]: https://en.m.wikipedia.org/wiki/Logo_(programming_language)
by alerighi on 12/23/23, 12:00 PM
I'm tired of this "good programming", there is people that talks about good programming and than produced programs that are either too complex to do something useful. These to me are bad programs!
There were a ton of companies or persons that used (and still use) BASIC (or Visual Basic) programs to do stuff, and maybe if it wasn't for BASIC these programs would probably never be written.
Same thing we can say about COBOL, a ton of companies are run by an IBM AS/400 running old COBOL programs written in the 80s that still work fine.
by greenbit on 12/23/23, 12:20 PM
These days if you want to run a program to crunch some numbers, the program is one file, and the data another - but back then, since you fed the whole 'job' into the card reader at once, you could change the data set by just swapping out the cards.
Not saying that this was in any way better. Just that the idea of it feels so alien - and this was the era in which BASIC first evolved.
by analog31 on 12/23/23, 9:51 PM
I think the idea of learning one bad thing and being ruined for life is a misconception about learning.
by LanzVonL on 12/23/23, 6:49 PM
The GOTO guy has done more damage to computing than Microsoft and Google combined.
by forinti on 12/23/23, 12:15 PM
It was line oriented so you didn't need an editor. It was simple and had a very short learning curve.
You were never going to write a huge program, so modules or packages weren't a necessity.
It just fit this niche perfectly.
by drewcoo on 12/23/23, 5:41 PM
by kazinator on 12/23/23, 11:51 PM
by bvan on 12/25/23, 1:16 AM
At the end of the day, what matters is the end-product. Your users don’t care what programming language or tech you used to solve their problem.
by llm_nerd on 12/23/23, 4:39 PM
by ziotom78 on 12/23/23, 11:22 AM
My very first computer was a Commodore Vic20, whose User's Manual was essentially a BASIC manual. One of the very first programs I learned to wrote drew a simple bird on the screen made by characters and made its wings flap. I was mesmerised.
Boy, how much I enjoyed that manual!
Edit: bids -> bird
by teddyh on 12/23/23, 10:29 PM
<https://news.ycombinator.com/item?id=35220605>
I wrote BASIC code in the 1980s; both games and utility software. It is precisely because I did those things that I object to any BASIC lacking functions. The BASIC I used lacked functions, and I remember it being very difficult to do what I can now call abstractions and subroutines. This would have been vastly more easy if the BASIC I used had had user-defined proper functions.
by pjmlp on 12/23/23, 11:47 AM
Guess we need to hope for Mojo's success.
by thrance on 12/24/23, 1:17 PM
by bsder on 12/23/23, 10:22 PM
BASIC is a product of limited memory. It can run, as an interpreter, in a machine with 4K of RAM and nothing else. No ROM--No tape--No disk.
Try that in any other language. The only ones that can even attempt that are Scheme and Forth.
Dijkstra can slag BASIC all he wants; he had access to computers with megabytes of storage. We plebians, on the other hand, were quite lucky if we had 4K of RAM.
by tanepiper on 12/23/23, 7:36 PM
It was my first language - I don't think it was detrimental as it lead to me having my career in tech.
by anonymousiam on 12/23/23, 6:16 PM
by BeefDinnerPurge on 12/23/23, 7:29 PM
What I hate is the number of tools since created to enable endless tech debt and horrible engineering practices so as to increase the hiring pool of fungible coding talent.
Who needed nice things anyway when we have 280 characters and inspiring influencers?
by BeefDinnerPurge on 12/23/23, 7:31 PM
by jantypas2 on 12/23/23, 10:45 PM
by stephc_int13 on 12/23/23, 5:18 PM
by thriftwy on 12/23/23, 11:59 AM
Maybe early BASICs were so-so, but QBasic already had all kind if procedural stuff.
by readyplayernull on 12/23/23, 6:23 PM
by _trampeltier on 12/23/23, 12:32 PM
by firebot on 12/23/23, 5:50 PM
by rational_indian on 12/23/23, 11:37 AM
by sourcecodeplz on 12/23/23, 7:32 PM
by rvba on 12/23/23, 5:12 PM
by jasfi on 12/23/23, 11:15 AM