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

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.

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

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

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


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