(no subject)
Bruce came over and spent the day teaching me Views in TurboGears, and some Controllers too. I'm confident and ready to contribute! After dinner with and a newcomer, the four of us are at Python User Group now.
Hi, my name is Matt, and I ... I ... I actually like whitespace. (Hi, Matt)
WHY? WHY MATT, WHY OH WHY? you ask, on your knees in supplication to the skies, if you are named . I admit I may be wrong and change my mind later, but here is my impression so far: I am frankly going to be reading ten times as much code as I'll write. I expect to grab other people's open source code and modify it to my needs. Maybe I'll only put in a couple dozen lines and modify twice that many lines in a script. So, I need it to be readable. All these years I looked at source code and saw an indigestible wad of weird characters and gibberish. It was intimidating, although I now realize that coding is not as bad as it looked. The point is, Python and Ruby are fairly English-like. Whatever little negative difference white space will make to my productivity while typing, I will consider a good-citizenship tax.
Comments
muteid10t on Feb. 6, 2009 2:59 AM — I agree...
All good coders put white space in there code whether forced by the language(python) or not.
It makes the code readable by others. The bad ones who think it gives them some sort of job security or something don't.
Keep putting whitespace (aka indenting) in your code, the compiler doesn't care (it will remove it) and a lot of good programmers will thank you for it.
Yes it will make your source files bigger but with highspeed internet and 1TB drives who cares, your code will be readable.
loop-bell on Feb. 6, 2009 2:50 PM
Whitespace is actually one of the things I really like about Python, especially after a couple run-ins with the C++ compiler where my whitespace was right but the curly brackets were wrong. Meaning that my else if{}'s got attached to the wrong if, and that it was hard to track down because us humans tend to read the whitespace/indentation and not the curly brackets. So to me it makes sense that the compiler/interpreter should read the part that I the programmer already actually read.
Now, if I could just stop forgetting the colons (at the end of a line before the indentation) I'd be fine...
brucewebber.myopenid.com on Feb. 6, 2009 11:14 PM
When I write in Python I use an editor that is Python syntax-aware, like JEdit (open source) or Wing. Both of these will indent for me automatically when I finish a line with a colon and press Enter. If the line is not automatically indented, then I know I left out the colon.
JEdit is a great programmer's editor.
matt-arnold on Feb. 6, 2009 11:39 PM
I started using JEdit last night, and liked it.
sllywhtboy on Feb. 7, 2009 6:45 AM
http://www.bash.org/?400459
users on Feb. 7, 2009 2:08 PM
Haha, oh, I love whitespace. My code is whitespace-tastic.
That being said, a codebase that uses whitespace as an integral part of the translation process is just a Bad Idea(tm) :P
le-bebna-kamni on Feb. 9, 2009 3:38 AM
I'm there with you Jer. Whitespace is fantastic as a readability tool.
What I hate is writing code that doesn't work, banging my head for half an hour over it even though everything looks correct, then finding out that even though my text editor is set to 4-space tabs it still inserts a "\t" and not four spaces. True story. **headdesk**
Python isn't horrible -- in fact it's got some pretty cool features. But I jealously guard my freedom to choose my whitespace. :)
Leave a Comment