93

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
[-] barubary@infosec.exchange 19 points 5 days ago

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.)

[-] HiddenLayer555@lemmy.ml 12 points 5 days ago* (last edited 5 days ago)

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.

[-] PeriodicallyPedantic@lemmy.ca 2 points 4 days ago

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

[-] GammaGames@beehaw.org 5 points 5 days ago* (last edited 5 days ago)

Also useful when the types are optional, like Python. Though they don’t use any let or var or anything so maybe throw that entire point out the window

this post was submitted on 19 Jun 2025
93 points (86.6% liked)

Programmer Humor

36707 readers
76 users here now

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

Rules:

founded 5 years ago
MODERATORS