# ../test # go run run.go -- typeswitch2.go errorcheck typeswitch2.go : typeswitch2.go:43: missing error "declared and not used" # go run run.go -- fixedbugs/bug373.go errorcheck fixedbugs/bug373.go : compilation succeeded unexpectedly
You will now be able to program in peace.. unless you have to work on a codebase that has goto in it.
Name:
Anonymous2014-05-02 12:15
I wouldn't say goto's have been "dead for years" -- they're useful in rare circumstances, particularly for error handling, and especially in a systems language that lacks exceptions. But, I agree they are often abused by C programmers, and I would say abused by Go source as well:
I'm sure reasonable people will disagree, but I find that statistic (1 goto for every ~1000 lines of code) an order of magnitude too high. I guess it depends on if you look at goto as "just another way of creating a jmp" or "absolute worst-case crutch to be avoided if at all possible." Firmly in the latter camp, myself.
Name:
Anonymous2014-05-02 12:16
GOTO is not bad. Physical computers have GOTO instructions, they don't have IF/THEN/ELSE, SWITCH, WHILE, FOR, etc., those or all a language-level decoration layered on the essential, life-giving GOTO.
Sometimes, when you want to write a program that acts like a computer, for example one that evaluates a state machine, the program that is the "state machine computer" is most naturally expressed with GOTO. There need be no shame for this. It's not a primitive act, or inferior to anything else in the repertoire of the skillful programmer.
Name:
Anonymous2014-05-02 12:17
Thanks gusy for a wonderful explanation and example for using Goto. I dont feel guilty of using it anymore :)
>>12,13 I have thought more carefully about your response since writing >>14. I am one of those people that's able to feel emotions without compromising my core being. Being ``mad'' does not carry the same consequences for me as they might for someone else. I should have chosen my words more carefully, since I haven't been genuinely ``mad'' in many years. However I can respond in a way that may cause one to think that I am angry, sad, anxious, content, or whatever emotion they wish to label their impression of their interaction with me. Perhaps that is what I meant be being mad. I may write a section of text that may give a reader the impression that I am mad. Such a reader is not aware of my emotional being since they have no access to this, only the text that I have consciously written.
However, I am a bit offended by your wish for my earlier death. That's kind of fucked up, especially considering we may have been talking about things for a few years now and we may or may not have been friends of some sort. I am not `mad', however I am `mildly perturbed'.
>>15 Wait, ¿are you actually the l(el)+ shitposter?
Name:
>>112014-05-03 6:43
>>17 No I am not lel-kunt. I'm also not particularly proud of this exchange.
>>10 I appreciate your work as a piece of art floating in the collection here we call /prog/. Does this settle the issue or do you still wish that I die? I'm inferring that what was written in >>11 was the cause of your textual attacks based upon the response pattern. I cannot gather this information from your post content because the post content only contained content that was to have a negative impact upon the wellbeing of the subject, the reader, (me), so that the reader would not feel content upon reading the content. I will further assure you that I feel very content upon reading the content of this thread and I will continue to contend to end the contest of content that contests contrary content in commencing communication catastrophes on caterday, the sabbath, and yesterday too.
>>20,21 I'll have to think about it. I must weigh the cost and benefits of being internet friends against the cost of being textually assaulted in a way that exploits the said internet friendship. We will see. We will see...
>>22 Your words hurt me deep inside, I do not know if I will be able to take this weight on my life so I think it's time for a final ``bye'', I'm going outside of this world by endding my life. I wish all of you the best, I am actually happy because there I will meet people like John McArthry, Dennis Ritchy and Sussman so, bye /prog/, it was nice knowing you
Can't do indirect jumps with switch statements, Timothy. You need indirect jumps to write direct threaded code, the most efficient way of implementing a finite state machine.
Name:
Anonymous2014-05-04 13:00
>>31 Using a general purpose CPU is not the most efficient way to implement a finite state machine.
>>35 What the fuck is he going on about? What is this new ``computer'' math and ``classical'' math? Computers can't do ``classical'' math because they aren't sentient beings which is a requirement for such math. Computers are just souped-up calculators (arithmetic). Plus you need a lot of math to create and do anything with computers that isn't jacking off to OOP.
The presence or absence of syntax for goto is a nice shibboleth for distinguishing practical languages from languages that serve primarily as conversation pieces. Its presence in Rust is reassuring:
Practical, huh? Well my personal scheme implementation found itself highly used (as in almost entirely with the rest being in good ol' C) in a certain experimental military project regarding non-gps methods of guidance and self-tracking. What about your rust or java?
Name:
Anonymous2014-06-21 2:17
>>44 Loop labels are the same as gotos now? This isn't what Dijkstra was talking about.
>>45 Calm down. If you needed loop labels you can easily shart out a macro to do the job with some simple combinator work. Using select/filter/whatever where appropriate is clearer anyway.
They're not completely equivalent. Labeled break/continue provide the kind of structure Dijkstra found lacking with gotos. Which is useful when dealing with people who haven't read the paper.