Hacker News new | ask | show | jobs
by JoelSutherland 6139 days ago
Sometimes it is more practical to update a codebase than to rewrite it entirely in a different language.

From the comments here you would think it is bad that writing clean PHP is possible...

1 comments

You could also generate PHP code from Scheme or Common Lisp. That way you can write in the language you like and update the codebase.
I would prefer if such approach was taken to ease a gradual reimplementation.

The risk of this just making the codebase even uglier is enormous.

I thought about that too. There are programs that can handle making PHP or C beautiful. GNU indent is one of them I think, and there's another one called TidyPHP? Something like that.

So you just generate and then run the code through that if you need it to be human readable. I assume most companies don't give a shit as long as it works ;)

I fear a Scheme to PHP code generator would turn out PHP code that's ugly beyond what any code beautifier could hope to fix. It's not make-up - it would be akin to major surgery.
I'm sure it would only require indent fixing if coded properly.