[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A 21st Century Apple II?



On Mar 6, 6:13 pm, "Michael J. Mahon" <mjma...@aol.com> wrote:
> mdj wrote:
> > On Mar 5, 9:35 pm, apple2fr...@gmail.com wrote:
> >> On Mar 5, 3:18 pm, mdj <mdj....@gmail.com> wrote:> On Mar 5, 4:07 pm, apple2fr...@gmail.com wrote:
> > I write Python as my day job. The one thing I'll give it, is that you
> > never again have to read badly formatted code, since indentation is
> > used as the block delimiter instead of language symbols.
>
> I've always liked this approach to bracketing, since encountering
> it in the 1970s as the "off-side rule" (meaning that when indenting
> jumped back to the left ("off-side"), the intervening levels of
> structure were "closed").
>
> I've often wondered why it wasn't more common, since it makes the
> code "mean" exactly the way it looks.

It does work well. My only complaint is that larger functions can have
their behaviour shifted just by a bit of formatting that might be off-
screen, and still run OK, so the old delimeter model still has the
advantage of being absolute. On balance though, it's an excellent
idea, since I don't write functions that large ;-)

> I once "inherited" the maintenance of a text formatting tool written
> in Cobol (!), so I had to learn Cobol on the fly.  I was astonished
> to learn that in this "easy" language, the presence or absence of
> a single period in the middle of a nest of IF statements would
> completely alter the IF nesting without causing any syntax errors!
>
> What a violation of the "least surprise" principle, when a flyspeck
> can make one program read like another!

If only that story was less common ... :-S

Matt