develooper Front page | perl.perl6.language.mlc | Postings from August 2000

Re: why not just use C /* ... */ ?

From:
iain truskett
Date:
August 23, 2000 14:15
Subject:
Re: why not just use C /* ... */ ?
Message ID:
20000824071802.B10009@eh.org
* Johan Vromans (JVromans@squirrel.nl) [24 Aug 2000 06:59]:
> iain truskett <ict@eh.org> writes:

> > > With SLC, discarding a line if it starts with a # (after optional
> > > whitespace) is straightforward, fail safe, and fast.
> > 
> > Almost. You can have # in other places on the line. It doesn't have
> > to be at the start (with or without whitespace).

> I was aiming at the case where SLC are used instead of MLC. In this
> case, every line is commented out, hence the # will always be at the
> line start.

>    # This # part
>    # is /* commented */
>    # out completely
> vs.
>    /*
>    This # part
>    is /* commented */
>    out completely
>    */

> For normal comments, your remark stands.

Hmm. I think I'm thinking differently. In my mind, using SLC markers for
MLC is still using SLC not MLC. It's fudging. The main problem I
personally have with using SLC for MLC purposes is aesthetics --- all
the lines get indented (typically) 2 chars. Do this multiple times and
your lines start getting noticeably longer.

Yes, it's faster since the interpreter finds the character straight
away. Is it elegant? No. Why? Read on!

Yes, it's clearer if your editor doesn't support highlighting. After
all, most C programmers I know (including myself) use comments in the
form:

/* Moo
 * Quack
 * This is a rather dull comment.
 * It doesn't mean much.
 */

Admittedly, my editor puts in the extra * marks. The only time I can
recall not doing comments like that was when I was including all the
documentation in the file in a man-like format.

The drawback is you have to enter it on every line. Yes, editors can do
this easily --- and no doubt many people have existing macros that do
such a comment given a mark (I would but I rarely use such commenting).

That is: It's far easier to mark an area at the top and then go to the
bottom than drop a mark at the top and then do a mystic keypress at the
bottom.


Is it easy to construct suitable macros to remove a level of commenting
without confusing two adjacent MLCs? I don't think so and I believe this
is where a proper MLC structure would be good.

Anyway: rfc5 claims to be frozen so this is probably a useless
discussion anyway. (If anyone feels like it: email me the antonym for
'moot'.)


cheers,
-- 
iain truskett, aka Koschei.                    <http://eh.org/~koschei/>
      "I'd just like to take this opportunity to say: Iain Truskett, you
      are a scheming Swine!" -- Erik Pollitt, The Barmy Army, 20000621.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About