What's your maximum line size preference?

N

Nick Keighley

Gianni Mariani wrote:

I will only insert an EOF character according to my own rule as follows:

1. After a semicolon
2. After the head part of conditional sentence (if, then, for, do,
while, switch, etc)
3. After {

and END-OF-FILE character?!
 
J

James Kanze

Tremblay) wrote:
Don't get me wrong.  The huge majority of my code is less
than 80 chars.  I do appreciate narrow simple lines.  Just
that I dislike a hard rule that nothing should ever be wider
than 80 chars because IMO it is outdated and results in
lower readability.
If the huge majority of your code's lines are less than 80
characters, how could limiting those few other lines make a
big impact on readability?

Having made a very strong statement in favor of a hard limit,
I'll now take the other side: there have been a few times when
I've been very tempted to violate the limit, sometimes by a lot.
The most frequent case is statically initialized tables: it
would be very nice (and much more readable) if I could make each
line in the table a line in the source code.

[...]
I agree; guides, not hard rules (in most cases).

Rule 0 of any guidelines: any other rule in the guideline can be
violated with sufficient motivation. Typically, in a larger
organization, it will mean that you'll have to get it signed off
by your boss, or the architecture team, or someone in Q&A; in
more typical orgainizations, all it really means is that you'll
have to defend it in code review, and convince the reviewers.
 
S

Stephen Horne

and END-OF-FILE character?!

Obviously a Java programmer. They already had a one-class-per-file
rule years ago, irrespective of how trivial that class might be.

Obviously they've taken the idea further ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
TopCryptoTxSoftwares2024

Latest Threads

Top