Presentations on switching from Perl to Python [closed]

Short story:

I’m looking for presentations/good articles on switching from Perl to Python.

Longer story:

I’m a programmer / embedded hardware engineer in a hardware design group. A few years ago I’ve convinced my co-workers to use Perl for scripting (instead of a weird mixture of batch files, Excel, Matlab and TCL). Since then, I myself have switched from Perl to Python and am very happy about the change. I want to somehow convince my coworkers to follow my path, but I need good points to convince them. These can’t be heavy programmer voodoo like better reflection facilities (unlike myself, most people here are EE graduates and not programmers).

Any ideas ? Good articles / presentations on the topic ? Perhaps someone has already done it and can share tips.

Note:

This thread is somewhat on the same topic, but not quite fits my requirements.


10 Answers
answer

There’s no benefits to rewriting a ton of code from one similar language to another when both languages have similar capabilities. Perhaps you should focus on writing better perl code. Maybe learn to use perltidy, or buy a copies of Perl Best Practices and Perl Medic, and hand them out to your co-workers. And if you’re worried about Perl being not-quite-as-purely OO as Python, use Moose (and I’d counter that Python is lacking in the functional programming department compared to Perl anyway).

In response to the comments below, I’ll also say that there’s no point to forcing your coworkers to learn and get up to speed on a language with similar capabilities to the one you’re already using.

Now, if there’s some library or such that your company needs that is available (or far superior) in Python that is not available (or of far lesser quality) in Perl, then go ahead and switch or add another language to the mix.

answer

I think the first answer you need is the answer to “Why do I want them to switch to Python?”, which is one that only you can provide.

From the general tone of your post, I’m inclined to suspect it may mostly just be “Ooh! I found this cool new language and want to share its coolness with everyone!” or, alternately, “Finally something I can use to escape from Perl’s clutches…” If that’s the case, then why do you care whether other people’s personal preferences are the same as yours? If it’s just a matter of “we all touch each others’ code”, then why should your personal preference outweigh everyone else’s?

If, OTOH, you believe there are actual technical reasons and significant benefits to be gained by switching, then you need to identify those benefits in concrete terms (actual Python code to demonstrate them is one way to do this, but not the only way) and present them to your coworkers to see whether you can convince them that it would be a good switch to make.

Just be careful so you don’t ultimately drive the move from “a weird mixture of batch files, Excel, Matlab and TCL” to a weird mixture of Perl, Python, and whatever other language catches your interest next.

answer

What are your own reasons to prefer Python over Perl? What is it that makes you so happy? Are your coworkers unhappy with Perl? If so, what is it about Perl that gives them a hard time and might work better in Python?

The only way to convince them is to show them the possible benefits. Those tend to be very subjective and personal, IMHO.

answer

alt text

answer

If you can’t change a nontechnical manager’s mind about how to change from one language to another then you’re just not qualified to be suggesting the change or leading the change.

You have to have valid reasons why its better than what already exists – and “I prefer the syntax” or “google uses it” are just not valid reasons financially or even technically.

This is such a massive switch that you need to know in your own mind why it makes sense to do it.

answer

Sorry. I am just offended that you treat Perl like basic. and Python like the next step in evolution. Now that I have that off of my chest.

Evaluate the feature(and limitations) difference of the two.
Perl has constants, multi-line anonymous functions, and autovivification, but python has better default Object Orientation.

Evaluate the cost/benefit of your team/friends switching. It may be good for your team to have specializations in different languages, or it may be a waste of resources.

Dispel the myths behind Perl and Python.

And of course enjoy whatever language you are using.

answer

How to convince people Python is better than Perl?

Be more successful in Python than they are in Perl.

When they ask why you’re so successful, warn them that they’ll have to think outside the box. Be sure they actually want to improve before revealing the secret of your success. [Some people don't want to improve, they want to whine; try not to enable them.]

Until you’re more successful, you have nothing to show. The “good points to convince them” are your personal success stories.

Start a private list of “Python to the Rescue” moments. Each Python to the rescue that’s an actual win at your actual organization is indisputable.

Each day, you want to look for a tidy, bloggable success story.

answer

Eric S. Raymond wrote an interesting article/essay on his experience with Python, which were hugely favorable.

On writing working code:

When you’re writing working code
nearly as fast as you can type and
your misstep rate is near zero, it
generally means you’ve achieved
mastery of the language. But that
didn’t make sense, because it was
still day one and I was regularly
pausing to look up new language and
library features!

This was my first clue that, in
Python, I was actually dealing with an
exceptionally good design. Most
languages have so much friction and
awkwardness built into their design
that you learn most of their feature
set long before your misstep rate
drops anywhere near zero. Python was
the first general-purpose language I’d
ever used that reversed this process.

On metaclass hacking:

To say I was astonished would have
been positively wallowing in
understatement. It’s remarkable enough
when implementations of simple
techniques work exactly as expected
the first time; but my first metaclass
hack in a new language, six days from
a cold standing start? Even if we
stipulate that I am a fairly talented
hacker, this is an amazing testament
to Python’s clarity and elegance of
design.

There was simply no way I could have
pulled off a coup like this in Perl,
even with my vastly greater experience
level in that language. It was at this
point I realized I was probably
leaving Perl behind.

Definitely worth a read for anyone who’s heard of Raymond, and anyone who’s written Python. He has a lot of perl experience (and a lot of coding experience in general), so his glowing review of Python comes with some weight behind it.

answer

Ask your co-worker if they can still read their Perl script written few months back or if they can read and understand each other script. One key thing with Python is that is it very readable. Also show them, how they can do all the good stuff in Perl in Python. Show them Python doc. Show them how Python OO is a better integrated to the language compare to Perl.

If you suggest to your manager, mention the part about how it is much easier to maintain. He might mandate that everyone to switch now.