Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12)
Home

[Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Lalo Martins <lalo@xxxxxxxxxxxxxxx>, Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12)
From: Tomasz Wegrzanowski <maniek@xxxxxxxx>
Date: Wed, 28 Jun 2000 05:42:32 +0200

On Tue, Jun 27, 2000 at 11:52:37PM -0300, Lalo Martins wrote:
> On Tue, Jun 27, 2000 at 10:52:28PM +0200, Tomasz Wegrzanowski wrote:
> > On Tue, Jun 27, 2000 at 03:37:26PM -0300, Lalo Martins wrote:
> > > Or putting it the other way around: some people just won't
> > > learn Perl, some just won't learn Scheme.
> > > 
> > > Either we support both perl and scheme, or we use a language
> > > with a very high "DOH factor" like TCL, Python or Pike.
> > > 
> > > (DOH factor: the percentage of times you will find out that you
> > > can do something exactly like you thought you could. Scheme has
> > > a low initial DOH factor because you can't "2 + 2", for example.)
> 
> Addendum: or something you read will mean exactly what you
> think it does - this is really the low point of Perl :-)

EmacsLisp is completely unreadable, so if Scheme
is any similar to ELisp, it's ExtendedDOH will be low.

Real C is completely unreadable. If you say opposite,
think if you never searched for trivial bug for half an hour.

For me Perl I more readable than both above, but
I know there are some problems. They are caused by Perl's DWIM-ity.

> > Me thinks python is veeeeeeeeery low DOHish if you ever programmed C
> > (no +=, whitespace problem, print auto-\n, one-element array problem etc.)
> 
> All of these are a lot more DOHish in Python than C for anyone
> who never did C. ("Uh? What do you mean by +=?")
> 
> BTW... what one-element array problem?

Program :
--- start
twoelementarray = (1,2)
oneelementarray = (1)
print twoelementarray[0]
print oneelementarray[0]
--- end
Output :
--- start
1
Traceback (innermost last):
  File "py", line 4, in ?
    print oneelementarray[0]
TypeError: unsubscriptable object
--- end

See ?
One-element arrays need to be written like this : (1,)
Who would guess ?
Perl has no such problem because of prefix.

> > On the other hand perl has gigantic DOH-factor, because
> > it is most TIMTOWTDI and most DWIM language.
> 
> Uuuuuuuuuuuuuuuuuuuuuuuuh?

TIMTOWTDI = There Is More Than One Way To Do It
DWIM = Do What I Mean (as opposed to Do What I Say)

This two mottoes are extremaly Perlish.
You can easily find why Perl is TIMTOWTDI.
Some example of DWIMity :

--- program
@a = (1,2,3);
@b = reverse @a;
print "@a\n";
$a = "1 2 3";
$b = reverse $a;
print "$a\n";
--- end
Result:
--- start
3 2 1
3 2 1
--- end

And yes, I know this upset every non-Perl programmer.
But this is in 95% cases exactly what you wanted.

> > And hardly anyone knows Pike or TCL.
> 
> Agreed. But there was once a time when more people knew TCL
> than any of Perl and Python and Scheme.
> 
> 
> In the end, "easy to learn" is what's similar to what you
> already know. This is what makes this kind of decision
> complicated. Perhaps we should use the rejection factor - what
> languages you would _never_ use given choice? :-)

I would never use sh, given ANY other choice, even VisualBasic :-)
And I wouldn't use Pascal, unless they support POSIX I/O.
Don't have other objections, weird languages are fun (try dc).

And you still haven't explained what a TLA is DOH  ... :-)



[Prev in Thread] Current Thread [Next in Thread]