Re:C-style vs. Python-style syntax: which one would you pref...
by lacker on Sunday December 14, 2008 @02:52PM
(#397587)
When are your editing tools so limited you must use tabs mixed with spaces? That doesn't really make sense.
Just don't use tabs, ever. If you have whitespace problems you can simply grep for tab characters and remove them.
Re:C-style vs. Python-style syntax: which one would you pref...
by davidw on Sunday December 14, 2008 @04:13PM
(#397663)
Keep in mind that part of 'scaling down' (making stuff accessible to new users) is that new users are the ones most likely to use lame or inappropriate editors. Stuff like Java and Lisp need more in terms of editors because of verbosity, and sorting through the parens, respectively.
When one is working on a server, the editing tools are sometimes limited and they thus can make seeing the whitespace hard. In another, smaller, Python project, we had whitepace errors that appeared and disappeared like ghosts. Even if you have tools that make seeing everything easy now doesn't that you will have them later, on another system - especially, sooner or later spaces and tabs will get confused and be invisible.
I haven't programmed in C for years but the meaning of C programs is still obvious at a glance to me. After being away from python for a couple of years, the meaning of python program is opaque to due to the meaningful whitespace syntax. I know I could pick python up again if I tried but this indicates to me that python's syntax is not as natural as what Steve McConnell calls block structure. The end of a block is just as important to find as the start and so should be just as visible.
Writing one-line functions is, if anything, easier in Ruby than in Python.
Oh, and a syntax that requires as comments to show a normal program constructs is broken virtually by definition.
I can understand the appeal of the syntax. The syntax indeed appealed to me at one time and I enjoyed the rest of the language. But I think ultimately meaningful whitespace just does not work and will confined python to being a niche language.