r/programming • • May 03 '24

The BASIC programming language turns 60

https://arstechnica.com/gadgets/2024/05/the-basic-programming-language-turns-60/
240 Upvotes

60 comments sorted by

View all comments

95

u/Robot_Graffiti May 03 '24

35 years ago, I used to write programs like

10 PRINT "OH NO THE COMPUTER IS BROKEN"
20 PRINT "ERROR ERROR ERROR"
30 GOTO 20

59

u/qzen May 03 '24

I was 6 years old when I wrote my first goto loop to print my name across the screen.

I have been hooked ever since.

1

u/[deleted] May 04 '24

We all (well, almost all) belong to that same youth storyline, e. g. the 1980s generation (plus / minus a few years).

1

u/[deleted] May 04 '24

Did you you put just the right amount of chars so it looked like it is scrolling sideways?

→ More replies (1)

0

u/[deleted] May 03 '24

[deleted]

8

u/StoicWeasle May 03 '24

Yep. 40 years ago for me.

33

u/mycall May 03 '24

It was more like:

15 b=53280 : p=53281 : v=53265 : t=646 : r=128
20 print "{clear}"
30 c = c+1: if c>15 then c=0
35 forw=1to15:waitv,r:nextw
40 poke b,c : poke p, peek (b)
50 poke t, c
60 print " poke all the colors ";
70 goto 30

Mixing inline assembly with BASIC was quite powerful.

13

u/BritOverThere May 03 '24

Commodore 64? With it's lack of any commands to use the hardware and so you have to remember the I/O locations and use POKE a lot.

2

u/OldschoolSysadmin May 03 '24

Could have been Apple II also - iirc that was needed to do graphics in BASIC.

4

u/BritOverThere May 04 '24

Both integer and apple soft basic had commands for graphic mode section, colour, plot, drawing horizontal and vertical lines and pixel color testing.

1

u/mycall May 04 '24

All of the BASIC interrupters had PEEK/POKE. Compute! magazine was filled with it.

→ More replies (1)

2

u/[deleted] May 04 '24

10 DIM D% 200 20 FOR A=0 TO 2 STEP 2 30 P%=D% 40 [OPT A 50 .start 60 LDX #0 70 .loop 80 LDA msg,X 90 BEQ end 100 JSR &FFEE 110 INX 120 BNE loop 130 .end 140 RTS 150 .msg 160 EQUS "Hello, world!"+CHR$(13)+CHR$(10) 170 BRK 180 ] 190 NEXT 200 CALL start

1

u/[deleted] May 04 '24

I did not even know that was possible. I also don't recall whether the manual I used showed that, in the 1980s.

1

u/[deleted] May 04 '24

BBC Basic: Pathetic

1

u/mycall May 04 '24

C64, Atari800, TRS80.. all did peek/poke

5

u/Parkyguy May 04 '24

I miss GOTO

7

u/reddit_user13 May 04 '24

GOTO is cool as long as the language supports COMEFROM.

5

u/Robot_Graffiti May 04 '24

You can still do it if you're not a coward lol

Not at work though unless you want to start an argument

2

u/Manueljlin May 04 '24

they'll jmp out the window

1

u/apadin1 May 04 '24

I once used a goto in a C program in college (mostly as a joke) and my professor was both impressed and horrified

1

u/johndcochran May 06 '24

If you want to really impress and horrify someone, use Duff's device.

5

u/Zardotab May 04 '24 edited May 04 '24

🖥️💥 Me too, except I put "WILL EXPLODE DUE TO OVERHEATING!". The sales people would freak out as I watched from a distance. Aaah the memories.

I loved the instant gratification, and no need to learn a different editor on each brand. Typing line numbers was sufficient to add, change, and delete code.

2

u/itsbett May 03 '24

I loved doing stuff like this using TI-BASIC on my friends' calculators. They thought I was a wizard lmao