Exact action timing

Link to this posting

Postby Ursego » 21 Feb 2013, 10:37

Names, describing actions, must express if the action should be done in the future or has been already done in the past.

Giving names to variables and tables' fields, don't force readers to guess an action timing. For example, in one of my project two different tables had fields named calc_method, but one of them stored the method to be used in the next calculation, while the second one contained the method already used in the last calculation. Why not to call the columns calc_method_to_use and calc_method_used accordingly if that can improve understanding of the business and SQLs?

Boolean names consisting of a noun only (without a verb) is another sad story. What do you think about a Boolean variable named isCalculation? Calculation - what??? How must the condition if (isCalculation) be understood? As you see, no understanding problem exists if the variable is named isCalculationDone (isCalculated) or in the imperative form - doCalculation (or simply calculate).

So, the common advice is to use words do..., ...ToDo, perform..., execute..., ...ToApply etc. for stuff which should take place in the future, and ...Done, ...Performed, ...Executed, ...Occurred, ...Passed, ...Applied etc. for things which have taken place in the past.
User avatar
Site Admin
Posts: 120
Joined: 19 Feb 2013, 20:33

IF you want to ((lose weight) OR (have unbelievable (brain function AND mental clarity))) THEN click:

free counters

eXTReMe Tracker