3 ms·
It's all fine until you have to work with bad legacy code ;) My last project at work was rewriting a 4k line monstrosity in Perl into 500 lines of Python which
by jergosh 16y ago
It's all fine until you have to work with bad legacy code ;)
My last project at work was rewriting a 4k line monstrosity in Perl into 500 lines of Python which do exactly the same. I can't even blame the original authors (it was likely their first larger program), it's just that Perl makes it so easy to write horrible code.
- patrickas 16y agoWhy can't you blame the original author since you know it was likely his first larger program? I know that Perl's defaults (mainly lack of strict and warnings) can make it easy to write code that easily breaks or has bugs or is harder to maintain, but it is the first time I hear the argument that it make it any easier or encourage someone to write 4k lines when he could have written 500 lines. I would guess that guy would have created a 4k monstrosity in Python if that's what he had to use without having enough experience. Or maybe I am not being imaginative enough? Can you give examples from the program you rewrote where Perl encourage beginners to write "huge monstrosities" while Python would have encouraged them to write succinct code ?
- mock 16y agoBad legacy code is certainly unpleasant. I'm currently working with a large code base that was mostly written about 10 years ago. It's not even particularly bad code, it's just big, and old, and crufty. But we can refactor that code a bit at a time into something clean and new, using modern perl. And we can do that without having to rewrite the entire thing in one shot. And that's one of the many advantages that being a good perl developer gives you. Another one is that that giant legacy code base still runs on a modern perl binary, because perl is (with a few well documented exceptions) a very very stable language. Most of the big modern perl changes are just modules. And they're backwards compatible with the old stuff too.