[OT] Tabs / Re: [PD-dev] Looks like there's a song position pointer bug
Miller Puckette
mpuckett at man104-1.ucsd.edu
Sat Sep 27 22:37:07 CEST 2003
Just to throw in my own 2 cents... The Pd sources are: tabs 8 spaces
(their historical value), indentation 4 spaces. This unfortunately means
that Pd does mix spaces and tabs for indentation. However, there's no
rule that says that Pd source files have to use tabs at all; the indentation
may be implemented using all spaces. However, I haven't set my own text
editor to avoid tabs. Most text editors will at least allow you to set
tab to 8 spaces, although some of them then assume that of course you want to
indent 8 spaces too, which is inappropriate for Pd code, since I also adhere
to a limit of 80 columns.
cheers
Miller
On Sat, Sep 27, 2003 at 09:03:48PM +0200, Frank Barknecht wrote:
> Hallo,
> Larry Troxler hat gesagt: // Larry Troxler wrote:
>
> > On Saturday 27 September 2003 05:16, Frank Barknecht wrote:
> > > As a tab is just one character and not 8 or 2 or 4, there is no "rule"
> > > on Unix that it is eight spaces normally. The eight character thing is
> > > just the width, some editors like to show a tab.
> ...
> > > In Pd or any C language this is really no problem at all, but I do
> > > program a lot in Python, and here a community project has to agree on
> > > one single indentation/tab style.
> >
> > Frank, what you're describing is how tab characters are intended to be used.
> > The problem is that all too often, they are used incorrectly; sometimes both
> > tabs and spaces are used for indentation, or a tab character is used to
> > indent to a specific character position. In these cases, I'm forced to try
> > different tab spacings until I find the "right" one.
>
> Ah, okay. Now I understand. So the tabs aren't the problem, the mixing
> of tabs and spaces is, because everyone and their sisters use
> differnet expansion widths.
>
> Well, in Python, this is a real problem, that's why Python projects
> often have a style guide re. tabs, for example Webware has it here:
> http://webware.sf.net/Webware-0.8.1/Docs/StyleGuidelines.html
>
> Webware has nice rules, IMO, which are:
>
> Spaces are not used for indentation.
>
> The real problem is mixing tabs and spaces for indentation as people
> have their tabs set to different widths (commonly 4 or 8). Tabs have
> been chosen because they're convenient, efficient and fast to cursor
> through.
>
> Tabs are not used past initial indentation.
>
> To avoid alignment problems between people who have tabs set to
> different widths. A common use of tabs is to align the values of a
> dictionary or the right hand sides of several consecutive assignment
> statements. There is no problem when using tabs for indentation, but
> when they are used past non-tab characters, the alignment will be
> skewed when the tab width is changed (e.g., when a different developer
> with a different tab width views the code).
>
>
> In C it's more a cosmetic issue. CVS I think doesn't do anything about
> it: spaces stay spaces and tabs are tabs in the repository.
>
> ciao
> --
> Frank Barknecht _ ______footils.org__
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev
More information about the Pd-dev
mailing list