this post was submitted on 30 Jan 2025
1045 points (97.7% liked)

Programmer Humor

20039 readers
1518 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
 
top 50 comments
sorted by: hot top controversial new old
[–] Fades 4 points 6 days ago

Uhhh, maybe bad programmers do that. Any programmer worth their salt with actual responsibilities is damn sure going to make an effort to figure out exactly what is happening and why as apart of fixing it.

[–] SpaceNoodle 194 points 1 week ago (5 children)

If you don't understand how and why, it's broken.

[–] [email protected] 70 points 1 week ago (4 children)

Sometimes its either ship something broken or lose your job.

[–] [email protected] 2 points 6 days ago

If you're gonna do that it should only be after sending a very blunt CYA email.

[–] SpaceNoodle 16 points 1 week ago (4 children)

Lose a little credibility now, or a ton of credibility later? Sounds like a pretty short-sighted tradeoff, and a good opportunity to find a less shitty employer.

[–] [email protected] 50 points 1 week ago (1 children)

It sometimes depends on the programmer's situation. Maybe its "lose a ton of credibility or live on the street/lose your H-1B Visa"

[–] SpaceNoodle 20 points 1 week ago

I admit that I'm currently in a position of privilege where I don't have to worry about immigration status or insecure housing. I do try to use my power to shield those less fortunate.

[–] [email protected] 13 points 1 week ago (1 children)

But, losing a little credibility now buys everyone time for their job search!

load more comments (1 replies)
[–] [email protected] 10 points 1 week ago (2 children)

You're thinking like someone who exists beyond this quarter's profit margins.

I mean, you do, but as your boss, I'm required to tell you that you need to maximize short term results, and take all the responsibility for medium and long term calamities caused by me telling you to do that.

[–] [email protected] 2 points 6 days ago

Hahaha, I'll do whatever you want boss, but you're sorely mistaken if you think you're getting away without a written record of you signing off on telling me to do stupid shit.

[–] SpaceNoodle 5 points 1 week ago

You're not gonna be my boss for long with an attitude like that.

load more comments (1 replies)
load more comments (2 replies)
[–] [email protected] 57 points 1 week ago (2 children)

It's a load-bearing function.

We have no idea why it's important, just that it is critical to everything functioning.

[–] [email protected] 21 points 1 week ago

One of my favorite Simpsons lines, the load hearing poster

[–] [email protected] 13 points 1 week ago (2 children)

I feel like the "we don't know what this function does" meme is kinda bad. There's no reason beyond maybe time crunch why you shouldn't be able to dissect exactly what it does.

Despite this, the notion of a load-bearing function is still very relevant. Yeah, sure, you know what it does, including all of the little edge case behaviors it has. But you can't at this time fully ascertain what's calling it, and how all the callers have become dependant on all the little idiosyncracies that will break if you refactor it to something more sensible.

It has been several times now where a part of my system of legacy code broke in some novel fantastic way, because two wrongs were cancelling out and then I fixed only one of them.

[–] [email protected] 16 points 1 week ago (1 children)

There's no reason beyond maybe time crunch why you shouldn't be able to dissect exactly what it does.

Usually it's mysterious business logic from before the dawn fo time.

[–] WhiskyTangoFoxtrot 7 points 1 week ago (1 children)
[–] [email protected] 5 points 1 week ago
[–] bisby 12 points 1 week ago

https://en.wikipedia.org/wiki/Fast_inverse_square_root

even if you can figure out specifically WHAT a function does, it's not always clear WHY a function does, and honestly, if this function wasnt labeled in the code, no way in hell would I know what it does.

It has an entire wiki page dedicated to explaining it, and it involves enough math that most people wouldn't be able to follow along.

Nothing this atrocious lives in any current codebases I work on... but if you work at an old enough company, some of the load-bearing code will be tricky to figure out what is calling it, but also it was written in a time where little hacks were needed to eke out performance.

You only have to experience it once for it to be a memorable enough thing that you will cite it for the rest of your days.

Or more realistically, it IS comprehensible, but the level of effort necessary to comprehend it is not worth it. So you leave it as "undecipherable" and move on.

[–] UnfortunateShort 42 points 1 week ago (3 children)

I feel like these memes have to (mainly) stem from badly documented or broken libraries. The only times where I don't understand what I'm doing are when I try to figure out what someone else is doing

[–] Klear 4 points 6 days ago

The only times where I don’t understand what I’m doing are when I try to figure out what someone else is doing

Same, but past me counts as "someone else".

[–] meliaesc 20 points 1 week ago (1 children)

The most recent library I wrote for my team at work is painstakingly documented, and everyone has been invited to the multiple recorded training sessions.

They still act like it's black magic and just push all work and questions to me.

[–] [email protected] 6 points 6 days ago* (last edited 6 days ago) (1 children)

Lol, welcome to the party. I'm not in a programming position, I'm on a systems engineering team. Most of my team mates can do some PowerShell scripting, but I have some programming classes under my belt.

I have a PowerShell script that is complex enough that I'm confortable calling it a program instead. Roughly half of the code is comments or logging the program flow. Every run generates a step by step log of all actions taken. I have 2 Word documents that summarize the process to different levels of detail, and a fucking flowchart for the visual peeps.

I'm still treated as the only person who could possibly flip the clearly labelled read only and route email to our team only switches and troubleshoot it.

To be fair, I recently learned during a vendor meet and greet that the vendor's tech guy in the meeting had previously made a consulting firm to sell exactly what I built this program to do. Probably means I'm in the wrong line of work.

[–] [email protected] 3 points 6 days ago (1 children)

Powershell is c# under the hood, no? It's a pretty comprehensive programming language beyond anything bash does if you get down to it

I just can't with the syntax though

[–] [email protected] 2 points 6 days ago

Yeah, you can actually run C# code "inline" in it without having to compile to an exe, which is simulataneously really cool, kinda janky in practice, a bad idea, and pretty cursed.

There's definitely some weirdness with the syntax, and some odd footguns, but I've found those in most languages I've used for any considerable amount of time.

I work in an almost exclusively Windows environment, and the base version of PowerShell is preinstalled on all Windows stuff since I think Windows 7, with some really good integration with the Windows sysadmin tools. Not sure I'd reccomend it outside of that sort of environment.

[–] SpaceNoodle 8 points 1 week ago (1 children)
[–] [email protected] 12 points 1 week ago (2 children)

I once saw something about how if you are trying to build it yourself instead of using a pre-existing library you come off arrogant.

Can I build it better? Probably not. But do I want to deal with a dependency in my fun side project (unfun), when I could just build it myself (fun)? No.

I probably should to get more practice with it so it is less painful, but…

[–] [email protected] 2 points 6 days ago

I once saw something about how if you are trying to build it yourself instead of using a pre-existing library you come off arrogant.

Js ?

[–] SpaceNoodle 4 points 1 week ago

I also tend to be writing code for embedded systems, so most dependencies are non-starters.

[–] NocturnalMorning 25 points 1 week ago (2 children)

You must not have worked for a dickhead expecting you ship software on Monday that takes months to write when you were given a week to do it.

[–] [email protected] 12 points 1 week ago

No, it’s usually ship on Friday. At 1600.

[–] SpaceNoodle 9 points 1 week ago (2 children)

The trick is to be the bigger dickhead.

[–] [email protected] 19 points 1 week ago (2 children)

You may be joking, but as long as you’re actually good at what you do, being a dickhead can be a winning strategy.

I’ve never been able to do it myself, but know many who have.

[–] SpaceNoodle 5 points 1 week ago

I do try to reserve it for when I'm fully confident that I'm correct.

load more comments (1 replies)
[–] NocturnalMorning 8 points 1 week ago (1 children)

In my experience, people that aren't easy to work with that aren't already in charge don't stick around very long.

load more comments (1 replies)
[–] moseschrute 4 points 1 week ago (3 children)

What if all the tests pass?

[–] [email protected] 1 points 6 days ago (1 children)

My tests always pass! They've never failed, that's how good a programmer I am!

[–] moseschrute 1 points 6 days ago (1 children)

You deleted the failing test, didn’t you

[–] [email protected] 1 points 6 days ago

Test can never fail if it never makes any real assertions!

[–] [email protected] 6 points 1 week ago* (last edited 1 week ago) (1 children)

If the tests pass, then everything is fine... Unless we expected the tests not to pass...then it's time to burn the codebase down and try again after a long vacation to clear our heads.

Of course, I'll usually settle for fixing the test suite after a long weekend. But in my heart, I'll know what I should have done...

[–] moseschrute 7 points 1 week ago (1 children)

...or you can just delete the failing tests :)

[–] Lemminary 7 points 1 week ago (1 children)
[–] moseschrute 4 points 1 week ago

Delete all the tests!

[–] hesusingthespiritbomb 3 points 1 week ago

If the tests don't give any insight into the functionality it is testing, they are probably not the best tests.

[–] [email protected] 9 points 1 week ago

Let it Be? No, no. Let it Haiku.

[–] count_dongulus 6 points 1 week ago

Maybe I've been doing this for too long, but if I come across a project that isn't built via CI, I instantly think it's by amateurs and I don't trust it.

load more comments
view more: next ›