Is there any good reason for 80 char line limitation?

38 views
Skip to first unread message

Vladimir Sitnikov

unread,
Apr 7, 2014, 1:04:57 AM4/7/14
to opti...@googlegroups.com
Dears,

Subj.
I find 80 characters a way too low limit. It does not even allow me to write both sides of a comparison on (in?) a single line for boiler-plate comparator code (see my recent pull request to linq4j: https://github.com/julianhyde/linq4j/pull/12)

I wonder what is the typical screen size used for linq4j/optiq development.
I use 27" Dell 2560x1440 and 80 character limitation is just rediculus.
If you don't already have one, I highly recommend at least 27".

I understand there should be some hard limit, but 80x25 does not belong to the 21th century programming.

Vladimir

Jacques Nadeau

unread,
Apr 7, 2014, 1:19:23 AM4/7/14
to opti...@googlegroups.com
We use 120 on Drill and I now think that is too low :)



Vladimir

--
You received this message because you are subscribed to the Google Groups "optiq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optiq-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julian Hyde

unread,
Apr 7, 2014, 6:55:24 PM4/7/14
to opti...@googlegroups.com
There are a few factors. Together I think they make a good reason. You may disagree. :)

Unlimited width is not an option, and you never seem to find a limit that pleases everyone.

I use a macbook air 13 (1440x900) when I'm on the road (or on the couch). An intellij side-by-side diff with line numbers looks like this: http://www.hydromatic.net/scr.png. Note that there's only a bit of space on the end of each line.

When you're used to it, narrow code -- like narrow newspaper columns -- is easier to read. For me, anyway.

I'd be up for increasing the limit a bit, but then we'd have a debate, and then we'd have to re-format the code.

Julian

Vladimir Sitnikov

unread,
Apr 23, 2014, 9:23:46 AM4/23/14
to opti...@googlegroups.com
Ok, one more data point: github's diff view is 119 characters wide (macos, Chrome, 100% zoom)

What do you think if we try increasing the limit to 120 and reformat incrementally as patches are coming?
In other words, we enable to use up to 120 characters, while still trying to keep "easy to understand" code (e.g. breaking a line at 60 or 70 if that makes it easier).
Finally, checkstyle cannot understand if the code is easy to read or not and we need some sort of generic sense anyway.

Julian Hyde

unread,
Apr 23, 2014, 2:59:08 PM4/23/14
to opti...@googlegroups.com
Lots of projects still have an 80 character limitation. Sun’s coding conventions; the JDK; hadoop; the linux kernel; python’s official style; postgres. (Yes, those developers all have wide monitors too.)

It is possible to break lines in a way that preserves (and often increases) readability. Writing and reading code broken over multiple lines is a skill. Once you have learned it, you do not see 80 columns as a limitation, just as you don’t wish that we could code in red, blue, green and bold and italic typeface.

At some point in Optiq’s lifetime, we will debate coding conventions as a community, collectively decide what they should be, and reformat all the code to match. Now is not the time.

Checkstyle is just a tool, and it is imperfect. If you don’t like it, fix it, or suggest a better tool. Of course people need to use their discretion but not if that means stamping their personal style on code they’ve written.

Now, that’s wasted 45 minutes.

Julian

Reply all
Reply to author
Forward
0 new messages