Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Are 80 Columns Enough? 763

ThinkGeek writes "Dating back to the venerable DEC VT100, the 80 column terminal has served us well for over 25 years. Even now, many open source projects and common conventions require lines of code and documentation to fit on that terminal. I am not alone, judging by code I've seen in and out of the open source world, in finding that number insufficient for coding, much less more verbose writing. Given that modern graphical displays (and all popular editors) are capable of far more, is it time we came up with a new standard-sized terminal? If so, what should the new standard be?"
This discussion has been archived. No new comments can be posted.

Are 80 Columns Enough?

Comments Filter:
  • First Column! (Score:5, Interesting)

    by Harmonious Botch ( 921977 ) * on Saturday July 07, 2007 @05:35PM (#19782991) Homepage Journal
    80 columns ought to be enough for anybody.

    Seriouslly, IIRC, there still may be lots of old printers still functioning out there that use 132 columns.

    Let's check that for ergnomics...my first computer had a 9-inch screen ( an old Kaypro, BTW ) and used 80 columns. 80/9 is about 9, so now with my 20 inch screen, 20 * 9 = 180... then scale things up a bit to allow for the eye fatigue that comes with age and 132 looks ok.
  • My thoughts (Score:5, Interesting)

    by julesh ( 229690 ) on Saturday July 07, 2007 @05:36PM (#19783001)
    I find I tend to work to about 100 - 110 columns most of the time. I'm not precise about it, but I find that that width
    lets me use a readable font and still have enough space at the side of the code for a window with which to perform useful work (e.g. list of files in current project for easy access / unit testing GUI).
  • Advantage? (Score:2, Interesting)

    by pete-classic ( 75983 ) <hutnick@gmail.com> on Saturday July 07, 2007 @05:47PM (#19783105) Homepage Journal
    What is the benefit of defining a new arbitrary limit? Assuming 80 columns is still useful. Do you think you can supplant 80 column? Or do you want to add another arbitrary limit, so that people can pick and choose?

    Since 80 column is still immensely useful, why don't we stick with that where we can? For most other applications you can work in GUI land with dynamic wrapping and lovely variable-pitch fonts.

    There is a relationship between how many characters you put on a line and how far apart the lines have to be to be readable. You might find that it is harder to improve on this venerable standard than you imagine.

    -Peter
  • by DigitAl56K ( 805623 ) on Saturday July 07, 2007 @05:54PM (#19783177)
    Use blockquote or some other markup feature?

    My suggestion is to use some kind of markup language to handle the formatting. There is no reason it couldn't include a feature to manage line wrap appropriately for both plain text and code.
  • by ZyBex ( 793975 ) on Saturday July 07, 2007 @05:58PM (#19783223)
    Well, 128 columns has its advantages. And why not 64 lines? - powers of 2, like everything else in computing - screen math would be easier ans faster, just shift some bits to calculate the position - This would imply 40 columns to maintain the current proportion, though (or make it 42 - hi Douglas! :) ... I usually wish for more lines than more columns, and usually work with 50 lines; so I think it would be nice to default to 128x64 chars. Also, 80 columns exists for a reason; its the 640x480 standard resolution divided in 8 pixel columns. Changing to 128x64 would imply using a resolution of 1024x768, using chars of 8x12. Perfectly acceptable, I think.
  • by buckhead_buddy ( 186384 ) on Saturday July 07, 2007 @06:15PM (#19783367)
    As far as what actually displays the text, 80 columns is just a convenient default in this era of GUIs and IDEs. But the idea of 80 columns as a standard starts kicking over an ant hill of all sorts of other standards and conventions about code formatting (comments, tabs & white space, where do brackets go).

    The last step of submitting code back to most projects these days is to format it according to the standard rules of the project. At least to me that's always seemed to be a non-productive workaround for lazy programmers. In most languages white space is meaningless and the burden of formatting is a burden on all of the programmers individually.

    When the world of typewriter users started making adjustments to desktop publishing, a similar set of problems came up. How many spaces do we need to indent? How long should our lines run? Should we single-space or double-space? They quickly deduced the proper way to solve this was to let the computer (under direction of the editor or typesetter) to add the formatting. All the users needed to do was to submit the text in a way that such automatic tools wouldn't jam the automation.

    In many ways, programmers don't want to make that jump for their own tools though. They've been using VT100 terminals, diff, and simply demanding everyone adhere to the same "sensible" standards for formatting. In these days of object oriented programming where names of classes start getting longer (Cocoa, Java, Ruby, to name a few) the standards seem more of a burden, but no one really feels the need to demand the code formatting be made independent of the code itself.

    As horrible as it sounds, perhaps a tool that parses code into machine formatted XML for exchange and extracts it into code for use or viewing, is what's needed so that programmers can place the burden of "formatting" on the machine rather than the programmer. Technically it seems possible (with dynamic color coding and syntax checking that exists already). And yes, it sounds like a heinous burden both on storage and on users who prefer lightweight tools like dumb terminals. But it would simply be an extra step for a tool to extract the source into each person's personally preferred format rather than saying a certain convention will always work.

    I wish programmers would wake up and realize that when they set standards like certain column length and white space conventions, they are actually working against automation and having the computer help them out. It sounds a lot like the old typewriter users who insisted "I don't need these fancy computers to help me out!"
  • by Duhavid ( 677874 ) on Saturday July 07, 2007 @06:19PM (#19783395)
    Working with VB and VB.Nyet, I have to tell you that having the
    IDE do much of anything like this for me only serves to royally
    piss me off. I have been working in these for a number of years,
    off and on, and it continually manages to be a source of
    infuriation to me. I doubt you will like the results.
  • by MichaelSmith ( 789609 ) on Saturday July 07, 2007 @06:27PM (#19783441) Homepage Journal

    Urban myth perhaps? There's no relation between screen widths and punch cards.

    The mainframe which I used at college ran an IBM OS. If I wrote a 15 line script to run a batch job the OS would send me back a message saying 15 cards read.

  • by xjimhb ( 234034 ) on Saturday July 07, 2007 @06:28PM (#19783449) Homepage
    What if you are writing APL programs? The classic APL one-liner could easily require a screen width of 1000 characters or more. I can recall a class I was taking, the Prof put up an example which flowed across FIVE or SIX blackboards. If we're going to come up with a new standard, shouldn't we take this into consideration?
  • by OzPeter ( 195038 ) on Saturday July 07, 2007 @06:35PM (#19783513)
    Rather than talk about the number of columns in a flat file, I think the issue should be more about why we are still using flat files to write source code in the first place. Why are we still doing this? Why not a programming mark up language akin to way that HTML is a presentation language? In that way people could display code to their preferences and this entire issue would be moot.
  • by fm6 ( 162816 ) on Saturday July 07, 2007 @06:46PM (#19783621) Homepage Journal
    Actually, the 80-column format goes back a lot longer than the . IBM standardized on 80-column punched cards in 1928. Typewriters that do roughly 80 characters per line (with 1-inch margins) have always been common.

    But that's all irrelevant. You're looking for one of those backward compatibility issues, like the QWERTY keyboard and those railroad tracks supposedly designed by the ancient Romans [snopes.com]. You won't find one here. Sure, terminal emulators and text editors typically default to 80 columns — but they all let you change that default.

    The fact is, when you're editing source code, you need to put some reasonable limit on your lines. If you don't, your code is a nightmare to maintain. Doesn't have to be 80 columns; I use (stops to look at his .vimrc) 70 columns. Do you want to make it longer? OK, make it 100 columns. Make it 150. But the longer you make it, the fewer people you will be able to share your code with.

    Or are do you dislike having any limit? That would mean that you don't have any trouble reading source statements that wrap at random places. Well, goodie for you, but most of find that a pain. That's why software projects like you to use 80-column code lines. It has nothing to do with any fossilized VT100 meme.

    As for "more verbose writing": if your prose is so nonconcise that you need longer input lines, you need to take a writing class.

    I really don't get the issue here. Is it because you can never remember to hit ENTER? Neither can I. Or most people. That's why God invented typewriter bells and text editors with autoformat modes.
  • Re:First Column! (Score:5, Interesting)

    by mellon ( 7048 ) on Saturday July 07, 2007 @06:57PM (#19783703) Homepage
    We've had 132-column terminals for a long time, but what I generally tend to jones for is taller, not wider. With a taller screen, you see more code. Then there's the whole issue of saccades, which is why for example newspapers do not run sentences horizontally across the entire page, but rather split the page up into columns. Your eye gets confused when the line gets too long - it's easier to read when there are fewer words on the screen. I suspect that when you use a lot of studlyCapsVariableNames that the eye tends to treat the whole variable as a single word, but there's still going to be a limit.

    The question I would ask is a different one: why are we using such primitive typography in our text editors? We used to see all these *beautiful* demos of text editors that used proportional fonts, boldfacing, and the like, but you *never* see that in a production system. Some other folks here have mentioned automatic line breaking. One of the problems with that is that you want the bare text to look clean even when you're not in the fancy editor, but you can just have the editor automatically indent to the existing style in the text, but show you the style you prefer.

    The programming editor technology we're using today is still very primitive. That's why coding styles are 80 columns.

  • Re:First Column! (Score:3, Interesting)

    by pvera ( 250260 ) <pedro.vera@gmail.com> on Saturday July 07, 2007 @07:09PM (#19783813) Homepage Journal
    Exactly, I just don't understand why one would want to mess with something that has worked so well and across so many varied systems.

    I went from a Tandy Color Computer 2 to a VAX 11/750 (WATFIV), then PCs, Mac Plus, VAX 11/780, more PCs, then alternating between Macs and PCs. The last thing that went through my mind was the column counts, except for WATFIV of course (first 8 columns and last 8 columns had to be kept blank).

    Nowadays, I use iTerm [sourceforge.net] and it works very well, regardless of the kind of machine I connect to. My only real source of aggravation is that in that rare occasion that I need to type a DOS command in a Windows server, the clipboard can't be accessed with keystrokes, it has to be done through menu choices.

  • by The Man ( 684 ) on Saturday July 07, 2007 @07:27PM (#19783951) Homepage
    You make an assumption that one reads the code like a newspaper. If you do, then you're doing it wrong.

    And you make an assumption that you should name every variable and function as if it were a sentence. If you do, then you're doing it wrong. Names in the 10 to 20 character range are reasonable; names in the 40 character range are not. Many locals can and should be given names like i, j, k, p, and q, and in any case don't need to be prefixed. And under those circumstances, it should be possible to get 3, possibly 4 levels of indentation into a single function without excessive line breaks or other loss of readability. If you need more than that, you need to refactor or rephrase the function. If you can't find unique names that are both comprehensible and short enough not to demand more columns, you need to reevaluate both your architecture (you're probably not managing namespaces and/or symbol visibility well) and your naming conventions (consider prefixes of 2 or 3 characters instead of 8 or 10, for example). And don't even get me started on languages like C++ that force you to type SomeLongThing::SomeOtherLongThing::SomeEvenLongerT hingWithATailAndFourteenLegs.

    It's completely possible to write readable, maintainable, well-architected code within 80 columns. And before you say "sure, as long as it's nothing more useful than Hello World," know that it's possible for such code to solve large, difficult, and complex problems without violating any of those constraints. Countless examples abound; look at the OpenSolaris kernel code for some good ones. It is, admittedly, very difficult to write egregiously verbose, needlessly complex, badly architected code in 80 columns, especially in languages designed primarily to increase complexity. So go ahead, use more than 80 columns. That's fine with me, actually; that way I'll know immediately that your code is a pile of shit without having to spend even 30 seconds actually reading it. Think I'm joking? In fact this is a real and widely-used litmus test for bad code and bad engineers. Unless it's an intern candidate who doesn't know any better, no one who sends me a code sample with long lines would ever get an interview, because I won't even read it.

  • Modern code. (Score:4, Interesting)

    by Savage-Rabbit ( 308260 ) on Saturday July 07, 2007 @07:37PM (#19784025)

    Even if 80 characters were enough in the 80's, it isn't today. One of the results of increased code complexity, tool-sets and higher-level languages, is that ambiguity and terseness must be avoided. When you're dealing with 3-4 different API's with thousands of functions, 8 letter function names would lead to insanity.
    Lets not forget that these days there are people who write functions/methods/constructors with 20+ parameters and manage to create lines of code running into 350+ characters. I know that sounds insane but I actually saw a piece of code recently where a developer was passing the same set of over a dozen parameters all over the place and this is not even the worst I have seen. Back in the stone age when I was learning C++ they used to tell us that if you find yourself regularly having to pass around the same set of, say... 4 or more variables you write a struct or a class to encapsulate them and pass that container. Judging from some of the code I get to see these days that seems to have gone out of fashion. I write OO code in multiple languages including Java and C++ and I know lines of code can get longer than they used to in golden oldie languages like C but it's still not that hard to keep your line length reasonably short. It also helps with readability. That being said when I write code in terminal windows I find 80 characters somewhat restricting. Having 100-120 characters to work with per line is what I'd like, more than 200 is IMHO to much.
  • by cs ( 15509 ) <cs@cskk.id.au> on Saturday July 07, 2007 @08:17PM (#19784341) Homepage
    Firstly, for people who trip over 80 columns no other number will be enough either; particular things will always be "just too wide". Since you will need to fold or rearrange at some point anyway, a wider terminal won't solve all your problems.

    Second, 80 columns is enough to get a decent amount of text on a display, and also code if your indent step isn't insanely wide. And it's narrow enough to read a line at a glance instead of having to scan along it. That seems a core tradeoff to me, that 80 columns does well.

    Having a widely accepted standard width provides various benefits: everyone's already aware of it and many people use it, and thus people can plan for it. Example: my standard environment has 4 80-column terminals side-by-side on a 1600 pixel display. If some loon moves to a gratuitously wider format I'll forever be mangling his code when it displays.

    The "finding that number insufficient for coding" argument doesn't wash with me; it generally means you're writing stuff too cumbersome for someone else to easily read. You can always break lines or subdivide code chunks. When I, personally, don't take that trouble it's usually laziness, not because I'm doing something inherently complex.

    For "more verbose writing", I'm assuming you mean prose. If so, you should be using a format that lets people reflow the text (eg HTML or the format=flowed plain text syntax for MIME messages); then you can work in whatever you like and I can reflow the paragraphs on my nice 80 column display. That way we're both happy. I'm doing that right here, in HTML.

    You write "Given that modern graphical displays (and all popular editors) are capable of far more, is it time we came up with a new standard-sized terminal?" No, it isn't. More pixels lets me get several terminal side by side, (man page, shell, code, output windows etc). A wider "standard terminal" will only make that harder.

    I do use wider terminals for some things, but they're mostly output windows with wide line-formatted logging. No window will ever be wide enough to fit them all, and when I use a wide terminal it only helps these pathological things, and does not solve the whole problem. So i don't consider it an argument for a wider "standard width".

  • by robbak ( 775424 ) on Saturday July 07, 2007 @08:21PM (#19784361) Homepage
    But its a really, really nice one, you'll have to admit.

    The addendum: Width of shuttle booster rockets = width of tunnels - clearance = f( width of tracks) : is also amusing.
  • by cratermoon ( 765155 ) on Saturday July 07, 2007 @09:01PM (#19784631) Homepage
    There's a solution to that, if you follow a simple rule.

    NEVER check in both reformatting AND any other change at the same go. ALWAYS reformat file -> checkin -m "formatting change only" -> make change, checkin -m "actual change message". Result: "diff current-2, current" has all the meaningful information you want, while "diff previous, current" will show only the formatting changes just in case you have a programming language where whitespace counts or some other pathological line-break factors can change how the code works.

    And just to stay on topic: human factors researchers have found that a line length of 65-70 is best for scanning. That leaves 10 or so columns for assorted decorations and programming language requirements (FORTRAN, I'm looking at your columns 1-6).
  • by robbak ( 775424 ) on Saturday July 07, 2007 @09:07PM (#19784667) Homepage
    This seems to be the Consensus: That your text should be in the order of 60 columns, but the indenting (especially in 'modern' languages) may take you well over the 80 column mark.
    In the more 'classical' languages (C, C++), more than 4 levels of indent is a sign that your code is too complex, and needs to be refactored. ( for{while{if{if{if{}else{for{while{}}}}throw (brain); ) In Java or C# the language constructs add some levels too. (Should one consider not indenting for these "always there, ignore them" levels??? I know I do! (ie: If I was using a namespace declaration, I would just type "namespace name { } //namespace name" and then forget about it.))
  • Re:First Column! (Score:2, Interesting)

    by tekiegreg ( 674773 ) <tekieg1-slashdot@yahoo.com> on Saturday July 07, 2007 @09:52PM (#19784981) Homepage Journal
    I dunno, I happily code in VS2005 using 8pt Verdana - I guess I'm just psycho :-)
  • Re:First Column! (Score:3, Interesting)

    by marcosdumay ( 620877 ) <marcosdumay@gma[ ]com ['il.' in gap]> on Saturday July 07, 2007 @10:10PM (#19785075) Homepage Journal

    "I would suggest that when you are writing code that is in excess of 80 columns you might be trying to do too much in one line."

    Or you are writing Java code :) But I entirely agree (for most languages, there is a reason java has so many specific editors). When people decided to build 80 columns teletypes, they did it for a reason, and it was not because making wider paper was difficult.

  • by suv4x4 ( 956391 ) on Saturday July 07, 2007 @10:14PM (#19785125)
    "And just to stay on topic: human factors researchers have found that a line length of 65-70 is best for scanning. That leaves 10 or so columns for assorted decorations and programming language requirements (FORTRAN, I'm looking at your columns 1-6)."

    Were those researchers using Apple II.

    Code isn't just "any text". There's lots of indenting, and colorized syntax helps scanning immensely.

    I've been using 80 columns to this day for comments, but the immense wrapping was pissing me off last couple of months. I just switch to 132 and it's just perfect.
  • by GomezAdams ( 679726 ) on Saturday July 07, 2007 @11:54PM (#19785763)
    Does anyone remember Hollerith? He devised the card for the 1880 census and it was that card that was standardized on. Hence in FORTRAN you have a Hollerith constant, meaning a string of 80 characters - if I recall my college days correctly
  • Re:First Column! (Score:1, Interesting)

    by Anonymous Coward on Sunday July 08, 2007 @01:54AM (#19786469)
    The point of a wide screen is to put multiple editor windows next to each other. That's why restricting the length of a line is useful, even if it isn't exactly 80 columns you use. Unfortunately some modern IDEs don't really support multiple editor windows at the same time, but that'll change as 24" and 30" screens get more widespread.
  • Re:First Column! (Score:3, Interesting)

    by countach ( 534280 ) on Sunday July 08, 2007 @10:20AM (#19789129)
    Maybe arbitary conventions are the problem. Use however many columns you want, convention be damned.

THEGODDESSOFTHENETHASTWISTINGFINGERSANDHERVOICEISLIKEAJAVELININTHENIGHTDUDE

Working...