You are viewing one comment and its replies. View all comments · View the comment above
Ah yes, yoda conditionals. Because guarding against accidentally typoing if(x=6) is worth destroying your code’s readability.
if(x=6)
This is not needed anymore thanks to compiler warnings
Tell that to my colleague who still insists on writing if conditions like that. Maybe it’s just a PHP thing.
I think php had a linter for stuff like this. Defensive programming is good, but having tools to do the defending is better so I can use my brain power where it matters
Sign in to comment. Sign in
Comments
Ah yes, yoda conditionals. Because guarding against accidentally typoing
if(x=6)is worth destroying your code’s readability.This is not needed anymore thanks to compiler warnings
Tell that to my colleague who still insists on writing if conditions like that. Maybe it’s just a PHP thing.
I think php had a linter for stuff like this. Defensive programming is good, but having tools to do the defending is better so I can use my brain power where it matters
Sign in to comment. Sign in