lkml.org 
[lkml]   [2013]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: checkpatch guide for newbies
Am 26.09.2013 05:48, schrieb Al Viro:
> On Thu, Sep 26, 2013 at 05:27:15AM +0200, Alexander Holler wrote:
>
>> Oh, personally I don't have any limit there. ;) I like descriptive
>> function and variable names whenever they make sense. And often they
>> make comments uneccessary and therefor prevent errors because those
>> descriptive names are visible whenever the function or variable is
>> used, and comments usually appear only once and get forgotten when
>> scrolled out of the screen.
>>
>> But just take a function like
>>
>> void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim,
>> struct timespec *wtom, struct
>> timespec *sleep);
>
> Charming... Now, try to tell one such name from another, when the
> only difference is buried in the middle of long phrase. And yes,
> I've seen mistakes clearly of that origin. Made them myself, actually.
>

Nothing is perfect. But the source of the discussion was that I don't
aggree that limiting the line length makes code more simple.

E.g. In your previous example they could have used some verbose name for
"flag" without having to cross an obvious non-existing limit. Such the
author might have seen the "problem" early himself. And I think we all
do sometimes write silly code, even when we should know it better.

E.g. my first version of something like your example don't have
necessarily been better as I'm usually first write something down which
I believe should work, not taking care about anything but functionality.
Then I take a break and have a second look in such a way like you just
have exercised it. And I think most people are unable to write perfect
code right out of their fingers. Of course, I think I got much better in
avoiding deep nesting right from the beginning, but I'm sure I still
write sometimes stupid code. And then there are those time constraints
one just has to withstand, besides the fact that it happens sometimes
that I just don't won't to have a look at my own code again. (The last
limit is often reached by endless reviews with comments to remove a
space here and rename a variable there). Nothing is more annoying than
rewriting source until it looks like if the commenter has written it.

People do think differently, people see code differently and people
write code differently and trying to unify that with unnecessary rules
just annoys almost everyone. I do like it if I can tell who has written
some code by just looking at it, at least if it is readable and isn't in
some obvious uglyand hard to read and hard to understand state.

n8,

Alexander Holler



\
 
 \ /
  Last update: 2013-09-26 06:41    [W:0.073 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site