What’s Your Max Line Width?

March 19, 2006 – 14:39 | fisheye, java

I have recently been asked to review some development team’s Java coding convention. Just when I was about to flip over the page that says “the maximum line width is 80 characters,” I had this sudden realization that we were actually in the year 2006 now. This is the age in which we use GUI IDE’s that are capable of displaying and printing over 100 characters per line at normal font sizes, and the age in which we tend to use long names for variables, methods, and classes. Why are we still limiting ourselves to the 80-character limit which is basically a relic from when we had to telnet to a server, and vi our code?

Trackback from your site, or follow the comments in RSS.
  1. 6 Responses to “What’s Your Max Line Width?”

  2. Good question. We have the same limit. I was told it was so we can print our classes. How many people do that?

    By john smith on Mar 19, 2006

  3. My IDE shows a light grey line at 120 characters. I sort of try to keep lines shorter than that but it’s a suggestion and not a rule. I have not printed code in a long time except for trivial code fragments that could fit in 50 column areas.

    By Sandy McArthur on Mar 20, 2006

  4. I too think the limit could be more. Perhaps 100 or so. Too long and it could get ugly. Also, you need some horizontal real estate for all the IDE tools.

    By Michael Slattery on Mar 20, 2006

  5. 100 here.

    By tim on Mar 20, 2006

  6. That is an interesting Idea. I am not a professional coder, and am only learning visualbasic.net and C++, so… yeah… it’s an interesting idea. :D

    By Jose on Mar 28, 2006

  7. One good reason to limit the length of your lines is for comprehensibility.

    It’s a reasonably well know research outcome that lines of 60 characters are optimal when authoring documents in order to maximise comprehension. Make your lines too long and people start to skip words at the start and the end of the lines.

    IMO, code works the same way. Particularly when reading someone elses code, the layout
    is quite important for trying to understand what’s going on.

    By Dan on May 12, 2006

Post a Comment