lkml.org 
[lkml]   [2018]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: wlan-ng: improved readability of function prism2_add_key
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

\
 
 \ /
  Last update: 2018-06-20 22:09    [W:0.053 / U:1.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site