Hacker News new | ask | show | jobs
by CCing 3387 days ago
Sometimes I miss the old good days with PHP mixed in HTML.

Maybe wasn't the best solution but it worked...and was fast too.

2 comments

I don't miss having to manually add includes and update dependencies with FTP. I don't miss htmlspecialchars or mysql_real_escape_string, I don't miss running everything in the webroot, I don't miss having to switch contexts between PHP, HTML, Javascript and CSS all mixed in one file.

The good old days kind of weren't that good. The simplicity of bare PHP was great for cowboying up sites in a hurry, but it's not a system that handles complexity well.

Having had to find and fix a bug in a very long page like that recently I can definitively say I don't. Horrible.

Granted the person who wrote it obviously didn't care but that setup was awful for anything of any size.

You can write bad code(not modular) with every language...

If you use some include() in php, you can avoid long php/html pages...

What I really miss is that was very fast "GET SHIT DONE" with PHP.

>If you use some include() in php, you can avoid long php/html pages...

In my experience, you just get long PHP pages including other long PHP pages, globals defined in one and used in others, included files that contain nothing but HTML, and other madness.

You can certainly GET SHIT DONE in PHP with a bit more coherence. Composer, with its autoloader and a router (probably nikic/fastroute) won't get in your way, your code will be more organized, modular, and lightweight, dependencies can be managed, etc.

Is non-modular code always necessarily bad?