New answers tagged

3

Most frequently, I use the variable result. Don't create ambiguity in the mind of the next Gentle Reader of your source-code. (Since, too bad for you, you just got smooshed by a bread truck, she can't ask you to clarify.) Try to write source code that is "clear 'at a glance.'" Because sometimes the peoople who will be reading it are in a hurry and under ...


0

You could sensibly go at this two ways. One is to use a consistent prefix, like 'ret' or 'out' - so calling the variable 'out_sum'. I also apply this naming system to out parameters. The other is to name the variable in question something different - like 'accumulator', or maybe abbreviated to 'cuml_sum' - which is more appropriate to its role as an ...


Top 50 recent answers are included