begin  quoting David Brown as of Wed, Jan 02, 2008 at 03:26:00PM -0800:
> On Wed, Jan 02, 2008 at 03:17:38PM -0800, SJS wrote:
> 
> >(Which was, really, the trick. If you comment the python or cobra code
> >well enough, losing indentation won't matter much, as you can recreate
> >the scoping by reading the documentation.)
> 
> It may be nearly as difficult as re-implementing it, though.
 
That depends on the comments. We have a lot of smartasses here, so a
trivial solution would be to comment every line. Even something like:

# >
  if expression1:
# >>
     if expression2:
# >>>
        do something
# >>
     else
# >>>
        do something else
#

Would provide a fast "solution".

> I guess part of why I have a different take on this, is that I would accept
> C code from someone where the indentation was lost.  I would write back to
> them and tell them to get it to me in a way that doesn't lose information.

You would, or you wouldn't?

Would you not run it thru indent(1) before writing back?

(And, actually, I'm with you. I'd probably toss in a few comments about
variable and function names as well...)

> Maybe I'm just annoyed at this because someone over the holiday checked in
> a change to 271 files that re-worded the copyright commend, and expanded
> every single tab into spaces.  Fortunately, we've just reverted their
> change, and are going to make them do the work again when they get back.
> But, my blood pressure still hasn't come back down.

Heh. I feel your pain.

If you require tabs-for-indentation-not-spaces, you ought to be able to
insert a pre-commit check to look for such things.

Lessee... from start of line to first non-whitespace character there
should be only tabs... so a regex like "^\t* +[^ ].*$" would be a reason
to reject the commit.

Although I'm on the other side of the tab-vs-spaces debate, I had a
similiar problem... one of the junior programmers had set up a new IDE,
and it defaulted to replacing every 4 spaces with a tab on any line
"touched" -- to the consternation of the rest of the team. And a lot of
files had been touched, over a period of weeks.

Thus, my habit of disallowing tabs in source files, as enforced by the
VCS.

-- 
Policy decisions should be enforced by one's tools
But if they define them for us, then we're all fools
Stewart Stremler

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to