When I was at university I used to write code like 0 == current->uid exactly because I didn’t trust myself and I knew I could write some_variable = 0 instead of same_variable == 0. Also because this kind of error is a nightmare to track down since it’s all valid syntax. The professor looked at me in horror for using 0 == some_variable, told me I was wrong, dropped my grade a few points. Had I knew about this hack attempt back then, I would have brought this to the attention of my prof.
When I was at university I used to write code like
0 == current->uid
exactly because I didn’t trust myself and I knew I could writesome_variable = 0
instead ofsame_variable == 0
. Also because this kind of error is a nightmare to track down since it’s all valid syntax. The professor looked at me in horror for using0 == some_variable
, told me I was wrong, dropped my grade a few points. Had I knew about this hack attempt back then, I would have brought this to the attention of my prof.