Should I rewrite the whole PHP codebase to Python?

2 points by sptmbr ↗ HN
The codebase is about 100K lines, and it is a private internal website for a publisher company. It is getting harder and harder to maintain the codebase and add new features into the existing system, simply because I have some bad designs and also some bad implementation in PHP. In another way, I think Python is easier to write code and easier to maintain than PHP.

And to refactor the existing code might not be an option, because I want to redesign the whole system from scratch. If I had an opportunity to rework on the codebase, should I rewrite it again in PHP or rewrite it in Python?

Thanks a lot!

3 comments

[ 3.7 ms ] story [ 18.4 ms ] thread
Never EVER "redesign the whole system from scratch". There are years (usually) of history documented in code in a legacy system.

I've heard this over and over and have experience with projects where this was attempted. It's never gone well.

"...the single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch." -Joel Spolsky

http://www.joelonsoftware.com/articles/fog0000000069.html

Also read: http://timross.wordpress.com/2010/03/15/if-you-must-rewrite/

Will your customer or boss give you the time and money to rewrite the code base? More than likely they will not, especially if they believe they have something that already works. I would suggest coming up with a plan to refactor the code and learn how to black box the things that are less important or too complicated to refactor easily. It is easy to fall into a trap thinking a new design will be better, but it will take much longer to implement and if the customer/boss is asking for new features along the way it is almost impossible.
Yes! I'm saying this because 'some men want to watch the world burn'. And if you do I could only imagine your world crashing and burning. Rewrites are painful.

Rewriting anything from scratch is generally frowned upon, but you also have to consider this is not your company so I doubt you'd even get the go-ahead to make the transition.