71
- 060701 今年七一網摘
CAPTCHA
自由與暴民
The one thing that changing hard tabstops allows is for the same file tocome out different for different people. This may explain its enduringpopularity, because in theory you can use it to view source files inyour favorite indentation level while letting me view them in mine. Ifyou like two-space indents and I'm a mutant who likes 8-space ones, wecan both be happy.
Of course this is only an illusion; it breaks down explosively any timeyou need sub-tab indentation (and
I rarely have violent visceral reactions to things. But I have a few hotbuttons, and here's one of them. Quoting from Joel Spolsky's summary :
Nick Gravgaard : "Ratherthan saying that a tab character (a "hard tab") will move the cursoruntil the cursor's position is a multiple of N characters, we shouldsay that a tab character is a delimiter between table cells..."
Wrong. Wrong wrong wrong. The core wrongness is visible in a singleline
A while back I wrote about emulating C structs in Python using (instance) objects to createnamespaces, and wrote:
(Avoid the temptation to just use '
ms = object()', because ithurts your ability to tell different types of structs apart viaintrospection.)
It turns out that there is another reason to avoid this: it doesn'twork. Somewhat to my surprise, instances of object() can't have newattributes put on them. (Instances of Python subclasses of object(