lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV Coding & submission style


From: Andrew Kuchling
Subject: LYNX-DEV Coding & submission style
Date: Fri, 24 Jan 1997 16:32:03 -0500 (EST)

My heart bled when I saw how much Fote had to reorganize my cookie
code before integrating it into Lynx... yikes!  The ideal would be to
submit patches that don't need to be edited by Fote or Rob or whoever
before including them, and the solution is to settle on a coding
style, much as the Linux community has done.  (See
http://recycle.cebaf.gov/~doolitt/Linux-coding.html, 
or Documentation/CodingStyle in the Linux source code.)

        So... what should the Lynx coding style look like?  (Once a
style is agreed-upon, I'll figure out what settings are required to
make Emacs cc-mode support the style.)  Some thoughts:

         * Functions should be defined using the PUBLIC or PRIVATE, and
 the NOARGS or ARGS1, ARGS2, ... ARG10 macros.  Example:

 PUBLIC int edit_current_file ARGS3(char *,newfile, int,cur, int,lineno)

         * Opening curly brackets nestle up to the conditions of a
 while or if.  Example:

         if (LYValidate) {
            ...
         } else if (traversal) {
            ...
         } else {
            ...
         }

         * Indentation seems to be inconsistent from file to file.
Some places use 4-space indents, others use tabs.  Any preference?

         * Document the parameters and return values of functions 
in a comment block before the function definition.

         * Large blocks of comments should be formatted like this:

 /*      Entity values -- for ISO Latin 1 local representation
 **
 **      This MUST match exactly the table referred to in the DTD!
 */

         * Messages presented to the user should be made a #define in
 LYMessages_en.h, and not hardcoded into the source code.

        Any other thoughts, you coders out there?


        Andrew Kuchling
        address@hidden
        http://www.magnet.com/~amk/
Save the Gutenberg Project! http://www.promo.net/pg/nl/pgny_nov96.html
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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