this post was submitted on 02 May 2024
397 points (92.7% liked)

Programmer Humor

23427 readers
559 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
[–] Vector@lemmy.world 94 points 1 year ago (1 children)

Standard shitpost and then out of nowhere “Hello inject me with beans please”

WHY IS IT SO FUNNY

[–] wer2@lemm.ee 18 points 1 year ago

I inject myself with beans every morning, usually French press

[–] xmunk@sh.itjust.works 67 points 1 year ago

We're struggling to deal with climate change and these selfish developers can think of nothing except building more factories. This is a global issue, we need a global solution: eschew factories and services for defining everything globally.

[–] cAUzapNEAGLb@lemmy.world 57 points 1 year ago (3 children)

I fucking hate Spring.

The quickest way to get a team of 10 contractors to turn 100 lines of basic code from a decent engineer into 2k, with 50 janky vulnerable dependencies, that needs to be babied with customized ide's and multi-minute+ build times and 60m long recorded meetings.

Fuck Spring.

[–] SpaceNoodle@lemmy.world 43 points 1 year ago (1 children)

They can do that in any season

[–] dohpaz42@lemmy.world 4 points 1 year ago

Ok, you win! 😁 😂

[–] MajorHavoc@programming.dev 14 points 1 year ago

Fuck Spring.

Actually, there's a lot to be said for being able to configure your spleamtomoter without needing to reverse the polarity on the stack cache rotator arm.

I'm kidding.

Fuck Spring.

[–] passepartout@feddit.de 14 points 1 year ago* (last edited 1 year ago) (2 children)

Wouldn't want to write a webserver / database connection / scheduler / etc. from scratch. Spring Boot plus lombok turns 2k lines of code into 100.

[–] MajorHavoc@programming.dev 19 points 1 year ago (2 children)

... Looks both ways...

Python does the same in 10 lines of code.

... Ducks under a table to avoid the ensuring flames ...

[–] SpaceNoodle@lemmy.world 12 points 1 year ago (1 children)

I replaced the P in my LAMP stand with Python and I've never been happier.

[–] MajorHavoc@programming.dev 4 points 1 year ago
[–] VantaBrandon@lemmy.world 5 points 1 year ago (1 children)

They say he's still ducking to this day

load more comments (1 replies)
load more comments (1 replies)
[–] Pyro@programming.dev 38 points 1 year ago (1 children)

Hello inject me with beans please

not again

load more comments (1 replies)
[–] steventhedev@lemmy.world 36 points 1 year ago (2 children)

XML is the second worst programming language ever created by humans

[–] nxdefiant@startrek.website 32 points 1 year ago (1 children)

I'm gonna need a bell curve hooded figure meme template of this comment, this is comedy gold.

[–] marcos@lemmy.world 15 points 1 year ago

Good luck deciding where each opinion goes.

[–] SpaceNoodle@lemmy.world 11 points 1 year ago (4 children)

It's a markup language, not a programming language.

[–] steventhedev@lemmy.world 43 points 1 year ago (2 children)

Whoosh

Seriously though, spring configurations are written in XML and you create variables, call functions, and have control flow. Effectively turning XML into a horrible twisted shadow of a programming language.

All in the name of "configurability" through dependency injection.

[–] lars@programming.dev 10 points 1 year ago (2 children)

Spring moved away from XML ages ago. I work on a 6 year old Spring project and it has never had a single line of XML in it.

[–] MajorHavoc@programming.dev 5 points 1 year ago (2 children)

I'm fond of saying that all great code earns it's right to become good code by starting as trash...

But I still think we should all quietly and politely let Spring die a simple dignified death, as soon as possible.

Out of wildly morbid curiosity, do Maven and Ant still shit all over each other to make sure no one has any real idea what the build inputs and outputs are?

I shouldn't ask things I don't really want to know, though. My inbox is gonna be full of Java apologists.

load more comments (2 replies)
load more comments (1 replies)
[–] AMDIsOurLord@lemmy.ml 5 points 1 year ago (1 children)

So if you take XML, pervert it beyond recognition, cut off it's balls and one hand, then it's somehow it's fault that it sucks?

load more comments (1 replies)
[–] frezik@midwest.social 12 points 1 year ago (2 children)

It was a markup language until someone decided to parse and execute it as a programming language. This person should be watched for other deranged behavior.

load more comments (2 replies)
[–] dohpaz42@lemmy.world 11 points 1 year ago (1 children)
[–] deadbeef79000@lemmy.nz 4 points 1 year ago

Yo dawg, I heard you like XML over HTTP so I put XML over HTTP in your XML over HTTP.

[–] towerful@programming.dev 4 points 1 year ago (1 children)
[–] marcos@lemmy.world 7 points 1 year ago (2 children)

The one benefit of toml is that nobody creates a programing language over it.

[–] MajorHavoc@programming.dev 7 points 1 year ago (1 children)

The one benefit of toml is that nobody creates a programing language over it.

Heh. Any day though, right? I can't wait to see an excited presentation on code-free coding in YAML...

[–] frezik@midwest.social 4 points 1 year ago (1 children)

Github Actions have entered the chat.

[–] MajorHavoc@programming.dev 3 points 1 year ago

Thanks. I hate that you're right.

Why yes, I would like my stack traces to make no ffing sense! I'm so glad you asked.

[–] Mikina@programming.dev 30 points 1 year ago (1 children)

My favourite take on DI is this set of articles from like 12 years ago, written by a guy who has written the first DI framework for Unity, on which are the currently popular ones, such as Zenject, based on.

The first two articles are pretty basic, explaining his reasoning and why it's such a cool concept and way forward.

Then, there's this update:

Followed by more articles about why he thinks it was a mistake, and he no longer recommends or uses DI in Unity in favor of manual dependency injection. And I kind of agree - his main reasoning is that it's really easy for unnecessary dependencies to sneak up into your code-base, since it's really easy to just write another [Inject] without a second thought and be done with it.

However, with manual dependency injection through constructor parameters, you will take a step back when you're adding 11th parameter to the constructor, and will take a moment to think whether there's really no other better way. Of course, this should not be an relevant issue with experienced programmers, but it's not as inherently obvious you're doing something potentially wrong, when you just add another [Inject], when compared to adding another constructor parameter.

[–] docAvid@midwest.social 5 points 1 year ago

Exactly. Dependency injection is good; if you need a framework to do it, you're probably doing it wrong; if your framework is too magical, you're probably not even doing it at all anymore.

[–] tatterdemalion@programming.dev 23 points 1 year ago (1 children)

Say what you want about DI frameworks, but if I have to remove another fucking global variable so I can write a test, I'm going to cut a bitch.

[–] cadekat@pawb.social 7 points 1 year ago (1 children)

Dependency injection is so much worse. Oh, hey, where'd this value come from? Giant blob of opaque reflection code.

[–] Zagorath@aussie.zone 4 points 1 year ago (5 children)

It can be used in bad ways, but if it's used in the right way you should never have the situation you just described.

load more comments (5 replies)
[–] aluminium@lemmy.world 16 points 1 year ago* (last edited 1 year ago) (1 children)

Is this even a joke? In Spring DI beans are nothing but glorified over complicated global variables.

Also this fits in here perfectly https://m.youtube.com/watch?v=k0qmkQGqpM8

[–] indog@lemmy.ca 7 points 1 year ago (1 children)

Spring singleton beans are supposed to be stateless though, so they can't be called variables. Maybe the DI aspect of Spring is less relevant today in the micro service era, but in the day Spring helped make layered monolith apps much cleaner.

load more comments (1 replies)
[–] davidgro@lemmy.world 12 points 1 year ago

I think this might be the first of these I've seen where pretty much all the comments are just agreement.

[–] Krakaval@jlai.lu 9 points 1 year ago (3 children)

Can we talk about annotations which are broken when you upgrade spring boot ? You are asked to upgrade some old application to the newest version of spring boot, application that you discover on the spot, the application does not work anymore after the upgrade, and you have to go through 10 intermediate upgrade guides to discover what could possibly be wrong ?

[–] agressivelyPassive@feddit.de 7 points 1 year ago (1 children)

Spring annotations in general. There's a completely hidden bean context where every annotation seems to throw interceptors, filters, or some reflection crap into. Every stacktrace is 200 lines of garbage, every app somehow needs 500mb for just existing and if you add something with a very narrow scope, that suddenly causes something completely unrelated to stop working.

Realistically, DI and all the Spring crap does not add anything but complexity.

load more comments (1 replies)
[–] isVeryLoud@lemmy.ca 5 points 1 year ago (1 children)

Holy shit mood, described to the tee.

An application I've never heard or seen before that needs to be upgraded, and it breaks, so you now need to understand what the hell this application does so you can fix it properly.

load more comments (1 replies)
load more comments (1 replies)
[–] SpaceNoodle@lemmy.world 9 points 1 year ago

Tell me more about these beans

[–] MajorHavoc@programming.dev 8 points 1 year ago

I'll never plaster the back of my car with stickers that all proclaim the same things in ALL CAPS.

But if I was going to...

It would pretty much match this meme.

[–] Lmaydev@programming.dev 6 points 1 year ago

I love dependency injection personally.

I managed to completely change how YARP routed requests by registering a single interface.

The flexibility it provides is awesome. And it makes testing so much easier.

[–] grrgyle@slrpnk.net 6 points 1 year ago (1 children)

DI: ☺️

DI frameworks: 😒

[–] deadbeef79000@lemmy.nz 4 points 1 year ago

I just DI all the time, it's called a constructor.

[–] Solemarc@lemmy.world 6 points 1 year ago (2 children)

At work we have a lot of old monolithic OOP PHP code. Dependency injection has been the new way to do things since before I started and it's basically never used anywhere.

I assume most people just find it easier to create a new class instance where it's needed.

I've never really seen a case where I think, "dependency injection would be amazing here" I assume there is a case otherwise it wouldn't exist.

load more comments (2 replies)
[–] deadbeef79000@lemmy.nz 4 points 1 year ago

Urgh. I just sicked in my mouth.

Die in a hole DI frameworks.

I already have an injection 'framework' it's called a constructor. I already have a factory it's called new

load more comments
view more: next ›