Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #82043 > unrolled thread
| Started by | Simon Ward <simon+python@bleah.co.uk> |
|---|---|
| First post | 2014-12-06 17:12 +0000 |
| Last post | 2014-12-06 17:12 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Tabs for indentation & Spaces for alignment in Python 3? Simon Ward <simon+python@bleah.co.uk> - 2014-12-06 17:12 +0000
| From | Simon Ward <simon+python@bleah.co.uk> |
|---|---|
| Date | 2014-12-06 17:12 +0000 |
| Subject | Re: Tabs for indentation & Spaces for alignment in Python 3? |
| Message-ID | <mailman.16656.1417886886.18130.python-list@python.org> |
On 6 December 2014 03:04:48 GMT+00:00, Michael Torrie <torriem@gmail.com> wrote: >On 12/05/2014 07:31 PM, Ned Batchelder wrote: >> This is a perfect example! The code (with tabs as >--- and leading >> spaces as .) is: >> >> >-------if (!list_empty(pending)) >> >------->-------ret = list_first_entry(pending, struct async_entry, >> >------->------->------->-------.......domain_list)->cookie; >> >> Now, display it in your editor with tabs set to four spaces: >> >> >---if (!list_empty(pending)) >> >--->---ret = list_first_entry(pending, struct async_entry, >> >--->--->--->---.......domain_list)->cookie; > >However, a conscientious programmer knows that tabs could be >arbitrarily >sized, so he would never do that. Instead he would do: > > >-------if (!list_empty(pending)) > >------->-------ret = list_first_entry(pending, struct async_entry, > >------->-------.......................domain_list)->cookie; > >Which under the heretical tab size of 4: > >---if (!list_empty(pending)) > >--->---ret = list_first_entry(pending, struct async_entry, > >--->---.......................domain_list)->cookie; Not every programmer is as conscientious in the first of place, and that's far easier to get wrong than just agreeing to stick to one thing. This is why (often more rigid) style guides (or rather policies) exist. Maybe we should sack such programmers regardless of their other abilities instead of forcing all, including the conscientious, programmers to adhere to strict style policies? While I like the idea, I think that a slap on the wrist and a bit of re-indentation/re-alignment is all that is necessary (although I have worked with people who consider pure style changes to be a sin too). Simon
Back to top | Article view | comp.lang.python
csiph-web