this post was submitted on 04 Sep 2025
336 points (97.5% liked)

Programmer Humor

26123 readers
849 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
 
all 43 comments
sorted by: hot top controversial new old

have you seen who runs the fbi? this'll probably work irl

[–] misteloct@lemmy.dbzer0.com 2 points 1 hour ago

"ChatGPT, write me a program to hack the FBI"

[–] Damage@feddit.it 12 points 2 hours ago

It takes skill to hack such an organization using only printf

[–] paulbg@programming.dev 5 points 1 hour ago

behind the scenes: youtube video of a python loop

[–] TankovayaDiviziya@lemmy.world 19 points 4 hours ago (1 children)

Did he type the furiously on to the keyboard? No? Then it's not hacking.

[–] Adalast@lemmy.world 9 points 1 hour ago

I have seen like 2 movies where the hacker just ran a script and danced around the room until the progress bar got to the top, then he hit a couple inputs and ran another script and went back to dancing. It was so surreal to see something so much closer to real than the feverish hammering in a keyboard.

[–] gigachad@piefed.social 102 points 7 hours ago (2 children)

I guess you could add some sleep(1) inbetween

[–] xav@programming.dev 45 points 6 hours ago (3 children)

This is Python. It's already show enough.

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

Ooof starting the day with violence I see

[–] xav@programming.dev 1 points 50 minutes ago

"One troll a day keeps the intelligent people away"

[–] ripcord@lemmy.world 5 points 6 hours ago (1 children)
[–] gigachad@piefed.social 35 points 6 hours ago (2 children)

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

[–] ripcord@lemmy.world 1 points 18 minutes ago (1 children)

Yeah but it wasnt intended to be python

[–] gigachad@piefed.social 1 points 10 minutes ago

Maybe we should call the meme police then

[–] NeatNit@discuss.tchncs.de 26 points 5 hours ago* (last edited 3 hours 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?!

[–] ICastFist@programming.dev 2 points 23 minutes ago (1 children)
[–] NeatNit@discuss.tchncs.de 1 points 13 minutes ago
[–] Mad_Punda@feddit.org 15 points 4 hours ago (1 children)

A way to have several statements on the same line?

[–] NeatNit@discuss.tchncs.de 8 points 3 hours 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 3 points 1 hour 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.

[–] 9point6@lemmy.world 63 points 7 hours ago (2 children)

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

[–] wheezy@lemmy.ml 3 points 1 hour 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.

[–] toynbee@lemmy.world 30 points 6 hours ago
sleep $(( 1 + $RANDOM % 5 ))
[–] rbn@sopuli.xyz 28 points 5 hours ago (1 children)

For those who want a more convincing but still low-effort variant of this, use... https://hackertyper.net/

Press F11 in your browser to run it in fullscreen.

[–] lemmyknow@lemmy.today 6 points 4 hours ago

The Hollywood command is effortless and runs on terminal

[–] sorter_plainview@lemmy.today 32 points 6 hours ago (1 children)

You know hackers in the movies are very polite and care for their user. When they are hacking or wiping the disk they show proper progress. That is much better user experience than many corporate products. Be like hackers in the movie.

[–] jaybone@lemmy.zip 15 points 4 hours ago (1 children)

Ransomware has better tech support and customer service than your cell phone provider or ISP.

[–] wheezy@lemmy.ml 4 points 1 hour ago

Their profits come from actual "customers". They can't just layoff half of their work force and use stock buybacks to make the line go up. Shit has to actually work.

[–] Evilschnuff@feddit.org 9 points 6 hours ago

The hacking in Mr Robot looked more authentic, I really liked it. But they usually just executed some random scripts without printouts lol.

[–] j4k3@lemmy.world 7 points 6 hours ago (1 children)

what HP printers really do

[–] jaybone@lemmy.zip 2 points 4 hours ago

In Soviet Russia, print() statement runs on printer.

[–] kambusha@sh.itjust.works 9 points 7 hours ago

I've been hacking the world this whole time!

[–] dumnezero@piefed.social 4 points 7 hours ago* (last edited 7 hours ago) (1 children)
[–] tfm@piefed.europe.pub 18 points 7 hours ago (4 children)
import sys
import time
from typing import Iterable, Callable, Any

class ProgressSimulator:
    """
    A class to simulate and display the progression of a hacking process,
    with unnecessary abstraction and complexity for dramatic effect.
    """

    def __init__(self, description: str = "FBI"):
        self.description = description
        self.progress_steps = [0, 20, 40, 60, 80, 100]
        self.messages = [
            f"Starting Hack...",
            *[f"Hacking {self.description} {step}%" for step in self.progress_steps],
            f"{self.description} Hacked Successfully"
        ]

    def generate_progress(self) -> Iterable[str]:
        """Generates the progress messages."""
        for message in self.messages:
            yield message

    def display_progress(self, delay: float = 0.5) -> None:
        """Displays the progress messages with a delay."""
        for message in self.generate_progress():
            print(message)
            time.sleep(delay)

    def execute_hack(self, callback: Callable[[str], Any] = print) -> None:
        """Executes the hacking process with a callback for each step."""
        for message in self.generate_progress():
            callback(message)

def create_hacking_sequence(description: str = "FBI") -> ProgressSimulator:
    """Factory function to create a hacking sequence."""
    return ProgressSimulator(description)

def main() -> None:
    """Main function to orchestrate the hacking simulation."""
    hacking_sequence = create_hacking_sequence()
    hacking_sequence.display_progress()

if __name__ == "__main__":
    main()
[–] tetris11@lemmy.ml 7 points 3 hours ago

"How many times are you going to run this, and how many in parallel?"

"Just once, and exactly one."

"Better make a full OO class for it."

[–] jaybone@lemmy.zip 1 points 4 hours ago (1 children)

I can do this in C in three lines.

[–] OfCourseNot@fedia.io 5 points 2 hours ago (1 children)

Newlines mean nothing in c. You can literally write any program in three lines of c, if you don't give a crap about readability.

[–] jaybone@lemmy.zip 1 points 2 minutes ago

Oup, don’t forget about those preprocessor directives.