In fact, there is no difference between the two, but the former deals with details. When we judge the code as empty, we may write if (a = = null) as if (a = null) because of our quickness. This can be compiled in some languages, but the result will be an error, which will make us spend time to find the problem. However, if (null = a) compilation must report errors, so it can reduce the time of troubleshooting to a certain extent.
Some friends may say that in the C ා environment, both of these situations seem to report errors, such as:
It seems that it is, but have you forgotten the new dynamic type of C? The compilation passed, but it exploded when it ran.
So, good procedures start with details.