Programming tip of the day

When evaluating logical operators, put the constant on the left so you have no chance of forgetting that extra =. For example:

if (5 == $id)
do stuff

Think about it; it’s very logical and if it even saves you a single bug in your code it’s worth it.

2 replies on “Programming tip of the day”

  1. blah blah blah computer blah blah blah internet blah blah blah
    wait… you lost me at “name and email address”..

Comments are closed.