cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: How do i get commit access (for C2)?
Date Tue, 10 Oct 2000 14:04:56 GMT
"Pier P. Fumagalli" wrote:
> 
> Ovidiu Predescu wrote:
> >
> > I don't want to bend too much on this, but I noticed that some of the files
> > don't obey the rule of having less than 80 characters per line. Is this
> > something considered acceptable?
> 
> I don't have problems w/ that, as my editor usually is set at 132
> columns. My rule of the thumb is "don't squeeze it too much, if it
> doesn't fit, it doesn't", but if it fits, it's good to keep it under 80
> columns...
> 
> Since this discussion is currently going on also into several other
> projects, why don't we specify it once for all (as we did in JServ
> times) and post it somewhere?
> 
> I believe we all agree on the Sun's Java Coding Conventions + Force
> Spaces instead of Tabs, what about Column #80?

It was generally left to the developer. Some C programming coding
conventions stated that if you code doesn't fit column 80 and tab 8 your
code is wrong.

For sure, in Java this doesn't hold true anymore, mostly due to the
incredibly long class names.

Ricardo invented an effective syntax for multiple nesting that normally
results in long lines.. such as

 PrintWriter writer = new PrintWriter(
    new InputStreamReader(
        new FileInputStream(
            new File(
               System.getProperty("some.file")
            )
        )
    )
 );

which is good for many reasons:

 1) it's visible
 2) it rarely goes to column 80
 3) it helps controlling the number of brakets.
 4) it doesn't need placeholding variable that you don't use later on.
 5) it's clean

This is a generally new code convention and it was not used extensively
in Cocoon2 (I admit I don't use it myself since I don't mind the column
80 since I have never print code)

So, my suggestion would be:

 1) if you have to count brakets or made a syntax error because of a
missing braket, use the above multi-line syntax.
 2) try to be col80 friendly, but don't sacrifice readability for it.

But these are not rules, these are suggestions and don't make the code
so bad if they are not coherently used.

Avoidin tabs and coherent curly braket usage are much more important
issues IMO.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message