Welcome Guest, Not a member yet? Register   Sign In
Comments and explanations - how to do it better?

one thing that has been helping me is to make some of the comments in the form of questions, especially for things wrapped in an if check. that way its not necessary to read the code inside the if to get the general sense of what the method is doing or checking for.

// did the contact form validate?
implied: if it didn't we are going to show the contact form again

// is there inventory for the product?
implied: if there is no inventory we can't buy this item

// did the transaction complete?
implied: if it didn't then don't complete the order

Messages In This Thread
RE: Comments and explanations - how to do it better? - by cartalot - 01-09-2016, 05:00 PM

Theme © iAndrew 2016 - Forum software by © MyBB