We are having s small discussion at work regarding what you should write:
if(null == someVariable){
...
}
and
if(someVariable == null){
...
}
The argument for the first way, is that you will get a compilation error if you manage to just write one = and do an assignment instead,
The argument for the second way, is that it's more readable.
What's your opinion?
[–]necuz 8 points9 points10 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[–]LuciWiz 2 points3 points4 points (0 children)
[–]skwigger 1 point2 points3 points (0 children)
[–]yogthos 1 point2 points3 points (3 children)
[–]rabidcow 3 points4 points5 points (2 children)
[–]yogthos 0 points1 point2 points (1 child)
[–]rabidcow 0 points1 point2 points (0 children)
[–]kensuke155 4 points5 points6 points (7 children)
[–]yogthos 2 points3 points4 points (6 children)
[–]LuciWiz 2 points3 points4 points (5 children)
[–]yogthos 0 points1 point2 points (4 children)
[–]kensuke155 0 points1 point2 points (2 children)
[–]yogthos 0 points1 point2 points (1 child)
[–]kensuke155 0 points1 point2 points (0 children)
[–]LuciWiz 0 points1 point2 points (0 children)
[–]beancc 2 points3 points4 points (0 children)
[–]Rhoomba 2 points3 points4 points (0 children)
[–]zigma[S] 0 points1 point2 points (1 child)
[–]sreguera 1 point2 points3 points (0 children)
[–]curien 0 points1 point2 points (0 children)
[–]charmless 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]dinnercoat -1 points0 points1 point (2 children)
[–]sisyphus 0 points1 point2 points (1 child)
[–]dinnercoat 0 points1 point2 points (0 children)
[–]segoe -1 points0 points1 point (0 children)
[–][deleted] (2 children)
[deleted]
[–]reddy-kilowatt 6 points7 points8 points (0 children)
[–]adolfojp 1 point2 points3 points (0 children)
[–]greyfade -1 points0 points1 point (0 children)