Disruption is expected until further notice: cable theft causes rail delays
CodeSOD: A Basic Mistake
Way back in 1964, people were starting to recgonize that computers were going to have a large impact on the world. There was not, at the time, very much prepackaged software, which meant if you were going to use a computer to do work, you were likely going to have to write your own programs. The tools to do that weren't friendly to non-mathematicians.
Thus, in 1964, was BASIC created, a language derived from experiments with languages like DOPE (The Dartmouth Oversimplified Programming Experiment). The goal was to be something easy, something that anyone could use.
In 1977, the TRS-80, the Commodore PET, and the Apple II all launched, putting BASIC into the hands of end users. But it's important to note that BASIC had already been seeing wide use for a decade on "big iron" systems, or more hobbyist systems, like the Altair 8800.
Today's submitter, Coyne, was but a humble student in 1977, and despite studying at a decent university, brand spanking new computers were a bit out of reach. Coyne was working with professors to write code to support papers, and using some dialect of BASIC on some minicomputer.
One of Coyne's peers had written a pile of code, and one simple segment didn't work. As it was just a loop to print out a series of numbers, it seemed like it should work, and work quite easily. But the programmer writing it couldn't get it to work. They passed it around to other folks in the department, and those folks also couldn't get it to work. What could possibly be wrong with this code?
3010 O = 45 3020 FOR K = 1 TO O 3030 PRINT K 3040 NEXT KNow, it's worth noting, this particular dialect of BASIC didn't support long variable names- you could use a single letter, or you could use a letter and a number, and that was it. So the short variable names are not explicitly a problem here- that's just the stone tools which were available to programmers at the time.
For days, people kept staring at this block, trying to figure out what was wrong. Finally, Coyne took a glance, and in a moment was able to spot the problem.
I've done something nasty here, because I posted the correct block first. What the programmer had actually written was this:
3010 O = 45 3020 FOR K = 1 TO 0 3030 PRINT K 3040 NEXT KThe difference is subtle, especially when you're staring at a blurry CRT late at night in the computer lab, with too little coffee and too much overhead lighting. I don't know what device they were using for display; most terminals made sure to make O look different from 0, but I couldn't be bold enough to say all of them did. And, in this era, you'd frequently review code on printed paper, so who knows how it was getting printed out?
But that, in the end, was the problem- the programmer accidentally typed a zero where they meant the letter "O". And that one typo was enough to send an entire computer science department spinning for days when no one could figure it out.
In any case, it's interesting to see how an "easy" to use language once restricted variable names to such deep inscrutability.
Amazon Web Services’ US-EAST-1 region in trouble again, with EC2 and container services impacted
UPDATED Amazon Web Services’ US-EAST-1 region, which last week caused massive disruption to online services, is having another bad day as internal dependencies again prove problematic.…
How 'strange, slow' Hurricane Melissa became such a monster
Starlink tells the world it has over 150 sextillion IPv6 addresses
Internetworking wonks have investigated Starlink’s use of IP addresses and found some interesting facts.…
Australian police building AI to translate emoji used by ‘crimefluencers’
Australia’s Federal Police (AFP) is working on an AI to interpret emojis and the slang used online by Generation Z and Generation Alpha, so it can understand them when they discuss crime online.…
Braintree shopping centre celebrates Halloween and half-term adventure trail
Waitrose set to open new store in Essex in former Carpetright
Epping migrant sex offender was released from jail deliberately by rogue member of staff to cause 'major political embarrassment', ex-prison governor and criminologist suggests
A mansion tax will shatter the housing market beyond repair... and break the whole economy: KIRSTIE ALLSOPP
Westinghouse Is Claiming a Nuclear Deal Would See $80 Billion of New Reactors
Read more of this story at Slashdot.