this post was submitted on 19 Jun 2025
61 points (85.9% liked)

Programmer Humor

36575 readers
262 users here now

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

Rules:

founded 5 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] 16 points 20 hours ago (3 children)

Because let x: y is syntactically unambiguous, but you need to know that y names a type in order to correctly parse y x. (Or at least that's the case in C where a(b) may be a variable declaration or a function call depending on what typedefs are in scope.)

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

Can't say I've ever experienced this kind of confusion in Java but that's probably because they intentionally restricted the syntax so there's no ambiguity.

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

I think he means that of you initialize the variables, it becomes simpler but still unambiguous

load more comments (1 replies)