this post was submitted on 30 Oct 2024
277 points (100.0% liked)

Programmer Humor

853 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 14 comments
sorted by: hot top controversial new old
[–] bleistift2@sopuli.xyz 30 points 1 week ago (2 children)

C) Write a highly specific, custom-tailored boilerplate generator that does 80% of the work and needs only a day or two to implement.

[–] petey@aussie.zone 29 points 1 week ago

D) spend millions developing an AI to generate the boilerplate generator badly

[–] ddplf@szmer.info 7 points 6 days ago (2 children)

This sounds just extremely dumb to me, as in "do something manually for 2 minutes or spend 2 days automating it"

Also, DRY in 90% of the cases is a sham

[–] bleistift2@sopuli.xyz 1 points 1 day ago

Completely depends on how often you need to write boilerplate code, and how error-prone it is.

After writing hundreds of instances of ‘fetch this from the server and show an error if it doesn’t work’, I finally wrote a helper for that. It took 2 hours, shouts at me if I use it wrong, and instantly makes my classes easier to read because all the boilerplate is gone. As an added bonus, the invocation is so small that Copilot can write it error-free, which it couldn’t before.

So fetching things is now a thing of a few seconds instead of one minute with a chance of making a mistake. I say it’s worth it.

[–] nilloc@discuss.tchncs.de 3 points 5 days ago

DRY, but also pre-optimization and dependency hell are bad.

[–] quicken@aussie.zone 21 points 6 days ago

It's always the AI. We all know they're pushing the AI button before even reading the rest of the label!

[–] ddplf@szmer.info 15 points 6 days ago (3 children)

I don't get it, what's so bad about boilerplate?

[–] davel@lemmy.ml 15 points 6 days ago (2 children)
[–] veganpizza69@lemmy.vg 4 points 5 days ago (1 children)

Writing code is bad!

Writes condensed configurations and properties files in 3 different languages instead. Cloud deployment uses yet another source of configurations and properties.

Doesn't write documentation for configuration and properties.

Ah, yes, that's much more readable.

[–] davel@lemmy.ml 2 points 5 days ago* (last edited 5 days ago)

Sure, though you’re arguing against an entirely different thing. Nobody said writing code is bad.

[–] Swedneck@discuss.tchncs.de 8 points 6 days ago

well why is it good? why not just assume the boilerplate as the default and require the user to override it if they want to do something fancy?

it's just busywork to always need to write the same stuff, and it also makes the code less readable and many people look at all that boilerplate and nope the fuck out.

This is why python is so good for getting people to realize that programming isn't magic, you just write the equivalent of one short sentence and BAM text in the terminal, no need to import the basic ability to print text which is so incredibly inane.

[–] MyNameIsRichard@lemmy.ml 6 points 6 days ago

It's boring to write

[–] eldavi@lemmy.ml 4 points 1 week ago

do it like my companies does and do both. lol