Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


Porting Perl To Python

Sep 12, 2010, 19:04 (6 Talkback[s])
(Other stories by Noah Gift)

[ Thanks to An Anonymous Reader for this link. ]

"I'll begin by quoting Damian Conway in Perl Best Practices: "Perl's approach to 'object oriented' is almost excessively Perlish: there are far too many ways to do it... There are just so many possible combinations of implementation, structure, and semantics that it's quite rare to find two unrelated class hierarchies that use precisely the same style of Perl OO."

"This inherent flexibility in the design of the Perl language has undoubtedly caused the organic accumulation of Perl code that is technically running yet fragile to change and difficult to understand. Compounding the problem is the possibility that the original developers are no longer available, having moved on to other projects or companies. In addition to the legacy code burden, your production requirements may have changed, or newer vendor APIs are available only in Python. At this point, the monumental feat of porting Perl to Python begins.

"Once you've reached this decision, you need to choose the best strategy to solve the problem. If you are fortunate enough to have a codebase of well-written object-oriented Perl, with full test coverage, then it might be as simple as porting the unit tests from Perl to Python and then making the appropriate Python code to pass the newly ported Python unit tests. Although there are many talented Perl programmers who write well-documented and readable code, these folks aren't as common as they could be. Most likely, you'll find yourself in a situation where you have no idea how the Perl code works, exactly, other than observing that it does. This is where the tough part of porting Perl to Python really begins."

Complete Story

Related Stories: