Getting into Python, comming from Perl.

M

Miguel Manso

Hi, list.

I'm into a psicological doubt that I would like to share with you
(you'll know why later on this mail).

I'm a programmer with 5 year of experience into Perl. I'm on that point
where you resolve problems without thinking on HOW you'll do it with
that language but only on the problem itself.

Since Perl 6 started I've been following it. The conclusion I have is
they're making a whole new language and I'll have to learn it. This
being said and, since I've to learn a new language, I've started
thinking in a new language. I've noticed Python is getting more and more
developers and many projects are being made.

I've tryed to use python some times but I get frustrated very quick. I
get myself many times needing to figure out how to loop through a list,
declare an associative array, checking how to pass named parameters to
functions, and simple things like that.

What I would like to know is if anyone had these problems and if you can
share that experience with me. I'm trying to minimize my "frustration" :)

Thanks a lot.

--
Miguel Manso <[email protected]>
============================================
Amplitude Net
Net - Rua dos Salazares, 842
4100-442 Porto

Phone: +351 22 532 2000
Fax: +351 22 618 2157
Web: www.amplitudenet.pt
============================================
 
M

Mike Meyer

Miguel Manso said:
I've tryed to use python some times but I get frustrated very quick. I
get myself many times needing to figure out how to loop through a
list, declare an associative array, checking how to pass named
parameters to functions, and simple things like that.

I went through some of those frustrations.
What I would like to know is if anyone had these problems and if you
can share that experience with me. I'm trying to minimize my
"frustration" :)

The thing is, the answers to all your questions are in the
documentation. You just need to know the Python names for things, and
not the Perl names. For instance, Python calls it's associative array
structure a dictionary, and a checking the documentation index for
dictionary turns up a link to the syntax for declaring one as
display/dictionary.

Read through the tutorial. Then look through some "interesting"
modules in the standard library to see how these things fit together.

<mike
 
J

John Bokma

Miguel said:
What I would like to know is if anyone had these problems and if you can
share that experience with me. I'm trying to minimize my "frustration" :)

Read the Python tutorial, front to back, 2 times. Next, read Dive into
Python (free e-book) front to back, 2 times, make notes the second time.

Then start programming :-D (It's what I am doing)
 
S

Steve Holden

Miguel said:
I guess I'll just do that. I'll put the frustration in a bag, grab the
documentation and try to figure it out.

Thanks all.
And, when the frustration returns, ask questions on c.l.py or the tutor
list. By and large we don;t bite here, and the tutor list is
particularly newbie-friendly, though with your Perl experience *that*
may not be as appropriate.

regards
Steve
 
N

Nick Craig-Wood

Miguel Manso said:
I'm a programmer with 5 year of experience into Perl. I'm on that point
where you resolve problems without thinking on HOW you'll do it with
that language but only on the problem itself.

Since Perl 6 started I've been following it. The conclusion I have is
they're making a whole new language and I'll have to learn it.

I have had a similar experience. Actually it was Perl 6, and and
particular this chart

http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html

that made me think that Perl was leaving the rails, and it was time to
jump ship (to mix my metaphors).

That was over a year ago now, and me and my colleagues haven't looked
back. Yes there was a small amount of retraining, but conceptually
Perl and Python aren't that far apart, its mostly a matter of syntax.

The philosophies of the two languages are quite different though.
Perl's TIMTOWTDI is diametrically opposed to Python's "There should be
one - and preferably only one - obvious way to do it" and I think that
is a major advantage when building bigger programs. Type "import
this" at the Python interactive prompt to see more about Python's
philosophy, and note that it seems like a direct reaction to Perl's
baroque-ness.

One thing I've definitely noticed is that Python had made me a better
OO programmer. Its so clunky making objects in Perl that I almost
never did except when making a library. In Python its so easy that I
don't have to think about it.
This being said and, since I've to learn a new language, I've
started thinking in a new language. I've noticed Python is getting
more and more developers and many projects are being made.

I've tryed to use python some times but I get frustrated very quick. I
get myself many times needing to figure out how to loop through a list,
declare an associative array, checking how to pass named parameters to
functions, and simple things like that.

What I would like to know is if anyone had these problems and if you can
share that experience with me. I'm trying to minimize my
"frustration" :)

I like to read books to retrain myself. That may not be your way, but
if it is I'd recommend "Dive into Python" by Mark Pilgrim as a good
first step. Its available for free in electronic form too. After
that you could read Programming Python.

Good luck!
 
D

Daniel Dittmar

Miguel said:
I've tryed to use python some times but I get frustrated very quick. I
get myself many times needing to figure out how to loop through a list,
declare an associative array, checking how to pass named parameters to
functions, and simple things like that.

Create a cheat sheet with all those stock phrases that you know by heart
in Perl, but have to look up in Python. That way, it's only one look.
And you'll know them by heart soon enough.

You could also print out or keep bookmarks on the modules you use the
most. When I started using Python, I did this for strings, regular
expressions and the os and os.path modules.

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top