I once inherited a website written in C. I actually tried moving it to PHP but the server was hitting a rogue MySQL instance with a file socket and I couldn't find a PHP API to handle it.
There were two things I did that actually made it pretty painless to work with: I implemented a Dreamweaver template processor that you could hook up to output a string or execute a block on each template element. I also implemented a preprocessor that allowed injection of large HTML blocks:
for (int i = 0; i < n; i ++) {
[[[<tr><td>(((i))). {{{strings[i]}}}</td></tr>]]]
}
It's an interesting exercise, but as soon as I left they scrapped it for something maintainable.
There were two things I did that actually made it pretty painless to work with: I implemented a Dreamweaver template processor that you could hook up to output a string or execute a block on each template element. I also implemented a preprocessor that allowed injection of large HTML blocks:
It's an interesting exercise, but as soon as I left they scrapped it for something maintainable.