this post was submitted on 04 Sep 2025
630 points (97.4% liked)

Programmer Humor

26373 readers
1501 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] gigachad@piefed.social 165 points 1 week ago (2 children)

I guess you could add some sleep(1) inbetween

[–] 9point6@lemmy.world 92 points 1 week ago (2 children)

Needs to be a sleep(3) and sleep(5) between the last ones just to add suspense

[–] toynbee@lemmy.world 41 points 1 week ago (1 children)
[–] idunnololz@lemmy.world 5 points 1 week ago

No it has to be controlled suspense.

[–] wheezy@lemmy.ml 10 points 1 week ago

Needs a 99% print too just before the 5 second sleep. Followed by a 99.9% and another 2 second sleep. Never print 100 and just run a traceroute in a loop.

Followed by a "we're in" from the hacker as we're made to believe he's reading the console spam like he's Neo from the matrix as he types faster and faster into an unresponsive terminal window.

[–] xav@programming.dev 78 points 1 week ago (3 children)

This is Python. It's already show enough.

[–] StarvingMartist@sh.itjust.works 21 points 1 week ago (1 children)

Ooof starting the day with violence I see

[–] xav@programming.dev 11 points 1 week ago

"One troll a day keeps the intelligent people away"

[–] ripcord@lemmy.world 9 points 1 week ago (1 children)
[–] gigachad@piefed.social 46 points 1 week ago (2 children)

It's valid Python code though, the semicolons will run but are unnecessary

[–] NeatNit@discuss.tchncs.de 36 points 1 week ago* (last edited 1 week ago) (2 children)

demo of semicolons being allowed in Python

I am so perplexed and horrified. I'm going to need several weeks to get over this. What is this?!

[–] Mad_Punda@feddit.org 21 points 1 week ago (1 children)

A way to have several statements on the same line?

[–] NeatNit@discuss.tchncs.de 11 points 1 week ago (1 children)

It seems I had semicolons confused with braces:

if picture is broken, it's this:

~ $ python -c "from __future__ import braces"
  File "<string>", line 1
SyntaxError: not a chance
[–] palordrolap@fedia.io 8 points 1 week ago

Guido undoubtedly had a strong, strong hatred of the number of ways braces are overloaded in Perl.

Do you really want an example?

sub doHref { { do { ${someglobal{Href}} = {} }; last }; }

Every single pairing there serves a different syntactic purpose. Some are related purposes, and I've crowbarred a few in unnecessarily for the sake of an example, but different nonetheless.

The outer pair declares the sub, and the next pair is a free block that works as a once-through unlabelled loop, which is exited with the last. (Most other languages use break for this purpose.)

The next pair are for the do which doesn't act as a loop like the free block does. The next innermost pairing wrap a variable and the inner, innermost pairing indicate that the variable is a member of a hash (associative array) and we're accessing the record named Href.

The lone {} indicates a hash reference, so we're assigning a reference to an empty, anonymous hash to that hash record.

This example is ridiculous of course. There's no need for most of those braces and syntax to do what it actually does. Also assigning to global variables is generally frowned upon.

sub doHref { $someglobal{Href} = {} }

... is equivalent and cuts out most of the guff. Still three different uses though.

[–] ICastFist@programming.dev 4 points 1 week ago (1 children)
[–] ripcord@lemmy.world 2 points 1 week ago (1 children)

Yeah but it wasnt intended to be python

[–] gigachad@piefed.social 6 points 1 week ago (1 children)

Maybe we should call the meme police then