On 7/26/07, Nicola Larosa <[EMAIL PROTECTED]> wrote: > > Tom Tobin wrote: > > I'm starting to seriously wonder if the 80-character line width has > > outlived its usefulness. > > It has not, and it never will, until human beings stay the same: it's not a > technological limitation.
I'm guessing that should have been "until human beings change"? It certainly seems to have *started* as a technological limitation, even if programmers profess other reasons for retaining it these days. > > There are various naturally occurring bits > > of code that just don't fit onto a single 80-character line, and the > > options for chopping it up are all sub-optimal; > > Those options do not decrease readability, once you get accustomed to them: > it's just an initial phase. Remember your first hours staring at Python > code? ;-) I've been coding Python for many years; I doubt my feelings are part of an "initial phase". :P > Moreover, if a line is so long, maybe it's doing too many things, and > should be decomposed logically, before recurring to splitting it. In some cases, yes, this would be the correct thing to do. In other cases, the line really does make the most sense as one logical unit, and splitting to get under 80 lines in some of these cases *decreases* readability. > > Docstrings and comments also find > > themselves cramped for space after a few indentation levels. > > Docstrings are never indented that much; comments should be concise anyway. Docstrings for methods still get that much less room (8 characters) than module-wide docstrings; in certain odd cases (e.g., functions within functions), this can be reduced further. Multi-line comments *do* sometimes make sense. > Displaying the source code on a large screen is only one of its many uses: > the keyword here is *interoperability*. > > You want to print the code on paper. Adjust your font a bit. :P Regardless, that shouldn't be something the coder should worry about. > You want other non-overlapping windows open at the same time. Get a larger monitor. :P > You want to make manual three-way merges, with three files shown side by side. Ditto. > You want to include code snippets in emails, web pages and other documents. > > You want to display the code on smaller screens of small devices. Again, not the coder's problem IMHO. > You want readability, which is impaired by larger column widths. I'm making this (apparently quixotic, which I accept) argument in *favor* of readability. I'm certainly not recommending that anyone make lines any longer than they have to be! I'll also take a moment here to state that the number I tossed out initially, 120, was probably a bit much; 100 is more realistic. I do apologize for not thinking before I selected my example. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
