[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - trivial programming language



Kai Grossjohann wrote:
Steve Lamb <grey@dmiyu.org> writes:
if (foo){
 if (bar){
   foreach $foo (@bar){
     while $foo < $baz{
       some really long and convoluted computation here
     }
   }
 }
}

Now expand that out to someone's preferred 8 per line (ewwwww) and
you'll see that the "some really long and convoluted computation
here" is wrapping. On my screen it looks reasonable, on someone
else's it looks like crap.

Well, nothing that couldn't be solved with a somewhat wider window. Many people like to have windows wider than 80 columns. (I prefer 80
columns, myself.)

This is not an adequate response to scenario's similar to what Steve illustrates here. I will elaborate below.

It is because of this mixing of tabs and spaces that people rigidly
say that tabs should never be changed from 8 character widths.

The style I'm proposing is designed to make it possible to change tab
width!

It does not work.

Consider the problems created with a code file created by a user who prefers 8-character-width tabs _and_ 80 columns.

Now, when someone who prefers 4-character-width tabs and 80 columns wishes to collaborate on this document, he or she will find lines wrapped at ~65-75 characters as they were originally wrapped for 8-character-width tabs and 80 columns.

In this case the 4-character-width tabs user has only one option to retain a style acceptable for use by the 8-character-width tabs user. He or she must wrap lines such that for a given line, were it displayed with 8-character-width tabs, it would still fit within 80 columns.

First, this requires that the user perform a tab width calculation for each wrapping to determine where it would wrap were it displayed with 8-character-width tabs. Second, this defeats the original intention of the 4-character-width tabs user in using 4-character-width tabs: to use a indent width he or she can more easily follow visually and while at the same time making more effective use of 80 columns for complex code.

As illustrated by Steve's example above, in either direction of conversion, your proposal may as well be to mandate that the tab width and column width of the original environment for all collaborating users, because for your proposal to work, you must deny the user the ability to reap the advantages of his or her preferred environment.

The best proposal is to mandate a fixed tab width or spaces per indent level, and mandate wrapping for a fixed column width.

I'm ready to argue that this should generally be 4-character spaces and 80 column wrapping.

dircha



Reply to: