this post was submitted on 17 Dec 2025
502 points (96.5% liked)
Programmer Humor
27922 readers
767 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Hard disagree. Super beautiful.
Average Rust code:
Hell I don't want to know what you define as ugly then.
Sorry, I love Rust but I can't really agree with you here. They only showed a
macro_rules!definition, which is definitely rust syntax. Lifetime annotations are relatively common.I will concede that loop labels are incredibly rare though.
https://fprijate.github.io/tlborm/mbe-macro-rules.html#%3A%7E%3Atext=macro_rules%21+With%2Cfollowing+form%3A
I guess I see what you mean if we want to get very technical about what a syntax extension is. But I think for the purpose of this discussion, it's reasonable to think of
macro_rules!as a part of the Rust language. Practically speaking, it is syntax provided by the language team, not just users of the language who are free to extend the syntax by usingmacro_rules!to do so.Loop labels are rare, but they lead to much simpler/clearer code when you need them. Consider how you would implement this kind of loop in a language without loop variables:
In C/C++ you'd need to do something like
Personally, I wouldn't call it ugly, either, but that's mostly a matter of taste
Well, you'd typically put the loops into a function and then do an explicit
returnto jump out of there. I believe, there's some use-cases where this isn't possible, which is why I'm cool with loop labels existing, but I've been coding Rust for seven years and have not needed them once...