Brian Ray's Blog : Python/whitespace.htmlPainting is just another way of keeping a diary. --Picasso
Tue, 13 Dec 2005
Python's Whitespace
"There should be one-- and preferably only one --obvious way to do it." -- Tim Peters Most people who know me know I am fond of Python. The biggest gripe I hear from programmers about Python is it feels restrictive, at first. Although, what I say in return is to think about with other languages how much time is waisted trying to adhere to all the best practices, DRY and Agile and so on, and work with a flimsy language. Some choices should be trivial and treated this way. Also, if your making something for someone else to use, the "how to" should be as self explanatory as possible. Take whitespace in Python. One good thing about ChiPy is that I get to hear a lot of programmers talk about programming Python. Once a presenter said when he was first placing is Python code under version control he had done some thing really stupid, he said. He said that instead of converting his tabs to space, he checked them into source control as tabs. Now is this so bad? What is wrong with tabs under source control. For one thing, the tab size, three spaces or four... needs not specified. I still think back to Guido van Rossum's April's fool joke in his blog. But seriously, why are people afraid of white space? And what is the proper way to handle it? Also, why does it seem some editors are so unfit for managing white space? Why are some programmers afraid to work off a restrictive foundation? It seems to me, I am better off with Python being restrictive much the same way a carpenter feels comfortable with a rigid piece of wood. Through carefully tooling, the wood can be made pliable into whatever you want and without ever hindering productivity or creativity. Although, if you start with a flimsy piece of wood you can not do as much: not as quickly and not as concisely.
|
Categories Calendar
Check out my new Blog -> |
|||||||||||||||||||||||||||||||||||||||||||||||||