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

Re: dpkg-scanlibs

On Sun, Feb 25, 2001 at 10:29:43PM -0600, Jon Nelson wrote:
> > On Sun, Feb 25, 2001 at 10:03:58PM -0600, Jon Nelson wrote:
> > > I only see one problem with dpkg-scanlibs.py: it uses tabs
> > > tabs are evil, wichert!  Every editor under the sun uses different tab 
> > > settings.  Use spaces, my man.
> > 
> > That is precisely the reason that tabs should be used; so that people
> > can display them as they like.
> Eeek!  You misunderstand the root problem here, I think.
> Python uses indent level to represent blocks.  If those indent levels
> are different in different editors, you *change* what the program does.
> Unlike in C, where indentation doesn't matter, who cares? But with
> Python, it can be vital. You choose 8.  So does wichert. I like 2 in python,
> 4 in everything else.  Most of the Python community seems to prefer
> either 2 or 4, and rarely 8. So what? If it is done with spaces it is 
> unimportant, but done with tabs it's vital.

so nothing :-)
the problem is not in tabs by themselves, but arises when
you mix tabs and spaces.
E.g. you configure your editor to use 2 spaces per tab, and you
add some code, but do not use tab to indent it, but spaces
(or your editor inserts spaces automatically when you press tab)
but python interpreter considers tab to be 8 spaces... yuck
the solution is: choose either tabs or spaces, but
be _consistent_, and because there is no ambiguity with spaces,
spaces are preferred.

| Radovan Garabik http://melkor.dnp.fmph.uniba.sk/~garabik/ |
| __..--^^^--..__    garabik @ melkor.dnp.fmph.uniba.sk     |
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!

Reply to: