this post was submitted on 21 Jun 2024
37 points (100.0% liked)

Programmer Humor

18971 readers
1035 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 29 comments
sorted by: hot top controversial new old
[–] Sonotsugipaa@lemmy.dbzer0.com 6 points 2 months ago

Wh... what do you mean, "originally as a joke"?

[–] mossy_@lemmy.world 6 points 2 months ago (3 children)

Guy who worked at my place before me kept using these and GOTO statements all over the place.

His name? Cotton-eyed Joe

[–] lseif@sopuli.xyz 3 points 2 months ago (1 children)

where did you COMEFROM where did you GO.....TO

[–] match@pawb.social 3 points 2 months ago* (last edited 2 months ago)

where did you COMEFROM, cottonEyedJoe2

[–] match@pawb.social 2 points 2 months ago (1 children)

Reference to Cottoneyed Joe considered harmful

[–] mossy_@lemmy.world 1 points 2 months ago

I almost spat out my drink when I saw this

[–] hakunawazo@lemmy.world 1 points 2 months ago* (last edited 2 months ago)

Thanks for the catchy tune, now the song sticks in my mind again. Last time was long time ago. :)

[–] pro3757@programming.dev 4 points 2 months ago (1 children)

It's in Intercal, a joke language from '70s. Mark Rendle describes it here in his talk at NDC. This whole talk is ridiculous btw.

[–] frezik@midwest.social 12 points 2 months ago (2 children)

This is the same language where you have to say PLEASE sometimes or it won't compile. But if you say PLEASE too much, the compiler will think you're pandering and also refuse to compile. The range between too polite and not polite enough is not specified and varies by implementation.

[–] c0smokram3r@midwest.social 4 points 2 months ago

This is hilarious!

[–] Whelks_chance@lemmy.world 4 points 2 months ago

I love how arbitrary, cultural and opinionated that must be to work with. You'd learn something about the implimenter of the compiler by using it for a while.

[–] s12@sopuli.xyz 3 points 2 months ago

PLEASE COMEFROM 🏷

[–] neo@lemy.lol 3 points 2 months ago

COMEFROM is my go to function;

[–] lseif@sopuli.xyz 3 points 2 months ago

more practical than goto

[–] starman@programming.dev 1 points 2 months ago

Looks like C# 12 interceptors:

[InterceptsLocation(@"C:\testapp\Program.cs", line: 4, column: 5)]

I know it looks awful, but it's not intended for direct use, but rather for source generators for native ahead of time compilation.

https://andrewlock.net/exploring-the-dotnet-8-preview-changing-method-calls-with-interceptors/

[–] schnurrito@discuss.tchncs.de 1 points 2 months ago (5 children)

TBH I fail to see the significant difference between this and a function declaration.

[–] sxan@midwest.social 2 points 2 months ago (1 children)

Doesn't it steal control flow? More like a break point, except you define where execution continues.

I wonder if it's a compile error to have multiple conflicting COMEFROM statements, or if it's random, kind of like Go's select statement.

How awesome would it be to be able to steal the execution stack from arbitrary code; how much more awesome if it was indeterminate which of multiple conflicting COMEFROM frames received control! And if it included a state closure from the stolen frame?

Now I want this.

[–] davidgro@lemmy.world 1 points 2 months ago

I wonder if it's a compile error to have multiple conflicting COMEFROM statements

I think there's at least one INTERCAL implementation where that's how you start multi-threading

[–] sudo@programming.dev 1 points 2 months ago

Its like if subroutine bar could say its going to execute at line N of routine foo. But if you were just reading foo then you'd have no clue that it would happen.

You can simulate this effect with bad inheritance patterns.

[–] polonius-rex@kbin.run 1 points 2 months ago

it's semantic

at the end of the day everything boils down to sequence and branchifs

[–] palordrolap@kbin.run 1 points 2 months ago

I'd say it's more like setting up a handler for a callback, signal, interrupt or something along those lines.

Function declarations by themselves don't usually do that. Something else has to tell the system to run that function whenever the correct state occurs.

That doesn't account for unconditional come-froms.¸but I expect there'd have to be a label at the end of some code somewhere that would give a hint about shenanigans yet to occur. Frankly that'd be worse than a goto, but then, we knew that already.

[–] magic_lobster_party@kbin.run 1 points 2 months ago
print(A)
print(B)
hello: print(C)
print(D)
print(E)
comefrom hello
print(F)

This will print A, B, C and then F. D and E will be skipped because of the comefrom.

[–] RiikkaTheIcePrincess@pawb.social 1 points 2 months ago

Aaahhh, this is horrifying! You've ruined my breakfast 🙀

[–] MajinBlayze@lemmy.world 1 points 2 months ago (1 children)
[–] polonius-rex@kbin.run 1 points 2 months ago

shut your mouth

[–] rand_alpha19@moist.catsweat.com 1 points 2 months ago

That sounds like a fucking nightmare. I had to troubleshoot poorly-written-yet-somehow-functional GOTOs a lot when I was a BAS technician and that's annoying enough.

[–] umbrella@lemmy.ml 0 points 2 months ago (1 children)

am i the only dumb fuck here who unironically likes this?

would make goto type situations much more usable

[–] Cethin@lemmy.zip 4 points 2 months ago

I don't see any case where this is better than a goto. A goto you can read progressively though. A comefrom you'd see written then have to track to that piece of code and remember there's a potential hidden branch there.

[–] onlinepersona@programming.dev -2 points 2 months ago

I honestly thought C++ (aka dumping ground of programming concepts) would implement this for "completeness".

Anti Commercial-AI license