Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Python style (Was: equery refactorization)
Date: Sun, 07 Dec 2008 18:10:32
Message-Id: b41005390812071010y33b19fdcl26c7b4478c6bcf17@mail.gmail.com
In Reply to: [gentoo-portage-dev] Python style (Was: equery refactorization) by "Michael A. Smith"
1 On Sat, Dec 6, 2008 at 3:21 PM, Michael A. Smith <michael@××××××××.com> wrote:
2 > -----BEGIN PGP SIGNED MESSAGE-----
3 > Hash: SHA1
4 >
5 > Actually I don't like spaces for indentation at all. A tab character and a
6 > space character take the same number of bytes, so it takes two-to-eight
7 > times
8 > as much space per indentation to store the same indentation as a single tab
9 > character. On the average project that can add up to several kilobytes of
10 > difference. Furthermore, it completely _prevents_ collaborators from
11 > enjoying a
12 > bit of customization as to the amount of indentation. If I like my
13 > indentation
14 > to be two spaces, and you like yours to be four, then we can each set our
15 > text
16 > editors that way and continue to happily share code that uses tabs for
17 > indentation.
18
19 I would imagine most projects are not size constrained in their
20 sources; also most sources are zipped and it turns out a series of
21 spaces compresses rather well, so I don't find this to be a compelling
22 advantage (I have plenty of disk space, disk bandwidth, and network
23 bandwidth). Perhaps when serving thousands of copies of a specific
24 tree this advantage will turn out to be useful in the long run (5k *
25 10000 req = 50meg savings.)
26
27 >
28 > I disagree with both PEP8 and Gentoo SOC styles on the matter. I would love
29 > it
30 > if someone could explain to me the actual benefit of using spaces over tabs.
31
32 My eyes hurt less ;)
33
34 But seriously, aside from what Douglas stated (spaces are displayed at
35 a constant size, and are typically smaller (on the display) than tabs
36 (I've never seen anyone use \t = ' ', but I guess it is possible)
37 there are no real benefits, it is a preference.
38
39 I'm not going to argue with you about which one is better; I agree
40 that tabs are nice due to tabwidth, but I still prefer spaces.
41
42 I don't think anyone on this list is nazi enough about style to reject
43 code based on it...I mean..you have seen portage right? It is not the
44 pinnacle of style here ;)
45
46 >
47 > I'll reply to the rest of the equery refactorization thread in a different
48 > email.
49 >
50 > - -Michael
51 >
52 > Douglas Anderson wrote:
53 > |> [1] http://code.google.com/p/soc/wiki/PythonStyleGuide
54 > |>
55 > |
56 > | I'm with you there, I really like that style guide as well. We should
57 > | adopt it :)
58 > |
59 > | -Doug
60 >
61 > -----BEGIN PGP SIGNATURE-----
62 > Version: GnuPG v2.0.9 (GNU/Linux)
63 > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
64 >
65 > iEYEARECAAYFAkk7COYACgkQzwtr5yY0JZyGFwCcCAI1oRKkfK0W1d5U5AQBQ4D8
66 > fooAoIQS8sH+KRdT8e9TgJ4nXOYXKgae
67 > =71ob
68 > -----END PGP SIGNATURE-----
69 >
70 >