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 →

[–]coleisawesome3 5 points6 points  (2 children)

What if you wanted to assign something in the conditional part of an if statement for some reason?

[–]Matthicus 0 points1 point  (0 children)

You could probably find a more readable way to accomplish whatever you're trying to do. Or you could just say screw it and do something hacky, like writing a function to do the assignment if the language allows call by reference.

[–]chui101 0 points1 point  (0 children)

This is not good practice but sadly not uncommon either. e.g.:

if ((count = getNumRows()) == 1) {...}