Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

Coding style question

$
0
0

This is not a technical question, just a curiosity that hits me every time I read some sample code.

When we talk we say "Is this car longer than three meters?", and never "Are three meters shorter than this car?", or "Aer you 20 years old?" and never "Are 20 years old your age?", but I'm observing that the coding practice in all the examples uses the reversed form. For example:

if (SSP_SUCCESS == status)

or 

while (0 != * p_data)

or

if (0 < (len - 1))

I suppose that there is a powerful reason to do so because it is not the normal way of talking (and thinking). Is it some safe coding practice? I can understand that coding the equal comparisons this way prevents from confusing "=" with "==", but why is it used in the other kind of comparisons, please?

Anyone using this programming style can explain me the reason?

Thanks

 


Viewing all articles
Browse latest Browse all 5781

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>