3 ms·
I've just spent a couple of years on a project that I've built 'from scratch' in PHP attempting to follow an MVC pattern and trying to do things the 'right way'
by jentulman 16y ago
I've just spent a couple of years on a project that I've built 'from scratch' in PHP attempting to follow an MVC pattern and trying to do things the 'right way' as I understood them at the time.
It's got to the point now where mistakes are coming back to haunt me, and some things that should be easy are not due to decisions made previously. This is compounded by the fact that growth of the code has been somewhat organic, and I didn't have a chance to anticipate some of the things we've done in the last year.
The upshot of all this is it's now time to re-write everything, taking the project as it now stands as the 'spec' for the rebuilt version.
I've learnt a lot during the project, and I'm a very different coder to the one I was at the beginning. One of the main things I've learnt is that I don't have enough time to be working on the "would be nice"'s in building your own framework, getting results ends up taking priority over taking time to 'do it right'.
So for this rebuild I'll be using an existing framework for several reasons.....
The people building the framework have time to concentrate on how the underlying code is built, and don't have to worry about a specific implementation
As I don't have to worry about designing my application, I have a spec, I can spare the time to learn the framework properly as I re-implement
Once I'm up to speed with the framework I should, in theory, be able to design and build anything in future much more rapidly.
I won't have to write any more bloody boilerplate that I've been re-doing due to my lack of knowledge/foresight in growing my current codebase
It's fun to learn, and peeking inside the framework (possibly because I'll need to bend it to my needs) should teach me new tricks.
I don't think a decent framework should take away control of your code. I've had the luck to be able to take 4 weeks evaluating some of the options both in PHP and other languages and anything that leaves the underlying code in a 'black box of magic' has been discarded. There are plenty of options out there with excellent docs and api's and lots of room to bend things to your will.
My personal choice is to go onwards with Yii, but framework choice is fairly subjective and a whole other conversation.