Readability and naming.

Steve Horne stephenwantshornenospam100 at aol.com
Wed Jan 10 16:52:21 PST 2007


On Wed, 10 Jan 2007 14:34:59 -0800, Sean Kelly <sean at f4.ca> wrote:

>Personally, I think variable names should be clearly understandable to a 
>code reviewer, but this doesn't always equate to long names.

Agreed. The way some people go on about long names, I suspect they
write code along the following lines...

  int
local_variable_for_the_total_of_all_items_from_an_array_of_arbitrary_values
= 0;

  for (int
local_variable_holding_loop_index_counting_through_array_subscripts =
0; local_variable_holding_loop_index_counting_through_array_subscripts
< parameter_holding_an_array_of_arbitrary_numeric_values.length ();
local_variable_holding_loop_index_counting_through_array_subscripts++)
  {

local_variable_for_the_total_of_all_items_from_an_array_of_arbitrary_values
+= parameter_holding_an_array_of_arbitrary_numeric_values
[local_variable_holding_loop_index_counting_through_array_subscripts];
  }


Wow, that's just so amazingly readable, what with those long
identifier names!

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list