Re: What coding standard are you using for C?The



Andrew Smallshaw wrote:

On 2009-11-05, Paul Carpenter <paul@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Despite C, being free format, avoid too much free format, remembering
that at some time it may well be printed, 300 character lines wrap
very interestingly, if they wrap. Choosing indentation matching
can make following the code easier, even if you have managed
to get the function to fit on one page.

I keep getting criticism for ignoring an imagined 80 column limit.
Yes, I'll keep it under 132 columns but not 80 - it just gets too
restrictive and demands either less indentation of cyptically short
variable names which are a much bigger problem. 132 (sometimes
136) is of course how long a line can be printed on a wide carriage
printer, so it is largely historical now, although is does approximate
what enscript -r can fit on a sheet of A4 with default settings.
With modern text editors under GUIs you are typically not limited
to anythign like 80 column views so I see no practical reason to
stick to such a narrow limit.


You would hate working to my standard then.

* There is a 64 character limit to the width
* There is a limit on how deep a structure can be
* There is a request that each sub-routine is kept within
16 lines but absolutely no longer than one page.
* It is also demanded that each subroutine has a description
of its function, the required input parameters and what the
expected output parameters.

Less important is the indent style but I do like a very clear layout that
highlights the structural integrity of the subroutines.

* Clear phrasing is expected.

Then, I code in Forth and by adopting my standard I am assured that I can
easily work through reviews and tests easily to fully certify the codes
correctness.

--
********************************************************************
Paul E. Bennett...............<email://Paul_E.Bennett@xxxxxxxxxxxxx>
Forth based HIDECS Consultancy
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-510979
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************

.



Relevant Pages

  • Re: What coding standard are you using for C?
    ... Despite C, being free format, avoid too much free format, remembering ... very interestingly, if they wrap. ... relying on specific software or printers, ... character encodings can be a pain. ...
    (comp.arch.embedded)
  • Re: What coding standard are you using for C?
    ... Despite C, being free format, avoid too much free format, remembering ... very interestingly, if they wrap. ... Elite I get just about the right font size for readability, ... And printing landscape, while acceptably printing ...
    (comp.arch.embedded)
  • Re: Logic failure..
    ... > I've been writting a HTML parser and ran into pretty much ... > single buffer and scanning the text 1 character at a time. ... I need to find me a good point to wrap".. ... I end up with extra <url tags> as resizing events occur and ...
    (borland.public.delphi.non-technical)
  • Re: What coding standard are you using for C?
    ... Despite C, being free format, avoid too much free format, remembering ... very interestingly, if they wrap. ... I keep getting criticism for ignoring an imagined 80 column limit. ... what enscript -r can fit on a sheet of A4 with default settings. ...
    (comp.arch.embedded)
  • Re: Hide non-printing characters.
    ... As you say wrap text removes the LF square - but not the others in 2000. ... number keypad) to enter the character into the Other box in the text to ... Debra Dalgleish has some notes how to implement macros here: ... I have imported some data into Excel as a CSV file. ...
    (microsoft.public.excel)