this post was submitted on 13 Dec 2025
649 points (97.7% liked)

Programmer Humor

28360 readers
368 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
you are viewing a single comment's thread
view the rest of the comments
[โ€“] boonhet@sopuli.xyz 2 points 4 weeks ago (1 children)

Personally I would expect it to behave the same in front of a numeric literal and in front of a variable. I do think most languages do that, but I haven't actually tested that many and could br wrong.

[โ€“] squaresinger@lemmy.world 1 points 3 weeks ago

Pretty much all languages do that. It's a very basic language feature inherited from basic maths notation. Same as x - y subtracts y from x in pretty much any language that supports operators.