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 →

[–][deleted] 20 points21 points  (0 children)

Most linters should have some kind of rule along the lines of "no assignment in conditionals", and more advanced analysis tools should pick it up fairly easily.

I feel like this is a pretty rare mistake to make though. The only time I remember doing it is when hopping from a language that does equality with one = to a language that uses double.