bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: imperative vs. descriptive style


From: Paul Eggert
Subject: Re: imperative vs. descriptive style
Date: Sun, 6 May 2018 03:11:38 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Bruno Haible wrote:

The GNU Coding Standards [1] don't favour either, although I have vague
memories that 20 years ago, it advocated imperative style.

Yes, I have the same vague memory, and still prefer imperative style in many cases. For routine use in comments, the imperative style is typically shorter and easier to understand. It's easier to read "Declare specific functions for X" than "This file declares specific functions for X", for example, and the longer wording does not convey enough extra information to justify its extra length.

For specs that must contain qualifiers like "shall" or "should", the imperative style does not work well, and that's a good reason for POSIX and other more-abstract specifications to not use it.

One other beef I often have with comments (including some that I write!) is that they are not sentences. At least this guideline *is* in the GNU Coding Standards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]