Most active commenters
  • vezzy-fnord(5)

←back to thread

276 points chei0aiV | 15 comments | | HN request time: 1.501s | source | bottom
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 #
1. 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 #
2. duskwuff ◴[] No.10458822[source]
You're missing the reference - Dijkstra wrote a famous letter on GOTO in 1968 which was published as "Go To Statement Considered Harmful":

https://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF

In context, it was a piece advocating against the use of GOTO to the exclusion of all other control structures (e.g, 'for' or 'while' loops, etc).

replies(1): >>10458914 #
3. vezzy-fnord ◴[] No.10458914[source]
I appreciate you thinking I'm a buffoon who was born yesterday and hasn't heard of EWD215, but it appears your reading comprehension is, to be charitable, iffy.

wyager's statement, involving PHP (for which there is not a famous "considered harmful" essay to the best of my knowledge, though there is "A Fractal of Bad Design") and goto statements, was a rather clear implication that both constructs are innately harmful in an attempt to counter n0us' assertion that influential/popular technologies imply a high quality. There was nothing said about using goto statements in presence of structured programming, but merely goto as an intrinsic badness. This is a common belief cargo culted by a many naive commentators and XKCD readers who do not realize that all control flow is derived from goto, and moreover that even in some languages with structured control flow it is still useful, e.g. for resource cleanup and breaking out of nested loops.

replies(2): >>10458994 #>>10459406 #
4. garrettgrimsley ◴[] No.10458994{3}[source]
>Be civil. Don't say things you wouldn't say in a face-to-face conversation. Avoid gratuitous negativity.

https://news.ycombinator.com/newsguidelines.html

replies(2): >>10459051 #>>10462951 #
5. vezzy-fnord ◴[] No.10459051{4}[source]
My statement was neither something I wouldn't say face-to-face, nor gratuitously negative.
replies(1): >>10459516 #
6. mortehu ◴[] No.10459151[source]
> [goto] is the primitive from which all higher level control flow is ultimately derived

I'm pretty sure you cannot implement conditional branches using unconditional branches as a building block. Unless you count indirect branches, which goto usually doesn't support.

replies(1): >>10459382 #
7. ska ◴[] No.10459176[source]
That largely misses (Dijkstra's, originally) point. How control flow is implemented at a low level (e.g. jmp/lngjmp) is a completely separable from how it should be exposed in a language.

Wearing a c programmers' hat you may say "absolutely", a scheme programmers' hat, perhaps "no way". Horses for courses after all.

replies(1): >>10459238 #
8. vezzy-fnord ◴[] No.10459238[source]
That's a more nuanced position than the one that is commonly understood, however. Though, you are always bound to your architectural model, so exploiting it more directly is not innately bad. Layers tend to be leaky.

Wearing a Scheme programmers' hat, call/cc isn't any less of a landmine.

9. taeric ◴[] No.10459382[source]
Not that I'd recommend it, but sure you can. Just allow modification of the code to include where you want to jump to. :)

Scarily enough, I think this used to actually be somewhat common place and is why many functions were not reentrant.

10. hyperpape ◴[] No.10459406{3}[source]
Isn't that more aptly stated as "implemented with" not "derived from"?
replies(1): >>10459469 #
11. vezzy-fnord ◴[] No.10459469{4}[source]
Assuming a von Neumann or modified Harvard architecture where execution advances from an incremented program counter, I'd say derived from, though it may be that the former is more appropriate. It is certainly not universal, I do not make that claim.
replies(1): >>10459562 #
12. hderms ◴[] No.10459516{5}[source]
It comes off as unpalatable, to say the least. You were assuming malice in the other poster and then went on a minor tirade without sufficient prompting.
13. hyperpape ◴[] No.10459562{5}[source]
The program counter doesn't typically appear in the programming languages that have (or don't have) goto. You're talking about implementation, but I think people typically criticize goto in terms of semantics (iirc, I can include Djikstra in that camp, but I never made a super-careful study of that paper).
14. 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.

15. asveikau ◴[] No.10462951{4}[source]
The comment being replied to was also rather uncivil by a certain definition, assuming the commenter was unfamiliar with what is by now very cliched literature and explaining it in a somewhat condescending tone, as if to a child, when in truth there was a very substantive point being made.