RE: indentation (was Re: About the article)

Subject: RE: indentation (was Re: About the article)
From: MARK.WROTH@xxxxxxxxxxx (Wroth, Mark)
Date: Thu, 6 May 1999 08:49:46 -0700
On Thu, 6 May 1999 13:30:07 +0900, "Frank A. Christoph"
replied to my post on the subject: RE: indentation (was Re: About the
article) in "The DSSSList Digest V3 #27"

>>Mark Wroth wrote:
>> 	But it seems to me the point Didier is trying to make is not that
>> "block style" is morally superior in some sense, but that it is better
>> suited to a specific purpose: teaching/selling DSSSL outside the existing
>> community.  [mbw further clips for bandwidth...]

>1) In making the transition from an imperative, object-oriented,
>language like C++ or Java to a declarative, functional, LISP-style language
>like Scheme, syntax is the least important issue. In fact, it is
>a truism that if the word "syntax" appears in any list ranked by
>it always appears at the bottom.

Possibly true.  But what's the point?  Indentation/formatting of the source
is not relevant to the syntax (at least in languages which don't rely on
BOL/EOL as syntactic markers).  Now if you're trying to argue that the
formatting of the source is at the bottom of the list in importance (a
strawman, I think), then I would disagree -- take a look at some of the
Pascal output by the original WEB processor if you want an easy example
(aside: WEB processes a mix of documentation and source code into separate
code and documentation files.  One of Knuth's design goals in producing the
Pascal output file was to make it syntactically legal, and as unreadable as
possible.  The purpose was to encourage modification of the original WEB
source, not the Pascal file).

>2) I feel that when learning a new language it's best to adopt the
>conventions of its most experienced practitioners. (I believe that this
>applies to natural languages as well.) It's pretty safe to assume that they
>have good reasons for preferring that style, and obviously it has stood
>in good stead, or otherwise they would not be using that language and/or
>style. Observe that people who have been writing LISP or Scheme for a long
>time all use the abbreviated blocking style (the one not used in C).

If one were writing a textbook on the subject, I'd be inclined to agree.  If
one is writing an introductory article, it's less clear to me.  I would, in
general, prefer to introduce one new idea at a time ... and since the
indentation is syntactically meaningless, to choose an indentation style
best suited to communicating with the reader.  This may not be the style
best suited for production programming (although I would argue that code
readability is equally or more important in production programming, the
target audience is different).

>3) Anyone who dismisses a programming language purely because its syntax is
>"weird" is probably incapable of making significant contributions to its
>code base anyway.

Maybe.  But what does this have to do with the discussion?

>4) Marketing a programming language on the merits of its syntax is a weak
>and transparent ploy, likely to incur suspicion and distrust among
>knowledgeable programmers, the people you want to attract the most.
>Convincing expositions are based on factual evidence and, in their absence,
>clear-cut, representative motivating examples, not presentation style.

Then I have failed to communicate the main point I intended.  I'm not (and I
don't think Didier was) arguing that shifting the style of indentation in
general use would make any particular difference to the advancement or
decline of DSSSL.  I think the basic thesis was that more general
publication of "convincing expositions ... based on factual evidence and, in
their absence, clear-cut, representative motivating examples" would advance
the language. Secondarily (and the only point I was addressing) in
presenting such examples,  a more familiar coding style assists the reader
in understanding the exposition.  Presentation style (a bigger topic than
indentation) cannot make a discussion which is substantively unclear
suddenly lucid.  But it can reinforce and make easier the exposition of new
-- and hence difficult -- ideas.

	A more subtle point is that what indentation (or, if you prefer,
presentation) style would best aid the target audience to understand the
discussion.  Implicit in my argument is that the target audience consists of
people already accustomed to the "block indent" style of program formatting.
Depending on the actual target audience for a particular article, this may
not be appropriate.  For example, if one were writing an introduction to
DSSSL for a LISP programming journal, I'd argue just as strongly for
adopting the "LISP standard" form of blocking and indentation.

	Perhaps the bottom line is that the style of formatting of the
source code should be chosen to suit the purpose of the exposition (and I
include production code in this, since it will be, in general, read many
more times than written). 

>5) That said, I really don't care what style you use or advocate, because
>I have to look at it, I can always pretty-print it first anyway.

 DSSSList info and archive:

Current Thread