Readability and naming.

Mike Gerfin gerfin at ieee.org
Thu Jan 11 08:25:41 PST 2007


== Quote from Steve Horne (stephenwantshornenospam100 at aol.com)'s article
> 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!

Haha, nice.  I'll agree, naming can be abused in both directions.



More information about the Digitalmars-d mailing list