Re: [OT] Choosing a scripting language. - Mailing list pgsql-general

From scott.marlowe
Subject Re: [OT] Choosing a scripting language.
Date
Msg-id Pine.LNX.4.33.0310270801210.14845-100000@css120.ihs.com
Whole thread Raw
In response to Re: [OT] Choosing a scripting language.  (Marco Colombo <marco@esi.it>)
Responses Re: [OT] Choosing a scripting language.  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: [OT] Choosing a scripting language.  (Scott Chapman <scott_list@mischko.com>)
Re: [OT] Choosing a scripting language.  (Marco Colombo <marco@esi.it>)
List pgsql-general
On Sat, 25 Oct 2003, Marco Colombo wrote:

> On Fri, 24 Oct 2003, scott.marlowe wrote:
> > On Fri, 24 Oct 2003, Scott Chapman wrote:
> [...]
> > > I also love the indentation to
> > > differentiate code blocks rather than the junk I'd been used to seeing in
> > > Perl and previous languages.
> >
> > Sorry, that was the one big turnoff for me in Python.  Indentation is
> > simple to me, I do it linux kernel style, and don't even have to pay
> > attention to it anymore, it's just automatic for me.  I guess I'm just
> > used to doing it the old fashioned way.
>
> I don't get it. If you already indent code, what's the problem with
> Python? Python _requires_ correct indentation,

No, it RELIES on it.  I.e. code blocks are marked out by how you indent.
I.e. it doesn't look for block markers, then make sure indentation is
right, it uses the indentation to show it where code blocks are.

The fact that tabs are parsed as 8 spaces by Python, when many editors are
set to render them as 4 or 6 makes it quite possible to have a file that
looks like it should run but doesn't.  I'll take good old {} anyday.

Just do a google search for "python whitespace tabs" and you'll get about
7820 results back...

> so it's a problem only
> to beginners who don't like indenting (and forces them in doing
> the Right Thing). If indentation is automatic for you, you're already
> doing it the Python way.

Not exactly.  I still prefer being able to do simple:

if (something) do one thing; constructs

Or put in debug lines that ARE NOT indented so they're easier to see:
function test(var1){
# delete this test var when testing is done
$test_var = "set";
    start of code...
}

without worrying about the parser complaining about white space.

Indentation is for ME, not the parser.  Having it count as the block
marker just feels wrong to me.  I'm not even sure I can explain why
completely, but my above points are just one small part of it.

I agree with you on using the right tool for the job.  Except Perl.
The more I use other languages, the less I want to use Perl.  Maybe it was
a bad experience as a junior developer long ago with it or something :-)


pgsql-general by date:

Previous
From: "BARTKO, Zoltan"
Date:
Subject: table functions + user defined types
Next
From: Manfred Koizar
Date:
Subject: Re: Nullable 'Foreign Key-like' Constraint