[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]
On Wed, Jun 28, 2000 at 05:42:32AM +0200, Tomasz Wegrzanowski wrote:
>
> EmacsLisp is completely unreadable, so if Scheme
> is any similar to ELisp, it's ExtendedDOH will be low.
Agreed and agreed. (Actually I think Scheme is more readable
than Lisp, but still low DOHy.)
> Real C is completely unreadable. If you say opposite,
> think if you never searched for trivial bug for half an hour.
Agreed. And of course you're being kind :-) some trivial bugs
take days.
> For me Perl I more readable than both above, but
> I know there are some problems. They are caused by Perl's DWIM-ity.
I don't know. Most Perl programs can be understood _sooner or
later_, but they usually tend to later :-) Who never stood
nights reading some Perl code, with the enthusiasm of someone
who struggles with a good Chess problem?
Reading Perl code which was written by someone in "deep hack
mode" is almost an insight into the other programmer's head.
> > 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 ?
No, I don't :-)
Python doesn't have arrays; it has tuples and lists. Tuples are
an advanced concept, beginners will live happily with lists
most of the time. And an one-element list is written [1].
--- start
twoelementlist = [1,2]
oneelementlist = [1]
print twoelementlist[0]
print oneelementlist[0]
--- end
For people with any non-lisp'ish programming experience, [1]
will probably be more DOHish than (1), won't it?
> > > 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
That's the biggest point of friction between Perl lovers and
Perl haters, right? :-)
TIMTOWTDI is good for the writer and problematic to the reader.
> DWIM = Do What I Mean (as opposed to Do What I Say)
Which leads to ambiguity, as you said above.
> 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.
I think it makes sense. Actually, I don't see what else could
the result be.
> And you still haven't explained what a TLA is DOH ... :-)
It's not an acronym, it's all-caps because it's usually said
very loud :-)
- Uh, how do you add variables A and B on Python?
- hmm, perhaps A + B?
- DOH! (Or D'OH, or DUH, or any variation...)
[]s,
|alo
+----
--
Hack and Roll ( http://www.hackandroll.org )
News for, uh, whatever it is that we are.
http://zope.gf.com.br/lalo mailto:lalo@xxxxxxxxxxxxxxx
pgp key: http://zope.gf.com.br/lalo/pessoal/pgp
Brazil of Darkness (RPG) --- http://zope.gf.com.br/BroDar
- [Freeciv-Dev] Perl for Freeciv scripting? (was: Plans for 1.12), (continued)
- [Freeciv-Dev] Perl for Freeciv scripting? (was: Plans for 1.12), Reinier Post, 2000/06/27
- [Freeciv-Dev] Re: Plans for 1.12, Daniel Burrows, 2000/06/26
- [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12), Lalo Martins, 2000/06/27
- [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12), Tomasz Wegrzanowski, 2000/06/27
- [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12), Lalo Martins, 2000/06/27
- [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12), Tomasz Wegrzanowski, 2000/06/27
- [Freeciv-Dev] Re: Perl for scripting, Cameron Morland, 2000/06/27
- [Freeciv-Dev] Re: Perl for scripting, Tomasz Wegrzanowski, 2000/06/28
- [Freeciv-Dev] Re: %!PS, Cameron Morland, 2000/06/28
- [Freeciv-Dev] Re: Perl for scripting, Lalo Martins, 2000/06/28
- [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12),
Lalo Martins <=
- [Freeciv-Dev] Re: Perl for scripting (Re: Plans for 1.12), Steve Hodge, 2000/06/28
- Message not available
- [Freeciv-Dev] Scripting (was Re: Perl for scripting), Dan Sugalski, 2000/06/28
- [Freeciv-Dev] Re: Scripting (was Re: Perl for scripting), Lalo Martins, 2000/06/28
- [Freeciv-Dev] Re: Plans for 1.12, Reinier Post, 2000/06/26
- [Freeciv-Dev] Re: Plans for 1.12, Tomasz Wegrzanowski, 2000/06/26
- [Freeciv-Dev] Re: Plans for 1.12, Tomasz Wegrzanowski, 2000/06/26
[Freeciv-Dev] Re: Plans for 1.12, Tony Stuckey, 2000/06/20
[Freeciv-Dev] Re: Plans for 1.12, Reinier Post, 2000/06/21
|
|