PHP Development – Good Starting Point for Small Scale Projects and Framework Use

PHPprogramming practicesweb-development

I'm a web development intern working on a small PHP application (just a few pages with a little database access) which has fast become a couple of very non-DRY, non-OO, individual scripts.

A framework seems like overkill (maybe not?) but I was wondering what some best practices for code / folder structure and general solo, small-scale PHP development. What is your starting point for a small application such as this?

Best Answer

The thing about "small" projects is they rarely stay small. If they're successful they grow. Otherwise they die. What happens is you add "just one more little thing" until eventually you have implemented a framework anyway, and it's usually poorly designed because it was never intended to grow.

Even if you are convinced this time is different and your application won't grow, there are so many things you get for free with a framework that I have a hard time seeing why anyone would forgo it. You get themes, user authentication and roles, administration pages, tested modules, security fixes, and more, all of better quality than an individual developer starting from scratch could produce.

Yes, there's a learning curve associated with any framework, which is why people think they're saving time by starting from scratch. That notion is very short-sighted. It's ridiculous to assume that learning a heavily used and tested software application is harder than implementing one of your own from scratch. They have already encountered and solved hundreds of problems that you aren't even yet aware exist.