From: Mark Hubbart Date: 2004-10-12T15:28:39+09:00 Subject: Re: quality of error messages On Tue, 12 Oct 2004 06:46:55 +0900, Austin Ziegler wrote: > On Fri, 8 Oct 2004 20:26:55 +0900, Brian Candler wrote: > > On Fri, Oct 08, 2004 at 08:06:27AM +0900, Yukihiro Matsumoto wrote: > > > |> % ./script.rb > > > |> script.rb:6: warning: inconsistent indentation level. > > > |> script.rb:13: parse error > > > |> > > > |> This should make it easy to find such errors. > > > > > > |That seems like a nice idea to me. This would be nearly the same as the > > > |autoindenter so, only that it does not indent but spit out warnings. > > > > > > I'm afraid that it might cause tab-space indentation war like in the > > > Python community. The issue is much smaller though, since it is not > > > mandatory. > > > > I think that you don't have to enforce any particular indentation style or > > amount of space on each line - only that it is consistent between begin and > > end. > > No, no, no, and NO! Yikes! > When I am writing code, I will often do: > > class Foo > def bar > : # some code here > p baz # a tracer to help me find a difficult bug > : # more code here > end > end > > Your suggestion would force me to indent the tracer -- which I have > *purposefully* overridden the auto-formatting by vim to insert -- > which leads me to the same idiocy that keeps me from Python as a first > point. Well, no, it wouldn't. In my original suggestion: 1. it was only a warning; you wouldn't be *forced* to comply with it. 2. the warning would be at a more highly defined warning level: level 3, which currently doesn't exist. So the warning would never show up unless you run your code at that warning level. 3. I didn't directly specify this, but I intended that it would only check indentation levels for block ends. So that puts statement would be ignored even still. I would shrink in horror at the thought of supporting a change that would enforce indentation standards on other rubyists. I violate mine often enough myself, whenever I feel that it makes my code more readable. Regardless, I realize now that the exact thing I proposed would not be the best way of doing it. I described what was in my mind at the time, knowing full well that there was likely something wrong with the idea. :) I am quite interested in the much more mature ideas that I've seen later on in this thread. > Tracer code is too useful to be bound by people who don't use editors > that help them write their code through use of automatic indentation > and/or folding. > > This whole indentation-count idea is dumb. Well, I guess that we will all have different opinions on this, but I find myself tracking down "missing end" bugs often enough that I kinda like the idea. As long as it only complains when there's a missing end :) cheers, Mark