Arise, Sir Jimmy! England cricket legend Anderson receives knighthood from Princess Anne at Windsor Castle with his proud family alongside him
Drop in the ocean: Just over 1,000 illegal migrant workers deported in a year despite 8,000 arrests
LA Dodgers' fans furious as Harry and Meghan get royal treatment at World Series over local legends
Charlie Kirk's top team set the record straight on 'mysterious' shooting aftermath video
Severe delays on Elizabeth line after ongoing signal failure
TikTok star Ben Bader 'appeared not to be breathing' as heartbreaking details emerge about 'sudden' death at age 25
£50BILLION black hole misery for Reeves: Productivity downgrade blow to Chancellor - and we could ALL pay for it with income tax or VAT increase
Migrant sex offender Hadush Kebatu freed from Essex prison deported to Ethiopia
Migrant sex offender Hadush Kebatu freed from Essex prison deported to Ethiopia
M25 blocked by car fire as severe delays expected - live updates
Trump's crowning moment as South Korea's president gifts him golden crown just days after 'No Kings' protests
Prolific Essex shoplifter who stole £5k of food, alcohol and chocolates jailed
Moment gang posing as officers rob man for his watch before fleeing in fake police car
Lesley Joseph admits best friend Pauline Quirke is 'not okay' as she gives health update on dementia stricken co-star
The worst parts of Essex for rubbish collections where bins often go uncollected
China Pushes Boundaries With Animal Testing to Win Global Biotech Race
Read more of this story at Slashdot.
Subtle signs of King Charles' special bond with Volodymyr Zelensky reveals how monarch is 'standing shoulder to shoulder' with Ukraine in its war against Russia
Disruption is expected until further notice: cable theft causes rail delays
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.