zsh-users
 help / color / mirror / code / Atom feed
From: Vincent Stemen <zsh@hightek.org>
To: zsh-users@sunsite.dk
Subject: Re: [OT]Python/zsh/perl
Date: Mon, 15 Mar 2004 17:37:12 -0600	[thread overview]
Message-ID: <20040315233711.GB69458@quark.hightek.org> (raw)
In-Reply-To: <20040315070400.81487.qmail@web12405.mail.yahoo.com>

On Sun, Mar 14, 2004 at 11:04:00PM -0800, Bob Schmertz wrote:
> --- Vincent Stemen <zsh@hightek.org> wrote:
> [quoted text "juggled around" a bit] 
> 
> > I agree.  This surprising discovery is the primary reason I never put
> > any serious consideration into learning Python.
> 
> > I use the auto indentation features of xemacs all the time.  I see no
> > way you could do that without code block delimiters.  Seems like a step
> > backward in time.
> 
> Emacs seems to be the most popular editor for Python programmers.  It
> knows when to start a new indent level, because the if, while, class,
> etc. lines all end with a colon.  It can't tell when you want to close
> the
> block, of course, but if you're typing new code, that's a simple matter
> of
> hitting the backspace key once for every block you want to close out.  I
> wouldn't /think/ of coding in Python if I didn't have Emacs or something
> equally smart.

I agree.  Typing new code from scratch is not where I felt there would
be problems.

> > Seems like it would be a nightmare to fix if you get your indentation
> > messed up (which is extremely common when juggling code around).
> 
> Not sure exactly what you mean by "juggling around"; if you mean cutting
> a
> section from a file and moving it elsewhere in the file, or to a
> different
> file, at a point that starts out at a different indent level, there's a

Yes, that is what I meant.

> key sequence to add or subtract an indent level from that entire block of
> code, so that the pasted code will be consisent with itself as well as
> fitting all under the appropriate if statement or whatever.  If you're
> talking about code from someone else, esp. via email and things like
> that,
> then there are more variables, of course.

Yes, I cannot even begin to count the number of times I pasted code
surrounded by other code with different indentation levels and then
lost track of which code went with which block.  With block
delimiters, I very commonly mark a substantial region under xemacs and
tell it to re-indent to automatically fix it all.  Also, I commonly
will be working with code I did not originally write or modifying code
I wrote in the past and have since changed my indentation style.  That
is especially common when learning a new language where you have not
yet refined the style you like best for that language.  It can become
very tedious manually fixing indentation on a large chunk of code,
especially if you accidently change the whole logic flow and break the
program because you made an indentation mistake and are not familiar
enough with the code to easily catch it.

I feel, at least for me, that no block delimiters would likely end up
being a nightmare.  The popularity of python obviously demonstrates
that many people do not agree with me.  At least not yet :-).

> 
> Do I think blocking by indentation is the greatest thing since sliced
> bread?  No.  But I've been surprised to find that it has rarely, if ever,
> been a problem for me the way, oh, buffer overflows, objects that appear
> to the lame compiler like they might not be instantiated even though they
> definitely always are, or not knowing Perl have been.

I would also be surprised to find that that continued to be the case.
I'm not sure I understand the problems with Perl you mention.  I have
written a fair amount of Perl code over the last several years and it
has been very robust for me.

Anyway, I guess we have steered off topic for a Z shell list (sorry
about that everybody). After this, I will try not to promote further
discussion on the matter.

> 
> > I was very pleased to find that you can do direct array indexing of
> > single dimensional arrays in zsh.  ie. if x=abcd, then $x[2] = b.
> > That very feature is most commonly the weakness of tradition shell
> > script and even Perl that sometimes ends up causing me to write a
> > routine as an external C program when I am writing a complex script.
> > 
> [snip]
> > This is about the only complaint I can think of I have ever really had
> > with Perl.
> 
> Funny, Python does this just fine :-)
>  >>> a="spam"
>  >>> a[3]
>  'm'
>  >>>
> 
> =====
> Cheers,
> Bob Schmertz

-- 
Vincent Stemen
Avoid the VeriSign/Network Solutions domain registration trap!
http://www.InetAddresses.net


  reply	other threads:[~2004-03-15 23:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-13  3:29 named directory expansion on strings Thorsten Kampe
2004-03-13  6:41 ` Bart Schaefer
2004-03-13 17:48   ` Thorsten Kampe
2004-03-14 18:54     ` Bart Schaefer
2004-03-14 21:24       ` Thorsten Kampe
2004-03-14 21:57       ` Python/zsh/perl [was: named directory expansion on strings] Vincent Stemen
2004-03-15  4:00         ` Jos Backus
2004-03-15  7:04         ` [OT]Python/zsh/perl " Bob Schmertz
2004-03-15 23:37           ` Vincent Stemen [this message]
2004-03-17  4:03           ` Eric Mangold
2004-03-14 22:19       ` named directory expansion on strings Thorsten Kampe
2004-03-14 23:19         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040315233711.GB69458@quark.hightek.org \
    --to=zsh@hightek.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).