Re: Refactor/Rewrite Perl code in Python

2011-07-25 Thread Shashwat Anand
Thanks everyone for the insight. I got the idea as to how and where to start. Guess I need to work in Perl for now, so as to start the conversion process. Regarding Tests, I had already started writing tests before posting. Writing tests for every module will be a pain as well as a nice

Re: Refactor/Rewrite Perl code in Python

2011-07-25 Thread J Kenneth King
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand anand.shash...@gmail.com wrote: How do I start ? The idea is to rewrite module by module. But how to make sure code doesn't break ? By testing it. Read up on test driven

RE: Refactor/Rewrite Perl code in Python

2011-07-25 Thread Sells, Fred
Sometimes it's worth asking Why? I assume there would be no need to rewrite if the existing code did most of what was needed. It may be easier to ask the customer what he really wants rather than to re-engineer a crappy solution to an obsolete problem. --

Refactor/Rewrite Perl code in Python

2011-07-24 Thread Shashwat Anand
I am working with a huge codebase of Perl. The code have zero documentation and zero unit-tests. It seems like a huge hack. The underlying database schema is horrid. So I want to rewrite the whole of it in Python. How do I start ? The idea is to rewrite module by module. But how to make sure

Re: Refactor/Rewrite Perl code in Python

2011-07-24 Thread Chris Angelico
On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand anand.shash...@gmail.com wrote: How do I start ? The idea is to rewrite module by module. But how to make sure code doesn't break ? How can I import perl and python codes in each other ? Can you separate the project into separate executables

Re: Refactor/Rewrite Perl code in Python

2011-07-24 Thread Steven D'Aprano
On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand anand.shash...@gmail.com wrote: How do I start ? The idea is to rewrite module by module. But how to make sure code doesn't break ? By testing it. Read up on test driven development. At this point, you have this: Perl modules: A, B, C, D

Re: Refactor/Rewrite Perl code in Python

2011-07-24 Thread Dan Stromberg
On Sun, Jul 24, 2011 at 2:29 AM, Shashwat Anand anand.shash...@gmail.comwrote: I am working with a huge codebase of Perl. The code have zero documentation and zero unit-tests. It seems like a huge hack. My condolences. Er, actually, it sounds kind of fun. The underlying database schema is