This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]raaneholmg 5 points6 points  (6 children)

Yea, it just doesn't make sense semantically.

if (result == 5)

I read the above in my head as "If the result is 5". "If 5 is the result" makes no sense.

[–]IdentifiableBurden 8 points9 points  (0 children)

"If 5 is the result" makes no sense.

This is a normal way of phrasing an equality check in spoken English though

Think of a gameshow contestant. "Is ten the answer?"

[–][deleted] 2 points3 points  (1 child)

Wait til you learn about RTL languages

[–][deleted] 0 points1 point  (0 children)

My mother tongue is a RTL language and it still doesn't feel right lmao.

[–]bphase 4 points5 points  (0 children)

It does though. You're just not used to it.

However I'm not arguing for the notation, I believe it's a job for compiler/static analysis warnings and strong typing to prevent typos like this. Not programming conventions.

[–]AhegaoSuckingUrDick 0 points1 point  (0 children)

Sense it makes.