On Jan 2, 2008 2:40 PM, SJS <[EMAIL PROTECTED]> wrote:
> begin  quoting Chuck Esterbrook as of Wed, Jan 02, 2008 at 02:22:29PM -0800:
> > My experience in talking to people is that folks who have used Python
> > know how straightforward and safe indentation-for-blocks is while
> > former Cobol and Fortran users fear the whitespace due to false
> > associations between indentation-for-blocks and the various problems
> > that those languages had.
>
> It's not fear, it's wisdom.

No, it's over-generalization like so: Cobol and Fortran used spaces in
certain ways therefore any language that does something with spaces
must be bad/stupid/toyish.

Here's a similar argument: C++ is hard to learn and use therefore any
language with curly braces should be avoided.

> And I've been finding a stronger correlation between preferred brace
> styles and acceptance of indentation-as-whitespace.
>
> Folks who don't mind:
>
>   if (expression)
>      {
>      code
>      }
> or
>
>   if (expression)
>      {
>         code
>      }
>
> Mostly seem to have no (or little) objection to indentation-as-syntax.
>
> Folks who prefer
>
>   if (expression) {
>      code
>   }
>
> or
>
>   if (expression)
>   {
>      code
>   }
>
> Mostly seem to object to indentation-as-syntax.

Well I'm a counterpoint. At different times I've been the last two and
I never objected to indentation-for-blocks.

> > At a high level of abstraction, it reminds me of when I meet a non-IT
> > person, say someone in physics, who has learned C++ after several
> > years of effort, and they now refuse to learn any more languages. You
> > just can't convince them that it won't be so hard next time.
>
> Well, inflicting C++ on someone should be against the geneva convention
> or something.
>
> What I've found hard is trying to explain scoping to people who's first
> language was Python. "No, you _can't_ refer to that variable here, it's
> out of scope!" "But it's at the same indentation level!"

Having flipped between Python and C# for the past few years I got to
feel what it was like to shift gears. What I found was that coding in
the large is better in C#. For example, I can more easily refactor
code because of the compile-time checking. But coding in the small was
far better in Python. C#/Java's pickiness and extra syntax inside
methods is just a time waster.

> > > > Cobra simply requires that you indent blocks with one tab or 4 spaces.
> > >
> > > I prefer 3 spaces, personally.
> >
> > Cobra is somewhat disrespectful of such preferences in favor of the
> > "syntax normalization" described earlier. I realize that will be a
> > turn off for some, but I think the goal is worth it.
>
> Then you should go with 8 spaces. If you're going to normalize things,
> then normalize 'em to the, well, normal definition, no?

No. I've worked with so many developers that use 4 (whether actual
spaces or tabs) that 8 just feels like a bizarre relic from decades
ago. Kind of like wrapping code to 80 columns. I don't have an 80
column display anymore! (Heh, another hook for a religious war.)

> No, it wasn't.
>
> It wasn't a simple <pre>...</pre> block -- it was some sort of CSS
> monster with div and span tags everywhere. All hail the new Web!

Still not too hard. You can strip HTML tags.

Look I'm not saying you didn't have this experience or that
indentation-for-blocks is perfect. But I've cranked so much Python
that I know it's not a major factor in day-to-day development. I
didn't spend time every day dealing with mangled code. Or even every
week or month.

> > I'm sure Cobol and Fortran do have practical problems with their funky
> > whitespace rule. But I'm also sure that simple indentation-for-blocks
> > does not. I know. I've cranked out mounds of Python code on the job.
>
> And I've never been able to read python.  I can puzzle my way through
> many (real) languages, but in python, the scoping is impossible to keep
> track of.

I don't even know what to say. I've never heard this before. Python
looks a lot like pseudo-code. Real question: Can you read psuedo-code
in C.S. books? It's typically indented and, yes, with an "end" at the
end of blocks. If you can, was it that "end" that shifted you from a
"cannot read" extreme to a "no problem" extreme?

I have seen Python code that I couldn't read because it had an
atrocious structure and identifiers. But we've seen that in all
languages.

> > Google, Yahoo and other companies have done serious work with Python.
>
> Yes. They also think that running untrusted, unmediated code on your
> system is a good idea. Pardon me if I don't drink the kool-aide that
> whatever google or yahoo does is a good idea.
>
> "$X uses $Y, therefore $Y must be a good idea" is how we get people
> writing applications in C, or using C++ at all, or using the Win32 APIs.

No, I was responding to your statement that Python is a toy language.
It's perfectly valid to say "$X is a big company with some great
products used by lots of people. $X used $Y, therefore $Y--whatever
it's flaws--is not a toy."

For example, I like Amazon, but I don't like Java. But I know Java is
not a toy because some of Amazon is powered by it and that's a serious
environment.

> > And although plagued by performance problems, lack of optional static
> > typing and lack of contracts ( ;-) ) Python is not a toy language nor
> > has indentation-for-blocks caused them headaches. Well except when you
> > get a file that mixes tabs and spaces, hence Cobra outlaws that.
>
> Python will always be a toy language.
>
> It's just being seriously abused.
>
> --
> Don't mind these opinions of mine;
> You're just wrong, that's my line.
>
> Stewart Stremler

These are toy comments.

-Chuck

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to