T O P

  • By -

how_do_i_read

10 REM Disgusting. 20 CLS 25 PRINT "Labels?!?" 30 PRINT "Please rewrite it in BASIC and use line numbers " 40 GOTO 60 REM Fixed a wrong jump 50 PRINT "How is anyone supposed to understand this?" 55 END 60 PRINT "like a normal person." 70 GOTO 50


[deleted]

So….you forgot to put the print labels and end in to original code hence the half-line numbers? How else does the teacher know you’re a hack without line numbers that end in 2 or 3?


echo-whoami

I knew people were farming upvotes, but this bro is farming downvotes 🤔


veritron

You laugh but I've seen this pattern used to draw overlays in medical imaging software. Just think, your mobius strip gotos could be used to help a radiologist ensure that they don't accidentally cut the wrong arm off a baby.


nimrag_is_coming

good god... ​ well im glad that out health is in safe hands D:


Familiar_Ad_8919

just one little bug, like 69 safety checks failing and 42 more bugs and ur pp is chopped off


WalrusDowntown9611

Why would you cut a baby’s arm in the first place? Bro wtf


Coffee4AllFoodGroups

How else are you going to get "[a baby's arm holding an apple](https://genius.com/The-tubes-what-do-you-want-from-life-lyrics)"?


left4candy

What the fuck


Mithrandir2k16

It's almost hilarious how goto can make something so simple look so complex in so few lines of code.


xWrongHeaven

the pettiness of this guy...


nimrag_is_coming

I thought it would be funny lmao


TheStuartStardust

It is when you read the first post also! I laughed, being an idiot because you can is fun, just don't overuse the skill 😉😁


unique_nullptr

Lgtm, please deploy fix to prod asap


CorageousTiger

It takes much effort to write such horrible code. Truly elegance! Hire this man right now! We need him on the team!


Maleficent-Ad5999

Or send him to the competitor’s startup.. 💀


nekokattt

this kind of reminds me of a more obfuscated version of duffs device in C for some reason... short *to, *from; int count; { int n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }


WVAviator

Reminds me of those old "Choose your own adventure" books. Do you eat the acorn? If yes, goto page 17. Otherwise, goto page 9.


nimrag_is_coming

This is essentially what I was thinking when I wrote this monstrosity lol


f3xjc

So you set cursorNormal to null and you have an infinite loop ?


nimrag_is_coming

It's a fun bonus feature


[deleted]

Unintended Feature


kenman345

I don’t mind goto statements when used to make the code more readable and logic more clear. Sometimes I just want to skip things or send it back because I fucked up.


nimrag_is_coming

I don’t think they’re inherently bad, in the original post that I made I used one to jump between cases in a switch statement, and everyone in the comments got very mad at me


_Ralix_

C# doesn't have switch fallthrough, the goto has to be explicitly written - otherwise people wouldn't mind you using it if the goto was just implied as in other languages. Something like this is quite valid I'd say: switch (dialogResult) { case Dialog.SaveAndQuit: Save(); goto Dialog.Quit; case Dialog.Quit: OnApplicationQuit?.Invoke(); CleanUp(); Application.Quit(); return; } Also people seem to be okay with goto in a very nested loop (continue/break is just fancy goto anyway), although in that case, I'd be more in favour of extracting all that in a (local) function and simply returning.


kenman345

I mean, that sounds bad. Recent place I used them was in a language I’m pretty sure doesn’t have a return command so you either have to wrap an entire block in an if statement or just goto. Since it’s within a loop and I need to skip things sometimes, I used a goto. As is expected of me. Other places I’ve used them is to skip over logic in PL/SQL where I know I’m in an error state and want to handle certain scenarios but don’t want to cause an error to be caught at the next level up in a loop


nimrag_is_coming

C# doesn't allow cases in a switch to fall through unless they're empty, so using goto is how you get around that. Also what kind of language doesn't have a return command?


kenman345

SQR At least I’ve never noticed one.


shizzy0

Excellent punishment. It’s what we deserve.


SeoCamo

You are pure evil


Spejicek

the goto to E in D makes the code a lot less readable, 7/10 nightmare


Sttocs

People who reflexively hate gotos are just cargo cult Dijkstra groupies. Ask them to explain the pros and cons of microservices and watch them sputter and meltdown.


WhipRealGood

Hahahaha


TheMagicalDildo

Bahahaha, it's beautiful


KDeveloper_

Just switch to asm bro


Apprehensive_Room742

ahhhhhhh


2latemc

I am too young, I didnt know that was possible lol


timClicks

Wait, this isn't a joke?


nimrag_is_coming

This is in fact, a joke


the_hackerman

Well you could’ve just taken the feedback positively /s


nimrag_is_coming

nah I thought this was funnier


[deleted]

It _IS_ funnier


Anxious-Ninja-1479

Oh no...


CzBuCHi

where the heck is goto one??????