You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by georgex <ge...@yahoo.com> on 2010/05/11 14:42:14 UTC

Sourcecode at 80 chars width only?

I see that the Click sourcecode is formatted at 80 chars width, but this is a
very very old
convention from the times of text based CRTs.

Why not use 120? (like the standard in most companies these days)?
It makes the code more readable, and there's no screen estate problem  - on
the contrary, there's no need to scroll down so much for every small thing.

The 80 chars width convention also makes no sense for Java since it has so
"verbose" naming (compared to the C code style), so just too many simple
statements go on a second line.

Thanks,
George
-- 
View this message in context: http://click.1134972.n2.nabble.com/Sourcecode-at-80-chars-width-only-tp5035752p5035752.html
Sent from the click-development mailing list archive at Nabble.com.

Re: Sourcecode at 80 chars width only?

Posted by Bob Schellink <sa...@gmail.com>.
Also, as I get older I increase the font size ;-)

Re: Sourcecode at 80 chars width only?

Posted by Bob Schellink <sa...@gmail.com>.
On 23/05/2010 18:37, Adrian A. wrote:

> Oh :). The practice(requirement) on most projects where I worked was to
> make the windows on the right to (auto)hide when the editor windows in
> the center has the focus. This is simple to achieve with IntelliJ, and
> I've seen others with NB doing too - I'm sure Eclipse has something like
> this too. There must be also shortcuts for each operation (for very fast
> and efficient work).


I'm pretty sure there are shortcuts for fullscreen editor mode, but dislike it personally. Having
the code hierarchy on the left keeps me orientated. In fact I've never seen developers use
fullscreen editor mode which just goes to show how different developer environments can be :)


> I checked 100 too right after George posted this thread, but 100
> wouldn't bring much - just too many simple one line statements would be
> still on two lines :( (only some of the javadocs would take a little
> less vertical space) :(.
> IMHO, if it's worth doing it, than only at 120.

I'm sure even 120 won't be enough for some statements. The other thing to consider is that source
width influence the length of statements. With 80 one generally breaks code into shorter statements
(in my mind a good thing). 120 would encourage long chained statements which are hard to unravel.

> Could you please point to that branch? (Two?) click users are about to
> publish their (re)view on the
> Ajax WIKI proposal, and I was kindly asked to take a look.

I haven't actually checked it in, it was just a local branch to experiment with. If all goes well
I'll merge it in during the week.

Kind regards

Bob

Re: Sourcecode at 80 chars width only?

Posted by "Adrian A." <a....@gmail.com>.
> I much prefer scrolling vertically than horizontally.
I would prefer not to scroll at all :).
(At most, to simply just "paginate" like in a book or PDF, but this is 
impossible with source code :) ).

> Did a quick test on my laptop and 120 is too wide.
Strange :(. I tested this on a few laptops (tiny netbook too), and on 
all it looked fantastic and much more readable than the 80 - without
any horizontal scrolling.

> I often have windows on the left and right of the editor.
Oh :). The practice(requirement) on most projects where I worked was to
make the windows on the right to (auto)hide when the editor windows in 
the center has the focus. This is simple to achieve with IntelliJ, and
I've seen others with NB doing too - I'm sure Eclipse has something like
this too. There must be also shortcuts for each operation (for very fast 
and efficient work).
The only exception is when using a GUI builder (but that wouldn't be the 
case when working on or with Click :) ).

> Perhaps 100 is more reasonable.
I checked 100 too right after George posted this thread, but 100 
wouldn't bring much - just too many simple one line statements would be 
still on two lines :( (only some of the javadocs would take a little 
less vertical space) :(.
IMHO, if it's worth doing it, than only at 120.

> Remember that not only code but also docbook will be affected by this change.
OK, ... . I intended first only the source code (especially that under 
the checkstyle scan), but it's not a problem to extend it everywhere.

> If we do make this change I'd really like to hold this off until I integrate the Ajax code which
> I've developed on a separate branch.
Could you please point to that branch? (Two?) click users are about to 
publish their (re)view on the
Ajax WIKI proposal, and I was kindly asked to take a look.

Thanks in advance,
Adrian.


Re: Sourcecode at 80 chars width only?

Posted by Malcolm Edgar <ma...@gmail.com>.
The 80 character width dates back to when code reviews were done on
paper. I have a recollection that the Sun guidelines are also 80
characters.

regards Malcolm Edgar

On Sun, May 23, 2010 at 6:06 PM, Bob Schellink <sa...@gmail.com> wrote:
> I much prefer scrolling vertically than horizontally. Did a quick test on my laptop and 120 is too
> wide. I often have windows on the left and right of the editor. Perhaps 100 is more reasonable.
> Remember that not only code but also docbook will be affected by this change.
>
> If we do make this change I'd really like to hold this off until I integrate the Ajax code which
> I've developed on a separate branch.
>
> Kind regards
>
> Bob
>
> On 23/05/2010 17:42, Adrian A. wrote:
>>>> I see that the Click sourcecode is formatted at 80 chars width, but
>>>> this is a
>>>> very very old
>>>> convention from the times of text based CRTs.
>>>>
>>>> Why not use 120? (like the standard in most companies these days)?
>>>> It makes the code more readable, and there's no screen estate problem
>>>> - on
>>>> the contrary, there's no need to scroll down so much for every small
>>>> thing.
>>>>
>>>> The 80 chars width convention also makes no sense for Java since it
>>>> has so
>>>> "verbose" naming (compared to the C code style), so just too many simple
>>>> statements go on a second line.
>>> Good catch George :).
>>>
>>> Indeed, the "80-style" makes the code uglier for Java, and also less
>>> compact and less readable than the "120-style" one.
>>>
>>> +1 for reformatting the code to 120.
>> Now with 2.2.0 out, I would like to reformat the code to 120, for the
>> reasons mentioned.
>>
>> Are there any issues why we shouldn't do this?
>>
>> Thanks in advance,
>> Adrian.
>>
>>
>
>

Re: Sourcecode at 80 chars width only?

Posted by Bob Schellink <sa...@gmail.com>.
I much prefer scrolling vertically than horizontally. Did a quick test on my laptop and 120 is too
wide. I often have windows on the left and right of the editor. Perhaps 100 is more reasonable.
Remember that not only code but also docbook will be affected by this change.

If we do make this change I'd really like to hold this off until I integrate the Ajax code which
I've developed on a separate branch.

Kind regards

Bob

On 23/05/2010 17:42, Adrian A. wrote:
>>> I see that the Click sourcecode is formatted at 80 chars width, but
>>> this is a
>>> very very old
>>> convention from the times of text based CRTs.
>>>
>>> Why not use 120? (like the standard in most companies these days)?
>>> It makes the code more readable, and there's no screen estate problem
>>> - on
>>> the contrary, there's no need to scroll down so much for every small
>>> thing.
>>>
>>> The 80 chars width convention also makes no sense for Java since it
>>> has so
>>> "verbose" naming (compared to the C code style), so just too many simple
>>> statements go on a second line.
>> Good catch George :).
>>
>> Indeed, the "80-style" makes the code uglier for Java, and also less
>> compact and less readable than the "120-style" one.
>>
>> +1 for reformatting the code to 120.
> Now with 2.2.0 out, I would like to reformat the code to 120, for the
> reasons mentioned.
> 
> Are there any issues why we shouldn't do this?
> 
> Thanks in advance,
> Adrian.
> 
> 


Re: Sourcecode at 80 chars width only?

Posted by "Adrian A." <a....@gmail.com>.
>> I see that the Click sourcecode is formatted at 80 chars width, but
>> this is a
>> very very old
>> convention from the times of text based CRTs.
>>
>> Why not use 120? (like the standard in most companies these days)?
>> It makes the code more readable, and there's no screen estate problem
>> - on
>> the contrary, there's no need to scroll down so much for every small
>> thing.
>>
>> The 80 chars width convention also makes no sense for Java since it
>> has so
>> "verbose" naming (compared to the C code style), so just too many simple
>> statements go on a second line.
> Good catch George :).
>
> Indeed, the "80-style" makes the code uglier for Java, and also less
> compact and less readable than the "120-style" one.
>
> +1 for reformatting the code to 120.
Now with 2.2.0 out, I would like to reformat the code to 120, for the 
reasons mentioned.

Are there any issues why we shouldn't do this?

Thanks in advance,
Adrian.


Re: Sourcecode at 80 chars width only?

Posted by "Adrian A." <a....@gmail.com>.
> I see that the Click sourcecode is formatted at 80 chars width, but this is a
> very very old
> convention from the times of text based CRTs.
>
> Why not use 120? (like the standard in most companies these days)?
> It makes the code more readable, and there's no screen estate problem  - on
> the contrary, there's no need to scroll down so much for every small thing.
>
> The 80 chars width convention also makes no sense for Java since it has so
> "verbose" naming (compared to the C code style), so just too many simple
> statements go on a second line.
Good catch George :).

Indeed, the "80-style" makes the code uglier for Java, and also less 
compact and less readable than the "120-style" one.

+1 for reformatting the code to 120.

Adrian.