this post was submitted on 27 Feb 2025
394 points (97.8% liked)

Programmer Humor

22995 readers
259 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
[–] parlaptie 144 points 2 months ago (2 children)

Hang on, this is just a C++ joke slapped onto Rust.

[–] puchaczyk@lemmy.blahaj.zone 145 points 2 months ago (1 children)

You could say they have rewritten the joke in Rust

[–] dave@feddit.uk 18 points 2 months ago (1 children)

But you get the joke faster now.

[–] davidagain@lemmy.world 8 points 2 months ago

No, it's just impossible for it to leak out of a hole in the back of your head that you didn't realise was growing under your pony tail.

load more comments (1 replies)
[–] Laser 87 points 2 months ago (2 children)
[–] enemenemu@lemm.ee 14 points 2 months ago

To me it just looks like you do not need the braces at all

[–] merc@sh.itjust.works 5 points 2 months ago

A funny, but incredibly subtle joke to do would be to do a post like this, but get the indentation subtly wrong somewhere, so something that's supposed to be inside a loop is outside according to indentation, but is inside according to braces.

[–] duckythescientist@sh.itjust.works 83 points 2 months ago (1 children)

I'm good at Python, and I don't know Rust. This looks fine to me. I've fully missed the joke.

[–] logi@lemmy.world 166 points 2 months ago* (last edited 2 months ago) (3 children)

Same. Until you notice the column of curly braces and semi colons in the right margin.

[–] ryannathans@aussie.zone 44 points 2 months ago (2 children)
[–] Viking_Hippie@lemmy.dbzer0.com 21 points 2 months ago (1 children)
[–] zlatko@programming.dev 12 points 2 months ago (2 children)

You never review code when you have no time to do an actual review? Looks good to me :)

[–] Viking_Hippie@lemmy.dbzer0.com 5 points 2 months ago (1 children)

You never review code when you have no time to do an actual review?

Nope. Then again, I never review code at all 🤷😁

[–] moseschrute@lemmy.world 8 points 2 months ago

Don’t review, don’t write tests, and don’t even do QA. All of those tasks are overhead. It’s time you could be spending completing more story points. All that matters is story points, not the customer, not your coworkers, not your happiness, not your sanity. Just story points.

load more comments (1 replies)
[–] Arcka@midwest.social 22 points 2 months ago (3 children)

Oh, so Rust is like JavaScript!

[–] barsoap@lemm.ee 7 points 2 months ago

No, Rust lacks the semicolon elision rules of Javascript which make everyone always use semicolons in javascript because they're so horribly broken.

Rust is like ML, quite literally, not just by ancestry: The syntax is palpably ugly, but at least it's sane, regular, and concise where it matters.

load more comments (2 replies)

Oh... Oh god

[–] dgriffith@aussie.zone 71 points 2 months ago* (last edited 2 months ago) (1 children)

rustfmt

is stopping me from writing code like this, and I have never been more happier using it after viewing this.

[–] killeronthecorner@lemmy.world 60 points 2 months ago (2 children)

I'm going to write a tool that automatically adds the braces and semicolons to the column as you edit the code.

I will call it rustfml

[–] Irelephant@lemm.ee 11 points 2 months ago (1 children)

Crap, thats what I was thinking.

[–] verstra@programming.dev 10 points 2 months ago (1 children)

It could be run after git checkout and then rustfmt before commit.

[–] killeronthecorner@lemmy.world 5 points 2 months ago

Slow down satan

load more comments (1 replies)
[–] TheAgeOfSuperboredom@lemmy.ca 59 points 2 months ago (1 children)

Then some jerk runs rustfmt and ruins all your hard work!

[–] wise_pancake@lemmy.ca 30 points 2 months ago

Can't you fix the default format to this?

[–] Feathercrown@lemmy.world 51 points 2 months ago (1 children)

It took me way too long to notice the horror on the right

[–] mostlikelyaperson@lemmy.world 34 points 2 months ago

My medication mostly.

[–] PhobosAnomaly@feddit.uk 29 points 2 months ago (3 children)

I hate it with every fibre of my being but also secretly calmed by that column of statement terminators and brackets.

It's like the code representation of the Vancouver riots kiss photo.

load more comments (3 replies)
[–] notabot@lemm.ee 17 points 2 months ago (1 children)

This makes my deeply uncomfortable, like an itch I can't quite scratch.

load more comments (1 replies)
[–] villainy@lemmy.world 12 points 2 months ago

DwangoAC and the TASBot crew are maniacs in the best possible way. I would like to continue having a high opinion of him, hence I will pretend that this post does not exist.

[–] CanadaPlus@lemmy.sdf.org 11 points 2 months ago (2 children)

Wow, so this is possible.

Formatting is so damn arbitrary. Somebody has to have tried storing just the parse tree on disk, right?

[–] Lightfire228@pawb.social 2 points 2 months ago (1 children)

If you do that, you lose formatting and comments every time you load the source from disk

[–] CanadaPlus@lemmy.sdf.org 3 points 2 months ago* (last edited 2 months ago) (1 children)

Losing formatting other than what you've set in your deparser would be the point. Losing comments would be bad, but that seems easily fixable just by giving each comment block a symbol that points to it's contents.

[–] djehuti@programming.dev 3 points 2 months ago (2 children)

Or by including comments in the parse tree. (& Yes, it is done various places for various languages and formats.)

load more comments (2 replies)
load more comments (1 replies)
[–] poireCartable@lemm.ee 10 points 2 months ago

My eyes! My eyes!!!!

[–] tonytins@pawb.social 9 points 2 months ago

Oh... Oh! Well, that is creative.

[–] stefenauris@pawb.social 8 points 2 months ago
[–] BigMikeInAustin@lemmy.world 7 points 2 months ago

I’ll allow it!

[–] bitcrafter@programming.dev 6 points 2 months ago

My humanity.

[–] muntedcrocodile@lemm.ee 5 points 2 months ago

I like python like really really like it. But this should be a warcrime

[–] pineapplelover@lemm.ee 4 points 2 months ago
[–] mariusafa@lemmy.sdf.org 3 points 2 months ago (1 children)

This is why python has to be putdown

load more comments (1 replies)
[–] Kolanaki@pawb.social 3 points 2 months ago* (last edited 2 months ago) (2 children)

I don't know Rust. 🤷🏻‍♂️

(I mean, I don't know a lot of Python either so I can't even get the joke. 😞)

[–] Limitless_screaming@kbin.earth 14 points 2 months ago

In Rust and lots of other languages you have to end each statement with a semicolon. The semi colon is usually placed right after the statement, but in this example there's indentation after each statement before the semicolon so they're all aligned.

There's also the curly brackets, they're padded in the same way, but those usually define where a scope (block) starts and ends making it even worse.

[–] MP3Martin@programming.dev 7 points 2 months ago (2 children)

Look at the right side of the code editor

[–] Kissaki@programming.dev 7 points 2 months ago

These scrollbars with issue indicators are becoming more and more fancy

[–] asudox@lemmy.asudox.dev 6 points 2 months ago

lmao I didn't even notice

load more comments
view more: next ›