[MPlayer-dev-eng] [bikeshed] Coding style

The Wanderer inverseparadox at comcast.net
Fri Jun 20 21:55:45 CEST 2008


Michael Niedermayer wrote:

> On Fri, Jun 20, 2008 at 06:27:43AM -0400, The Wanderer wrote:
> 
>> Bryan Henderson wrote:

>>> Likewise, I'd expect a mode where TAB simply moves the cursor,
>>> inserting spaces (or even a tab) only if necessary to get over
>>> there. That would come in handy editing lots of things.
>> 
>> This would still require the user to switch back and forth between
>> the tab key and whatever other keys in order to switch between
>> moving through leading whitespace and moving through actual text.
>> 
>> I am not saying that there is a satisfactory solution to this. I am
>> simply saying that this may be one case where there are trade-offs
>> to using tabs vs. using spaces, and different people may find
>> different combinations of those trade-offs acceptable.
> 
> If you are so in love with tabs ;)

I'm not, necessarily; I originally commented only as a way of pointing
out a possible reason for using tabs other than the one which had been
mentioned as the only one Bryan Henderson knew of. I am certainly
capable of working with code which uses spaces instead of tabs, and I do
not find (or, at least, to date have not found) it to be prohibitively
aggravating; it's just less convenient.

Philosophically speaking, I agree with the perspective that code-block
indentation should be done using tabs, but other indentation (e.g. for
vertical alignment within a level of nesting) should be done using
spaces - essentially, tabs should be allowed only if there are no
previous non-tab characters on the line. There are problems with that
approach - I've seen some pointed out in the past - but I find them less
problematic than the problems with any other approach I've seen so far,
and I don't remember any of them at the moment in any case.

> why not just convert the whole mplayer source to use tabs locally and
> add a little wraper around git/svn that converts them back to spaces
> before running any git/svn command. I mean that way git/svn will
> always see spaces and your editor tabs. It might need 2 directory
> trees though.

If I were actively working on MPlayer and found this to be a big
problem, I might just do that. As things stand, however, that would just
be more trouble than it's worth.

> No iam not giving up. Differences in editor behavior between tabs and
> spaces are bugs and could be fixed ...

That's an interesting perspective, and one which I might be able to
agree with, but I think a lot of philosophy and design argument would
have to be hashed out before it could really be taken anywhere.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.



More information about the MPlayer-dev-eng mailing list