Re: [PATCH] staging: wlan-ng: improved readability of function prism2_add_key
From: Dan Carpenter
Date: Wed Jun 20 2018 - 16:09:03 EST
On Wed, Jun 20, 2018 at 07:10:26PM +0200, Chris Opperman wrote:
> b) Added temporary "key" variable to reduce line length.
No, that's nonsense. Just fix the original variable so that it's not a
million characters long.
Using a shorter variable is good if it simplifies the code like so:
struct foo *foo = &my->random_variable[INDEX].whatever;
You've reduced 4 variable names and a butt load of punctuation down to
just "foo" so that we don't have to look at it repeated over and over
on every line.
But if you're just using a temporary variable because the original
variable name was poorly chosen, that's not the right thing.
regards,
dan carpenter