Re: [AD] Allegro's mixer, update

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Chris wrote:

> Why would you use cat, more, less, or type to read source code? The only 
> reason I can think of would be to take a quick glance, in which case I 
> don't see it as a big problem that indents may be a little too wide.

First, what programs I use is my business, and although it may be easy
for you to assume that because you always use an editor to look at
code everybody else does too, it's not true. In unix it's much more
common to use programs like less to examine text files.

Second, it's not just less, it's the output of _any_ text based
program that's not a full-fledged editor. Output of things like diff,
grep and the likes gets messed up, and more importantly, email. If you
cut and paste allegro source into an email, it looks ok now. If people
start using tabs in places where they're not meant to take up 8
spaces, it looks bad.

I did mention that one way to solve it is to _always_ use tabs for any
indentation, code would at least look properly aligned at 8 spaces
that way if you look at it in a simple text program. You're not
allowed to ever use spaces then, though. That causes problems for
other people that have editors which do not insert tabs
automatically. (Those do exist, makefiles cause lots of trouble
because they require the use of literal tab characters).

> As has been already mentioned, any editor worth its salt can change the 
> tab size(hell, even DOS 6.22's edit.com can). The difference is, you 
> wouldn't be forcing anyone to use a specific tab size, so they can use 
> their custom tab size and be happy.

My reasoning is similar: let programs that _can_ adjust the tab size
do so, so the code looks proper in programs that can't. The one
guideline allegro really sets is that indentation is 3 spaces
(everyone has to deal with that), the tab=8 spaces is only so that
not-so-clever programs still show the code properly.  If you're editor
isn't clever enough to set indent to 3 spaces _and_ print tabs as 8
spaces, you have two options: either deal with it and type spaces, or
use indent to automatically format the code after you're done with it.

> I'll look into it, but it already sounds a bit complex.

It's not, you just need to download the program and run it with these
options:

-kr -nce -ss -ncs -i3 -cli3

The CVS version of allegro contains a file 'indent.pro' with those
options, so indent will do things "the right way" automatically.

> In the end, I don't really care what anyone indents with (within 
> reason). But assuming the size of a tab, and using a tab as a 
> multi-space replacement, is a big nono for me.

As I said, a topic of holy-wars. To me, the big nono is to assume that
people won't look at the code in a simple text-program.

I hope that explains my point, I'm sure things will stay the way they
are for now, but maybe the convention will be changed for the next
major allegro version, if enough people agree.

      Hein Zelle

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
 Unix is user friendly. It's just very particular about who 
 it's friends are.

 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/