this post was submitted on 27 Feb 2025
369 points (97.7% liked)

Programmer Humor

20815 readers
1554 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
[–] [email protected] 38 points 14 hours ago (1 children)

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

[–] [email protected] 3 points 9 hours ago
[–] [email protected] 75 points 21 hours ago (1 children)
[–] [email protected] 11 points 16 hours ago

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

[–] [email protected] 8 points 15 hours 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?

[–] [email protected] 2 points 9 hours ago

The closest thing I've seen is Combobulate

[–] [email protected] 2 points 14 hours ago (1 children)

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

[–] [email protected] 3 points 12 hours ago* (last edited 12 hours 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.

[–] [email protected] 3 points 9 hours ago (1 children)

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

[–] [email protected] 1 points 7 hours ago* (last edited 7 hours ago)

Do you have some examples?

(That is what I meant by giving them a symbol, maybe I worded it poorly)

[–] [email protected] 10 points 16 hours 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.

[–] [email protected] 132 points 1 day ago (1 children)

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

[–] [email protected] 128 points 22 hours ago (1 children)

You could say they have rewritten the joke in Rust

[–] [email protected] 8 points 10 hours ago (1 children)

But you get the joke faster now.

[–] [email protected] 3 points 6 hours 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.

[–] [email protected] 6 points 15 hours ago

My humanity.

[–] [email protected] 5 points 15 hours ago

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

[–] [email protected] 62 points 1 day ago* (last edited 1 day ago) (1 children)

rustfmt

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

[–] [email protected] 49 points 22 hours 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

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

Please do, I'm waiting for it to get ported to other languages.

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

Crap, thats what I was thinking.

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

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

[–] [email protected] 2 points 18 hours ago

Slow down satan

[–] [email protected] 31 points 22 hours ago

My medication mostly.

[–] [email protected] 76 points 1 day 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.

[–] [email protected] 154 points 1 day ago* (last edited 1 day ago) (3 children)

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

[–] [email protected] 2 points 1 hour ago

Oh... Oh god

[–] [email protected] 21 points 23 hours ago (3 children)

Oh, so Rust is like JavaScript!

[–] [email protected] 5 points 15 hours 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.

[–] [email protected] 3 points 16 hours ago

Undervalued comment right there. This is better than the OP

[–] [email protected] 1 points 15 hours ago

Pretty sure javascript is like c but I I can't be mad at the js devs for the awful language they write.

[–] [email protected] 37 points 1 day ago (2 children)
[–] [email protected] 19 points 23 hours ago (1 children)
[–] [email protected] 12 points 23 hours ago (2 children)

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

load more comments (2 replies)
[–] [email protected] 9 points 19 hours ago

My eyes! My eyes!!!!

[–] [email protected] 17 points 22 hours ago (1 children)

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

load more comments (1 replies)
[–] TheAgeOfSuperboredom 53 points 1 day ago (1 children)

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

[–] wise_pancake 26 points 1 day ago

Can't you fix the default format to this?

[–] [email protected] 27 points 1 day ago (1 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.

[–] [email protected] 1 points 14 hours ago (1 children)

Why would that cause the same feeling?

[–] [email protected] 1 points 12 hours ago* (last edited 12 hours ago) (1 children)

I'm not sure if you're taking the piss or not but I'm going to choose to believe you're asking in good faith!

The code just feels... messy, unfamiliar, almost chaotic - but the semicolons and curly brackets in a neat little row, formatted in a satisfying way, is like an island of calm and order in the middle of a formatting clusterfuck.

A moment of serenity in the middle of a riot, one may think.

[–] [email protected] 2 points 12 hours ago

Ohhhh thanks for the explanation, I'm a bit stupid :3

Also, I didn't mean it in a bad way, a genuine question. Thanks for assuming it's in good faith ^^

load more comments
view more: next ›