psss...I want to move from Perl to Python

sohcahtoa82 at gmail.com sohcahtoa82 at gmail.com
Fri Jan 29 15:49:05 EST 2016


On Friday, January 29, 2016 at 1:12:34 AM UTC-8, Ulli Horlacher wrote:
> Steven D'Aprano <steve at pearwood.info> wrote:
> 
> > Every time I make a half-hearted attempt to learn enough Perl syntax to get
> > started, I keep running into the differences between $foo, %foo and @foo
> > and dire warnings about what happens if you use the wrong sigil
> 
> I have started learning Python several times and surrendered because my
> brain was too Perl hardcoded after 30 years, but NOW I was successful :-)
> (I still find Perl syntax better...)
> 
> About the variables in short:
> 
> $foo is a scalar (number, string, reference, file handle)
> @foo is an array
> %foo is a hash (dictionary in Python slang)
> 
> and yes, you can use them all together in same code, they are different.
> 
> For more discussion about Perl syntax one should better go to
> comp.lang.perl
> 
> -- 
> Ullrich Horlacher              Server und Virtualisierung
> Rechenzentrum IZUS/TIK         E-Mail: horlacher at tik.uni-stuttgart.de
> Universitaet Stuttgart         Tel:    ++49-711-68565868
> Allmandring 30a                Fax:    ++49-711-682357
> 70550 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/

"(I still find Perl syntax better...)"

I'm convinced that anyone who actually prefers Perl's syntax over Python is suffering from Stockholm Syndrome.

People frequently joke about Perl being "write-only code" due to how frequently people will write code, not look at it for a week or so, then come back to it and not be able to understand what the code is doing without excessive comments.  Or they will say that Perl code is indistinguishable from line noise.

*These are not the hallmarks of a good syntax*

Readability counts.  I'd say readability is one of the most important features of a language, as you will read your code far more than you write it.  Perl is not readable.  I don't care how powerful your language is if you can't read it.



More information about the Python-list mailing list