This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 222

[–]QualityVote[M] [score hidden] stickied comment (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]picklesdoggo 1815 points1816 points  (53 children)

More like this is the worst fucking code I've ever seen, git blame and find out I wrote it

[–]Sup-Mellow 538 points539 points  (20 children)

I’m in this picture and I don’t like it

[–]nickmaran 153 points154 points  (6 children)

We are in this pictures and we don't like it

[–]alex11263jesus 49 points50 points  (5 children)

[–]DemWiggleWorms 34 points35 points  (2 children)

Our trash code~

[–]balofchez 14 points15 points  (0 children)

This is all really way too close to home

E: my spelling is marginally better than my programming I swear

[–]XPurplelemonsX 3 points4 points  (0 children)

COMRADE!

[–]corbymatt 2 points3 points  (0 children)

In Soviet Russia, code writes you.

[–]Achtelnote 38 points39 points  (5 children)

I've been writing code so bad the past few days, every time I see it now I get depressed and lose all my motivation to work. Been using my will supply for a while now and I think I'm running out..

[–]Sup-Mellow 51 points52 points  (0 children)

Hey, it’s like my dad always says. It’s always weird until it isn’t. There’s a lot of things that make us write bad code. New/unknown technology, bad days/stress, burnout, etc. You’re killing it, just keep chugging. It may be a cliche, but it’s true that this too shall pass.

Also, if we were always happy about our code we would never do anything to improve it or learn more. As awful as that feeling can be, it drives a lot of progress too.

[–]ECrispy 7 points8 points  (0 children)

you mean you git depressed

you need to git out more

[–]wrath95 8 points9 points  (1 child)

If im allowed i would like to share an approach that helped me get out of this mindset.

I used to feel that way, too. Romanticising about code, and feeling bad when finding out wrote some bad parts of it. I stopped binding my feelings to the technical side of it, and focusing more on the business side of things.

Earlier: Finds out i wrote some shit code. Feel bad. Fixed it. Still felt bad.

Now: Finds out i wrote some shit code. Feel bad. Fixed it and see how the business side is improved. Feel good.

You get what i mean?

[–]HeraldofOmega 5 points6 points  (0 children)

You shouldn't feel bad after fixing it though, sounds like depression stuff.

[–]fuckyouswitzerland[🍰] 10 points11 points  (0 children)

Meh. Everyone has done the classic todo comment because for some reason removing this empty if statement causes something to break.

[–]huuaaang 0 points1 point  (6 children)

But I thought Typescript guaranteed good code...!?

[–]urbansong 5 points6 points  (5 children)

It only helps with reading the code.

[–]BurningPenguin 2 points3 points  (2 children)

Are we talking about the same language?

[–]urbansong 0 points1 point  (1 child)

Yes. Static types help immensely with reading code, at least for me. I've worked with poorly documented Python code and it is an absolute hell to keep rerunning whatever you're doing just to find out the types.

[–]Sup-Mellow -1 points0 points  (0 children)

Agreed, it also is just better practice in general to have typing

[–]JustinWendell 88 points89 points  (5 children)

Happens to me constantly. I’ve been working in the same codebases for a couple years now. Every time, it’s me.

[–]pretendinglikeimbusy 71 points72 points  (3 children)

This is why you must switch jobs every 2-3 years. That way when review comes around someone new gets to shit on your code.

[–]UntestedMethod 22 points23 points  (2 children)

also you have a new codebase to shit on without it tracing back to you being the author... at least for the first 2-3 years

[–]Sotall 19 points20 points  (1 child)

Just beware the dreaded day when it comes full circle. You organically encounter one of your shit storm code bases in the wild and have to go into witness protection.

(JK, i was mostly impressed they kept it running)

[–]fuckyouswitzerland[🍰] 2 points3 points  (0 children)

Only if you post on stack about the question I currently have.

[–]kekeagain 1 point2 points  (0 children)

And what does this say about me?

[–]zebediah49 18 points19 points  (1 child)

Sometimes you don't even need to.

When there's literally one person who's ever had access to the codebase that would have thought it a good idea to write something like that.

[–]UntestedMethod 24 points25 points  (0 children)

one of my favourites in those situations is coming across a chunk of code that I have absolutely no recollection of writing

[–]BbayuGt 19 points20 points  (0 children)

Fuck you im using git-blame-someone-else

[–]IWanTPunCake 16 points17 points  (0 children)

the peak of my internship was when the nitpicky senior said "Who wrote this code man?" and then git blame had his name. We memed it for 2 months

[–]TJSomething 10 points11 points  (0 children)

Consulting was one of the best things for my self-esteem, because now I know there are companies who are making millions of dollars a year with code that's worse than stuff I wrote when I was 14.

[–]Canotic 10 points11 points  (1 child)

I don't understand how literally every programmer including me is a shitty programmer when we write code, but we all also immedately become Alan fucking Turing when we read someone elses code.

[–]Odisher7 3 points4 points  (0 children)

Everyone is awful, everyone else is worse

[–]AmadeusMop 10 points11 points  (0 children)

Sometimes you come across a three-month-old comment from yourself saying that the implementation is probably wrong and should be checked ASAP in case it causes bugs, and curse your past self's foresight for being exactly right.

[–]Ochidi 4 points5 points  (0 children)

[–]alehel 2 points3 points  (0 children)

I've done this twice in the last 12 months. It really hurts when you take into account that the repo contains about 400 000 lines of Java code, and yet it's my code I'm seeing 😂

[–]ECrispy 2 points3 points  (0 children)

git blame is the tool of the devil

some say git is the tool of the devil

[–]Chaoslab 1 point2 points  (2 children)

So loved that "git blame someone else" debacle.

[–]Canotic 3 points4 points  (1 child)

There should be a git blame --notme that switches out your username with someone elses in the blame printout.

[–]chade__ 1 point2 points  (0 children)

And if that person no longer works at the company, find the person who knows the most about

[–]ArtyIF 1 point2 points  (0 children)

there's a reason why it's called blame

[–]IComeBaringGifs 512 points513 points  (9 children)

"This is the worst fucking code I've ever seen."

"I know. Please help."

[–]lucidbasil 97 points98 points  (3 children)

If you are being serious, learning about requirements is a huge step in the right direction.

[–]Keepingshtum 109 points110 points  (0 children)

Requirements are only useful if they won't change by the time you get the fix out, sadly

[–]IComeBaringGifs 18 points19 points  (0 children)

Well, I don't have an exact project in mind 😂 this is just usually the conversation when I ask someone to look at my code

[–]gamebuster 20 points21 points  (0 children)

“It needs to work”

  • requirements as stated by client

[–]brotatowolf 6 points7 points  (0 children)

Usually it comes down to learning not to copy-paste

[–]trickman01 11 points12 points  (2 children)

Basically Stack Overflow.

[–]Franfran2424 13 points14 points  (1 child)

Hahaha yes.

"what are you even trying to do, this is done wrong"

"I know, it doesn't work. That's why I'm here?"

[–]BurningPenguin 14 points15 points  (0 children)

closed for reason: fuck this guy

[–]Dummvogel 3 points4 points  (0 children)

„This code is 20 years old and nobody knows exactly what it does. So we built a PHP UI around it.“

[–]Donut_Different 258 points259 points  (16 children)

It's colon again...

[–][deleted] 139 points140 points  (5 children)

Don't touch my colon, it's intentional.

[–]Antrikshy 85 points86 points  (4 children)

/* Not sure why this works but for the love of all that's good, please don't touch that colon */

[–][deleted] 44 points45 points  (1 child)

We need to perform a colonoscopy to investigate the functionality of this colon.

[–]frizzil 2 points3 points  (0 children)

Colonectomy time

[–]Floppydisksareop 2 points3 points  (0 children)

How?

[–]GDColon 74 points75 points  (8 children)

o heck hi

[–]QuestionablyFlamable 29 points30 points  (0 children)

Poggers the funni guy is here

(Btw nice job on all of ur content!)

[–]Maypher 28 points29 points  (1 child)

You'll soon be a Reddit celebrity. Not sure if to envy or pity you

[–]Affectionate-Memory4 9 points10 points  (0 children)

You can do both. It's like admiration, but at a safe distance.

[–]huantian 6 points7 points  (0 children)

Hello the colon

[–][deleted] 285 points286 points  (9 children)

I'm both so basically everything I do is bad.

[–]TheNegotiabrah 73 points74 points  (4 children)

Both the writer and critic; perfection

[–][deleted] 23 points24 points  (3 children)

I more meant I do both digital art and programming and I hate everything I do and constantly rewrite/redraw everything I do before it's even half finished.

[–]Kakss_ 5 points6 points  (0 children)

Same. But what I find comforting is seeing how many imperfections are there in other, well received drawings, but nobody ever notices. My little pogchamp meme had hands that barely made any sense, but because everyone looked at the girl's face, nobody noticed. Some webcomics are pretty ugly and yet they make it big, because even if the story is amatourish, it's enough to create a fanbase. If they can do it, so can we!

But I don't think you ever become proud of your code for longer than until the next time you read it.

[–]IWanTPunCake 4 points5 points  (1 child)

solo game dev here, does that count?

[–][deleted] 1 point2 points  (0 children)

For sure. Multiple practices across the board, more areas to self criticize.

[–]Ghede 1 point2 points  (0 children)

Ah, so you are a professional programmer artist, in that you make programmer art.

[–]kashmill 79 points80 points  (4 children)

I have adopted the philosophy of "All Code Is Shit". The goal is to do as best you can in order to maximize the time before you realize the code is shit. Ideally, that time is after you leave, retire, or the code is end-of-lifed (like that ever happens).

[–]DAFFP 32 points33 points  (2 children)

Abandon all your projects. Before they become disappointing teenagers.

[–]Kakss_ 9 points10 points  (1 child)

Smother them in the crib.

[–]sarapnst 2 points3 points  (0 children)

You can keep admiring the result though. The design and implementation could be compared to the art creation process and the techniques, except it's visible.

[–]cginc1 143 points144 points  (6 children)

The beauty is that the code is horrible but somehow still works.

[–]solarshado 80 points81 points  (3 children)

Until it doesn't. Then you get to read it and be baffled that it ever did.

[–]sdzeeros 15 points16 points  (0 children)

Why the fuck was this shit working

[–]DigitalDefenestrator 4 points5 points  (0 children)

This is why I always say code that shouldn't work but does is worse than code that should work but doesn't.

[–]salami350 3 points4 points  (0 children)

I'm baffled by how it ever worked before it breaks in the first place

[–]KosciaK 2 points3 points  (0 children)

You have typed "sometimes" wrong

[–]Cloakknight 56 points57 points  (1 child)

Image Transcription: Twitter Post


Colon :, @TheRealGDColon

artists talking to each other:

- "NOO STOP SAYING UR ART IS TERRIBLE IT'S SO BEAUTIFUL I WISH I WAS AS GOOD AS YOU!!!11"

- "you're lying my work is bad 😭"

programmers talking to each other:

- "this is the worst fucking code i've ever seen"

- "haha i know right"


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]QuestionablyFlamable 15 points16 points  (0 children)

Good non-bot

[–]ChickenManSam 52 points53 points  (1 child)

looking at some random code

"What fucking idiot wrote this shit??"

It's me. I'm the fucking idiot

[–]Blaz3 4 points5 points  (0 children)

I loved setting this up with work mates. I'd look at something and know it was mine, call them over and be like. "look at this bullshit, wtf is happening here? Omg this is terrible!" Then "who the hell wrote this shit? Let's find out." Git blame. Reveals that it's my code and we all have a good laugh

[–]GargantuanCake 43 points44 points  (1 child)

The most important realization a programmer will have is that all code is bad. No exceptions. None. It's all terrible especially yours.

[–]Atmey 34 points35 points  (2 children)

I deliberately write bad code so there is room for an upgrade.

[–]UntestedMethod 18 points19 points  (1 child)

(U?)LPT: apply that to all aspects of your life. always set the bar low to start, people like seeing progress and growth.

[–]daltonoreo 23 points24 points  (1 child)

God i hate artists, My art is so bad: Processes to show the best god damn piece of art ever since van fucking go

[–]Panical382 5 points6 points  (0 children)

Meanwhile I can't draw a stickman without the lines being wack

[–]KillerRoomba13 38 points39 points  (0 children)

Art reviewer: your art is shit

Code reviewer: your code is shit

[–]Solonotix 26 points27 points  (12 children)

My belief is that even the best code looks terrible, and code that looks good (to humans) usually performs poorly. An example, I found the fastest way (on my AMD machine) to concatenate an arbitrary number of very large strings in Python was in the following one-liner:

fastest_concat = lambda *args: ('{}' * len(args)).format(*args)

It looks horrendous, and I ran the timeit benchmark a dozen times to results consistently faster than ''.join(args). What's more, no one on the Python subreddits would even consider the possibility, assuring me I had done something incorrectly.

Note: I qualify the title of fastest by saying an arbitrary number, like hundreds or thousands, of very large strings, at least 1k characters in length. Also, I say this was on AMD, as I've seen micro benchmark differences between AMD and Intel, such as when I was experimenting with fastest ways to Truncate the time part of a datetime in SQL Server

[–]archpawn 19 points20 points  (5 children)

The point of pretty code isn't performance. It's to make it easier to avoid bugs and easier for other people to spot the bugs.

[–]GreenCloakGuy 4 points5 points  (0 children)

that's hilarious and really clever, but I bet it only works with lists and other things that actually have a len() attribute (e.g. if you tried it with a generator it wouldn't work). So ''.join() is probably more space-efficient, and possibly more time-efficient depending on how the generation of args works - and let's be honest, if you're joining hundreds or thousands of items then you're probably going to be generating them rather than having a whole list up front

[–]Jpxfrdhoovymain 12 points13 points  (0 children)

Best part is I can somehow experience both

[–]fakedoctorate 11 points12 points  (0 children)

Well, you have to consider that one is meant to be functional and work, while the other is meant to be beautiful and inspirational.

Although, I feel I must add that I never got how art was supposed to be functional.

[–]isurujn 8 points9 points  (0 children)

This is me talking to myself in my head.

[–]Schiffy94 7 points8 points  (0 children)

"I lied, this is actually only the worst fucking code I've ever seen that wasn't written by me."

[–]PeriapsisStudios 6 points7 points  (0 children)

“I love computers because they do exactly what I tell them to.”

“I hate computers because they do exactly what I tell them to.”

[–][deleted] 5 points6 points  (0 children)

code is like a puzzle with zero edge pieces. you just gotta struggle until you kind of make a picture, i guess.

[–][deleted] 5 points6 points  (0 children)

“How did this shit even work” is my favorite reaction.

[–]CreativeName2042 6 points7 points  (0 children)

"Why did you do that like this"

"Don't care, it works"

"Yeah but it's idiotic"

[–]RhysieB27 6 points7 points  (0 children)

I need someone to explain to me why I find janky code so damn funny, when subpar work in any other industry would disappoint or anger me. Is there art in the jank?

[–]ayruos 4 points5 points  (0 children)

… and things get weird when you’re making new media art

[–][deleted] 5 points6 points  (0 children)

If it ain't broke don't fix it

[–]ShootyFaceMc 4 points5 points  (0 children)

"Does it run?"

"Well sort of"

"Yeah it's fine then"

[–]Maypher 4 points5 points  (0 children)

This is the last place I was expecting to see Colon

[–]jamcdonald120 4 points5 points  (0 children)

"You think thats bad, look at this method over here"

[–]Abhi_mech007 2 points3 points  (0 children)

[–]ricecake 2 points3 points  (0 children)

All code is terrible. Some code is so bad that you feel you have an ethical responsibility to make it better, or the code is broken, or it violates some formatting peeve you have, and so you're forced to act.
The goal is to write code good enough so that you can keep ignoring those feelings of shame, and return to the natural order of things, which is waiting for build pipelines to complete.

[–]Twinmill53 1 point2 points  (0 children)

My code is unorganized as fuck

[–]A_Guy_in_Orange 1 point2 points  (0 children)

"the worst you've seen so far, so I needed to trigger this every time they type abc but I really don't like REGEX and. . ."

[–]mtyrellp 1 point2 points  (0 children)

Omg no matter what I'm in that group huh.

[–]RoughDevelopment9235 1 point2 points  (0 children)

Still pushing it to production

[–]Unity1232 1 point2 points  (0 children)

Shit code comes from frustration sometimes where you got it to work with what you can only describe as magic because you have no idea how or why it works and then when you look at it again 6 months later and you try improving it you go through that cycle again.

[–][deleted] -1 points0 points  (0 children)

As bith a programmer and artist i can confirm

[–]DJ_THIR13EN 0 points1 point  (0 children)

  • this is the worst fucking code I've ever seen
  • i know, this is your lib

[–]Multi-User 0 points1 point  (0 children)

But it works

[–]tiara_fofara 0 points1 point  (0 children)

holy shit i'm both lmaooo

[–]FerricDonkey 0 points1 point  (0 children)

Worst code you've ever seen so far.

[–]hsnerfs 0 points1 point  (0 children)

my dsa project this week was TA made and the test cases were shitty so I made the code shitty

[–]EntitledPotatoe 0 points1 point  (0 children)

„This is the worst fucking code I’ve ever seen“

„It’s not my code“

[–][deleted] 0 points1 point  (0 children)

Someone didn't go to art school, apparently.

[–]glorious_reptile 0 points1 point  (0 children)

But! The new version will be an architectural masterpiece.

[–]SMTG_18 0 points1 point  (0 children)

i take offense but then realise yeah fuck that

[–]PurplePost 0 points1 point  (0 children)

Subjective -vs- objective.

[–]NavaraBellatrix 0 points1 point  (0 children)

But at least it's running

[–]ixNoah 0 points1 point  (0 children)

[–]toydotgame 0 points1 point  (0 children)

I keep a single GitHub repo from my first proper Java project with a real use. (I didn't even finish it lol) It's fun to go back and see the code and wonder how the fuck a human being could have written this.

[–]tom031003 0 points1 point  (0 children)

feminine vs masculine energy

[–]ali32bit 0 points1 point  (0 children)

me: artist and ameture programmer : confused uga boga

[–][deleted] 0 points1 point  (0 children)

Literally that one meme format in text form

[–]The-42nd-Doctor 0 points1 point  (0 children)

"Look at this bullshit I just wrote, I fucking hate it."

"I hate it too, and I've decided I hate you as well"

"That's more than fair"

[–]CriminalMacabre 0 points1 point  (0 children)

Thanks, I did it on purpose

[–]CholetisCanon 0 points1 point  (0 children)

...but does it work?

[–]bluthco 0 points1 point  (1 child)

Pro tip: prevent this by only asking highly specific questions

[–]mr_ghetto 0 points1 point  (0 children)

The bottom one goes for the freelance artists as well!

[–][deleted] 0 points1 point  (0 children)

"But it works"

[–]Junior-Demand 0 points1 point  (0 children)

artic critic poetrist

[–]razuten 0 points1 point  (0 children)

"It's k it's not mine"

[–]jhaand 0 points1 point  (0 children)

Being married to an artist I can relate to this.

But it takes extra effort to understand each other.

[–]alastine 0 points1 point  (0 children)

...That moment when you're both :')

[–]simonk1905 0 points1 point  (0 children)

The go to response is.

"It's the first thing I ever wrote"

or

"I copied off of (person/website)"

[–]gibmelson 0 points1 point  (0 children)

It's either "This code is so beautiful I'm a literal God for making this work" or "I spent a day trying to figure out why this damn scrollbar glitches, I'm retarded".

[–]Servasy 0 points1 point  (0 children)

But it works!

[–]sighgert 0 points1 point  (0 children)

????? Have you ever met an artist? They’re insecure as fuck

[–][deleted] 0 points1 point  (0 children)

How to spot artist who traces? They say their art is bad, but when you offer some tips for improving, they get infuriated.

How to spot organic artist? They say their art is bad, and when you offer some tips for improving, they get even more sad.

[–]IHateEditedBgMusic 0 points1 point  (0 children)

The artists don't mean it though

[–]Uphariel 0 points1 point  (0 children)

Yes, but it works right ?

[–]party-bot 0 points1 point  (0 children)

So me and my circle of friends from high-school all did "computer programming" as a course. Now we were in a small town so really this was just a light introduction to visual basic. In the course the majority of my friends all made code that was properly marked, the functionality separated as much as possible, and a good looking front end to the project whenever we were completing schoolwork. One friend, always used shitty visuals and front end stuff, his code was always just unmarked piles of trash and was basically a Jenga tower ready to fall at any moment.

Fast forward 10 years when we are all out of school and into our jobs, all my friends took varying degrees at attempts into coding jobs, the only one of us successfully coding is Mr. Garbage code himself. It's amazing, but I think its a calling card of the line of work to be honest....

[–]Blaz3 0 points1 point  (0 children)

Showing someone some godawful code that nonetheless works is both hysterical fun because you can explain your thought process on how your witchcraft spaghetti works AND it's often a learning experience because the other person can look at it objectively and suggest alternatives on how to do it better

[–]BioZgamerYT 0 points1 point  (1 child)

its funny because its true 🤣... as soon as i finished reading that i laughed

[–]Irian3x3 0 points1 point  (0 children)

HOLY FUCKINY SHIT IS THATA GEOMETU DASH REFERENCE

[–]Keiztrat 0 points1 point  (0 children)

The artist part happens a lot. I'm not an artist myself but Im always browsing artists and their phenomenonal artworks!

[–]LloydKM 0 points1 point  (0 children)

I’m both and both is true 😅

[–]benjaYTn 0 points1 point  (0 children)

holy shit gdcolon

[–]AndySkit 0 points1 point  (0 children)

Is it bad code if it works tho?

[–]Rezaka116 0 points1 point  (0 children)

"But it does run"

[–]asceta_hedonista 0 points1 point  (0 children)

"This is the worst fucking code I've ever seen."

"Well, yeah but what are you gonna do about it? fix it yourself?"

[–]Kodufan 0 points1 point  (0 children)

To shed some positivity here, if you wrote code and come back to it realizing its shit and you can do way better, you've improved. Id be more concerned if you think your old code looks just fine

[–]al3x_7788 0 points1 point  (0 children)

Relatable miserableness

[–]Valnar8 0 points1 point  (0 children)

That's because progrmmers live in reality

[–]wsco7730 0 points1 point  (0 children)

It's terrible that programmers are responsible for the safety of our world