this post was submitted on 19 Jun 2025
322 points (90.2% liked)

Programmer Humor

24373 readers
677 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
 

Made with KolourPaint and screenshots from Kate (with the GitHub theme).

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 22 points 2 days ago (8 children)
[–] [email protected] 18 points 2 days ago* (last edited 2 days ago) (7 children)

So I think it's still probably unclear to people why "mix of keywords and identifiers" is bad: it means any new keyword could break backwards compatibility because someone could have already named a type the same thing as that new keyword.

This syntax puts type identifiers in the very prominent position of "generic fresh statement after semicolon or newline"

..though I've spent like 10 minutes thinking about this and now it's again not making sense to me. Isn't the very common plain "already_existing_variable = 5" also causing the same problem? We'd have to go back to cobol style "SET foo = 5" for everything to actually make it not an issue

[–] [email protected] 3 points 2 days ago (2 children)

At least in C#, you can define variables with keyword names like this:

var @struct = "abc"

I think in Kotlin you can do the same, and even include spaces with backticks like val abstract class = "abc"

I'm not sure if other languages allow that, regardless it should be rarely used.

[–] [email protected] 3 points 2 days ago (1 children)

Swift also uses backticks and Rust has a dumb one in the form of r#thekeyword. Still much better than introducing a async as a new keyword in a minor version of a language and breaking a bunch of libraries.

[–] [email protected] 4 points 2 days ago
load more comments (4 replies)
load more comments (4 replies)