Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[stellation-res] Source code line length

In a recent posting, Florin mentioned that he would like to see source code
line lengths restricted to 78 characters to allow viewing on small screens.
The other place where this rule can help is when printing source code.

As an experiment over the weekend, I tried seeing what it would take to keep
Stellation code within this limit and came up with several readability
problems. I found that it was normally possible to find some format that
would allow the code to be restricted to a 78 column width, but what would
happen is that a statement that started as a single line could wind up
becoming 4 or 5 lines and be very difficult to follow the flow because of
the unnatural structure of the statement.

Another related problem if this limit is to be enforced is the the Eclipse
Java editor uses a proportional font by default which means that code that
looks OK in Eclipse may not look so good in another editor that uses
mono-spaced fonts.

One change to the current coding standards that could help considerably if
we chose to follow this guideline would be to make the tab size two
characters instead of four. With the current style, indentation can rapidly
chew up valuable screen space on the left hand side.

I think it is woth discussing these issues and coming to a consensus on
whether to include them in the Stellation coding standards.

From a personal point of view, I don't hold a strong opinion since all my
computers at home have large screens and I never print source code. However
there would be one benefit from my point of view in that this limit would
make it easier to tile several files in the Eclipse editor.

The other significant benefit is that it makes the code base easier to work
with on resource constrained machines. The downside is that code can rapidly
become more difficult to read because it winds up being spread across more
lines vertically.

What do you people think?

Regards

Jonathan

Personal Email
jgossage@xxxxxxxx

Business Email
jonathan@xxxxxxxxxxxxxx







Back to the top