←back to thread

276 points chei0aiV | 1 comments | | HN request time: 0.227s | source
Show context
n0us ◴[] No.10458463[source]
I really could do without "considered harmful" titles. x86 has been one of the most influential technologies of all time and a clickbait title doesn't do it justice imo.
replies(7): >>10458515 #>>10458617 #>>10458692 #>>10458787 #>>10458861 #>>10459018 #>>10459478 #
wyager ◴[] No.10458692[source]
So were PHP and goto statements.

How influential something is has nothing to do with how good it is.

replies(2): >>10458720 #>>10459089 #
vezzy-fnord ◴[] No.10458720[source]
goto is just a mnemonic for jmp. It's the primitive from which all higher level control flow is ultimately derived. It isn't harmful, and it's used a lot even in C.
replies(4): >>10458822 #>>10459151 #>>10459176 #>>10459619 #
1. Retra ◴[] No.10459619[source]
It's a matter of scale. If you're trying to compute absurdly large numbers, you'd be a fool to use addition, even if it is fundamental to some other operation you want to use. Goto is problematic not because it can't be used effectively, but because it won't be. Because it doesn't encapsulate a powerful enough abstraction to make computers smarter or programs easier to write and understand.

If you have to write a goto, you can drop into assembly. Don't add it to your high-level language, because it doesn't add anything there, it just gets in the way.

"It's the primitive from which all higher level control flow is ultimately derived."

There are a billion alternative primitives from which you could derive all the same things. Goto is not special. And it is so primitive, it is not hard to write something else and have a compiler translate it. You shouldn't need goto anymore than you should need access to registers.