[r6rs-discuss] [Formal] #;<datum> comments useless

From: Eli Barzilay <eli>
Date: Sat Sep 30 14:28:59 2006

On Sep 30, Per Bothner wrote:
> Eli Barzilay wrote:
> > (And the point is that #; is an s-expr operation, and if I
> > don't know where my sexprs end, then chances are my code is bad
> > anyway.)
>
> And since you also agree that #; comeents are mainly used during
> debugging when you know or suspect your code is bad anyway, then
> you've essentially conceded my point ...

I pointed at *one* additional way to use #; which is useful for
debugging. Please read my post as if it has an implicit "me too"
prefix.

Even if it was useful *only* for debugging, saying that it should
never be checked into a repository, be included in production code, or
be included in the language standard is bogus. After all -- debugging
is one of the reasons that repositories exist, they are part of the
standard life cycle of production code, and language specs certainly
put a lot of focus around debugging.


> > On Sep 29, Per Bothner wrote:
> >>> [...]
> >>> (+
> >>> (- foo
> >>> bar
> >>> #|
> >>> (this is
> >>> a
> >>> long
> >>> (expression (that
> >>> has
> >>> many
> >>> parens)))|#))
> >> Aa I said above: you really don't want this in production code, or
> >> more generally anything that is 'checked in" (to a source-code
> >> repository).
> >
> > Huh??? Are you seriously suggesting that repositories should contain
> > no commented code?
>
> I assume you meant to write "commented-out code".

(Yes: commented, not documented.)


> And, yes, there is little or no justification for commented-out code
> in repositories *unless* it is accompanied by a non-s-expr comment
> explaining why it is commented-out.

(As I said below.)


> > #; ; this code is ...
> > (...)
>
> This works as long as the comment fits on a line.

  #; ; this code is disabled
  ;; because it sucks
  (foo (sucks))
  #; #| this code is also disabled
        because it also sucks |#
  (bar (also-sucks))


> The problem is it is easier to lose track what is commented out (and
> why) than with plain old-fashioned block comments, which are much
> more visibly obvious where they begin and end.

... and as expected, I disagree. It is (not) easy to track of
#;-commented code just as it is (not) easy to track plain code. I'm a
programmer => I'm very good at keeping track of code.


> This argues for a conditional-compilation/reader mechanism, like
> Common Lisps #+ and #-.

Yes, that would be useful too. Also, FYI `#+ignore' is a common CL
idiom; guess what it's used for.


On Sep 30, Per Bothner wrote:
> Abdulaziz Ghuloum wrote:
> > Others have described some actual real-life situations in which
> > they found legitimate uses of expression comments. Are you
> > seriously suggesting that they should be denied using a handy and
> > useful facility just because *you* consider it bad style in
> > production code?
>
> You bet, *if* I were a Scheme editor, which I'm not.

(Phew...)


> A good fraction of the harm is having it in the language, even if I
> don't personally use it, because it makes the langauge bigger
> without adding sufficiently useful functionality, and because it
> makes it easier to make hard-to-read mistakes: If I accidentally
> type a # in the wrong place it can easily be a hard-to-track-down
> bug.

The same as typing any one of: "()[]{}`',_at_;.\"\\#". Anything,
actually. (I don't remember any language that was designed random
keyboard slaps.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!
Received on Sat Sep 30 2006 - 14:28:38 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC