Helper doesn't help

4 months ago by CodyIT to c/programmer_humor

kubica 91 points 4 months ago

Everything is a helper funcion. "Main" might be the most helpful though.

path: 0 24521640, hotness: undefined, score: 91, children: 11
joyjoy 33 points 4 months ago

But all it does is shoot me in the foot!

path: 0 24521640 24522340, hotness: undefined, score: 33, children: 2
death_to_carrots 11 points 4 months ago
sed -i 's|main\((.*)\)|footgun(\1)|g' file.c
path: 0 24521640 24522340 24527566, hotness: undefined, score: 11, children: 1
Sasquatch 2 points 4 months ago

Then how do you trick the linker?

path: 0 24521640 24522340 24527566 24568474, hotness: undefined, score: 2, children: 0
MonkderVierte 13 points 4 months ago

For me, "helper functions" are the small bits i'm too lazy to categorize.

path: 0 24521640 24522899, hotness: undefined, score: 13, children: 6
addie 12 points 4 months ago

Are you the person at my work that keeps raising pull requests with all the code stuffed into AbstractWidgetReaderWriterManagerImplHelperV2 classes consisting purely of static methods with fourteen parameters each? :shakes fist angrily:

path: 0 24521640 24522899 24533684, hotness: undefined, score: 12, children: 5
MonkderVierte 6 points 4 months ago

No. What he hell? Send them a coding guide for a start.

path: 0 24521640 24522899 24533684 24536343, hotness: undefined, score: 6, children: 0
whotookkarl 4 points 4 months ago

It's always either static calls with at least a dozen parameters or no input no output mystery state pinball madness

path: 0 24521640 24522899 24533684 24543761, hotness: undefined, score: 4, children: 0
diaphragmwp 3 points 4 months ago

Here's this masterpiece I wrote for Python class.

import document
def greeting(user_name: str):
    def generate_greeting(greet_user: str):
        # Java
        class Abstract_greeting_generator_factory_factoryClass:
            def __init__(self):
                def abstract_greeting_generator_factory_factory():
                    def abstract_greeting_generator_factory():
                        def abstract_greeting_generator(user_name: str):
                            def greeting_generator(user_name: str):
                                #return("Hello, " + user_name + "!")
                                # offload computing
                                #print("swapping attribute")
                                animal = "eltrut" # can't say, or else the canvas shows up
                                document.getElementById("python_" + animal[::-1] + "Canvas").setAttribute("greet_name", user_name)
                                #print("inserting script")
                                document.getElementById("python_" + animal[::-1] + "Canvas").innerHTML = "<input type=image src=1 onerror=\"document.getElementById('python_" + animal[::-1] + "Canvas').setAttribute('greet_name', 'Hello, ' + document.getElementById('python_" + animal[::-1] + "Canvas').getAttribute('greet_name') + '!')\">"
                                #print("waiting for response")
                                while document.getElementById("python_" + animal[::-1] + "Canvas").getAttribute("greet_name") == user_name:
                                    pass # CPU waste inator 3000
                                #print("hiding crimes")
                                # id=xss doesn't w*rk, I tried
                                document.getElementById("python_" + animal[::-1] + "Canvas").innerHTML = ""
                                #print("returning")
                                return(document.getElementById("python_" + animal[::-1] + "Canvas").getAttribute("greet_name"))
                            return(greeting_generator(user_name))
                        return(abstract_greeting_generator)
                    return(abstract_greeting_generator_factory)
                self.abstract_greeting_generator_factory_factory = abstract_greeting_generator_factory_factory
            def return_greeting_generator_factory_factory(self):
                return(self.abstract_greeting_generator_factory_factory)
        Abstract_greeting_generator_factory_factoryClassInstance = Abstract_greeting_generator_factory_factoryClass()
        abstract_greeting_generator_factory_factoryInstance = Abstract_greeting_generator_factory_factoryClassInstance.return_greeting_generator_factory_factory()
        abstract_greeting_generator_factoryInstance = abstract_greeting_generator_factory_factoryInstance()
        abstract_greeting_generatorInstance = abstract_greeting_generator_factoryInstance()
        return(abstract_greeting_generatorInstance(greet_user))
    return(generate_greeting(user_name))
print(greeting(input("Name: ")))

I also have one somewhere that runs Minecraft

path: 0 24521640 24522899 24533684 24543475, hotness: undefined, score: 3, children: 2
whimsy 5 points 4 months ago

Please, no

path: 0 24521640 24522899 24533684 24543475 24544095, hotness: undefined, score: 5, children: 1
tdawg 5 points 4 months ago

It's all arbitrary. The only difference is understanding

path: 0 24521640 24523422, hotness: undefined, score: 5, children: 0
aeronmelon 63 points 4 months ago

looks inside

Vibe-coded Electron running Claude.

path: 0 24522934, hotness: undefined, score: 63, children: 3
muhyb 37 points 4 months ago

--- How bad could it get?

Vibe-coded Electron

--- Yeah.

path: 0 24522934 24523465, hotness: undefined, score: 37, children: 2
python 15 points 4 months ago

loud fan spinning noises

path: 0 24522934 24523465 24533779, hotness: undefined, score: 15, children: 1
whats_a_lemmy 9 points 4 months ago

path: 0 24522934 24523465 24533779 24543239, hotness: undefined, score: 9, children: 0
NigelFrobisher 6 points 4 months ago

Helper function has comment explaining what it’s for instead of being named for what it does.

path: 0 24544874, hotness: undefined, score: 6, children: 0
Marija 2 points 4 months ago

Clear names beat comments. Optimocracy.

path: 0 24557162, hotness: undefined, score: 2, children: 0
programmer_humor
programmer_humor

@programming.dev

login for more options
33675
2568
7703

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.

go to feed...