In article <>,
says...
> On 2009-11-05, Paul Carpenter <> 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.
Can do, but excessive indentation levels is often an example over
complexity and the need for restructuring or extra function(s).
> 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 a Landscape mode print can do.
> what enscript -r can fit on a sheet of A4 with default settings.
Never assume anything other than a simple text file print is possible
relying on specific software or printers, is the standard assumption
that you will be the only person ever wanting to print out any part.
Just like 'lock-in' IDE's that use encrypted project files.
Some types of work will require printouts, as paper is still a VERY
good archive method as it can be read for many more years, than most
media. How many systems still have 3.5" floppy drives?
> 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.
Hopefully you are dealing with standard text files, as paper
printout can be read where even some text files using strange
character encodings can be a pain.
Can you guarantee that any software written will only need to be
supported for about two years after release? That is about the
average timespan before some change means it can be difficult
to read some files due to things like
OS change
Tools version change
Tools (including editor change)
Media no longer available
printers or other changes (wide carriage no longer available)
Vanishingly few people actually go through their archive of projects
and all current releases to ensure that all files can be read/edited
and rebuilt, when they have one of the above changes. Generally it
suddenly becomes a problem because someone has to examine some
old code.
Coding standards are about maintainability as well as current
tasks.
--
Paul Carpenter |
<http://www.pcserviceselectronics.co.uk/> PC Services
<http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font
<http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
<http://www.badweb.org.uk/> For those web sites you hate