Keith Devens .com |
Friday, July 4, 2008 | ![]() |
| And certainly both Horses were doing, if not all they could, all they thought they could, which is not quite... – C.S. Lewis (The Horse and His Boy, ch 10) | ||
|
| ← Procrastination hack: “(10+2)*5” | 43 Folders | Instapundit.com: Hurricane Katrina prompts growth in gun ownership → |

David Lindquist wrote:
Erik wrote:
As sad as it may seem, there are companies that part of their yearly/quarterly/etc review is how many lines of code they produced... which version do you think those people like?
I myself would find another job than work for a place like that, but some people for financial or other reasons don't have that luxury (i.e. a friend of mine).
Keith (http://keithdevens.com/) wrote:
I was never persuaded by JWZ's take. He basically held the "religious" issue and the "technical" issue up and said "let's throw out the technical issue of how tabs are interpreted and just use spaces, which are unambiguous". This leaves the "religious" issue unresolved and people's preferences still at odds. What I don't understand about the argument is that if you just choose the other way and ignore the technical issue, letting people configure their editors however they want, the "religious" issue goes away altogether.
David wrote:
I tend to agree.
But the bottom line seems to be that regardless of what method you prefer, if the people you are working with do not use the same method, your editor configuration is moot.
Heather wrote:
I find the spacing helpful contextually.
If the logic is mundain (as above), then space is not a commodity. If the logic involved is super complex, and involved, then space helps me discern visually.
So the answer is both, sometimes, maybe, for me.
WHATEVER MAKES MY JOB FASTER, EASIER, AND ACCOMODATING TO MY TEAM, AND THE GOAL/DELIVERABLE.
Adam V. (http://adamv.com) wrote:
I collapse my trivial property definitions down as in the 3rd example.
I know it was just an example, but that definition of Point really bugs me vs just making the freaking X and Y public.
Adam V. (http://adamv.com) wrote:
As a further side track, if I kept the properties in Point I'd attribute them thusly: [DebuggerStepThrough]
Keith (http://keithdevens.com/) wrote:
If the logic involved is super complex, and involved, then space helps me discern visually.
Of course. As you can see I used space judiciously above; space must be used sparingly; only when it adds meaning and clarity to the code. Vertical space is precious, as the code one can view on screen at once is closely related to what one can readily keep in mind at once.
Revence 27 wrote:
You'll never convince people to change, Keith.
I use the space-waster. Because it was in the books I used to learn. And because the first '}' doesn't ever vanish on you.
Have you read '1TBS' from the Jargon file?
This is the stuff of holy wars. And nobody changes in the end. I even realise I still do it in Perl, after reading the perlstyle manpage.
Long live Python?
Keith (http://keithdevens.com/) wrote:
And because the first '}' doesn't ever vanish on you.
I'm glad you brought up that argument because it's often used and it's completely unconvincing to me. The first '{' can't vanish on you because if you leave out the '{' you'll get a compile error pretty fast. You simply can't forget it.
Have you read '1TBS' from the Jargon file?
Yeah, but I can never figure out whether people use "1TBS" to mean K&R's style precisely (which is inconsistent, with the brace on the following line for function definitions) or just in general the style that always puts braces on the same line.
Long live Python?
Heck yeah long live Python!
Adam Vandenberg (http://adamv.com/) wrote:
Use ReSharper when doing C# and you'll know before compiling if there are any syntax (or other catchable data errors) ahead of time; it puts red blips in a right-hand gutter that you can click to.
I can't use Visual Studio without it.
Patrick Smallwood (http://www.kabal-invasion.com/bugjuice) wrote:
We've covered this issue before (http://keithdevens.com/weblog/archive/2004/Dec/30/curly-braces#comments ), and last time, you even said "I can see how this could be a problem" in response to my exact reason for using spaces instead of tabs.
Memory lapse, or just a need to restate your preference?
There is a rational set of reasons people choose spaces over tabs, and brackets-on-their-own-line. You have different rational reasons that lead you to choose otherwise. If you don't see where there is room to debate, you've chosen to ignore the reasons previously given.
Keith (http://keithdevens.com/) wrote:
Heh, I forgot about the Putty issue. However, you did leave out what I wrote immediately before the portion you quote:
I don't work with Putty enough to let its bugs dictate my coding habits...
Patrick Smallwood (http://www.kabal-invasion.com/bugjuice) wrote:
Sure, but that wasn't critical to answering your claim - that you'll never understand why people choose spaces over tabs.
Your choice not to use putty is just that - your choice. It amuses me the number of people that assume most people use an IDE for programming. I can't stand IDE's - virtually every feature they have gets in the way of me getting my coding done.
As I said last time, your mileage may vary. I'm just trying to make clear why some people are "insane" enough to choose spaces over tabs, and one-line-per-brace for their layout. Different strokes for different folks, and its not just preference - we do actually have reasons for choosing things differently.
Thats the value of diversity - you get exposed to situations and logic that you wouldn't otherwise have yourself.
Revence 27 wrote:
The first '{' can't vanish on you because if you leave out the '{' you'll get a compile error pretty fast. You simply can't forget it.
It's not about forgetting. I think it's more about Making wrong code lok wrong.
Like, if you have a problem with a block, you are where it starts, you just look for the next curly on the same column.
Of course, you can look for the next statement on the column, as well.
It's just a perference that is as useful as the space saver (and that's why this rant is going on - both can (and do) work).
Soon, we'll be weailing about leaving a space between the asterisk and the name in pointer notation.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.205s.
(Used 8 db queries)

Jamie Zawinski's classic take on tabs vs. spaces:
http://www.jwz.org/doc/tabs-vs-spaces.html
Boy Keith, tabs-vs-spaces AND brace style all in one post. You are a brave, brave man.