It is a little disheartening reading dismissive statements, "this is different therefore bad". It isn't great, but not because it isn't pure MVC.
There are several important issues with the framework.
Major Environmental (static) dependence from static & configuration creep. Statics have been used liberally, breaking encapsulation all over the place.
A lack of dependency injection has resulted in many areas of the framework being tied to each other in a non-intuitive, non-modular way.
I should only need the class API to know how to use it: not the config api, not the config parameter requirements, not pre-defined config values, not which classes need to be in the include path.
'Abitary Files' seem to be used quite frequently. Routing/configuration/logic is found in "return array()" files (!) rather than being part of an architecture which has place-holders for the composition of logic.
$route->add('GET', '/', function() { return new View(); });
would be better, with $route instanced and used in an appropriate location within the architecture.
The lack of MVC/some dispatch system has obscured how the rest of the library can be composed into an application and this has lead to statics and configuration creep.
My initial impression was that the author expected users of his library to take it and use it to build some problem/domain-specific architecture, however after seeing the example application i was disappointed.
I found the lack of MVC initially refreshing. I think a functional library with object oriented state management is an extremely interesting 'research' area for php frameworks, and it is certainly worth while releasing some non-mvc frameworks which take this route.
This is nevertheless a reasonable attempt for a person who hasnt written many frameworks before. Writing frameworks is an excellent way to improve design and conceptual programming skills; library programming is much more reliant on technique than application programming.
I actually had the same issue, the routing was bad. The guy actually changed it but it looks like the docs haven't been updated yet... routes behave more like you'd expect now.
EDIT: actually he did update the docs, I guess both ways work. If you look under the heading "Organizing Routes" you can now use something other than a monolithic file.
If this was on someone's resume as a recent project, it would be an instant non-hire.
Unless the author is a very young junior programmer with zero work experience and no formal training, and we could afford to spend years teaching them the basics.
There are already way to many PHP-hacks out there doing cargo-cult OOP, and most of them are unteachable.
If you wouldn't hire someone because you think they lack perfect OOP manners, I think I know a lot of people who wouldn't work for you if they had to.
From a hiring perspective (assuming this was a 'recent' project for the author) I'd take from this that they're willing to try new things and are good at completing projects in the general sense. I'll happily take a bit of time to fill in any knowledge gaps if I knew I was getting someone who was used to seeing a project through and could at least attempt to think outside of their own box.
I really can't take any project that ignores all existing programming (PHP or otherwise) standards and best practices without any kind of justification seriously.
There may be thought behind it, but it smells like general cluelessness. It's just procedural code dumped into classes with zero comprehension of object oriented programming. And of course zero test coverage.
Even as an exercise in writing your own framework it is pretty pointless.
It breeds innovation when people are trying to do things differently. The thing is, most of these frameworks are very similar and rarely do anything innovative.
31 comments
EDIT: Clarity
It is a little disheartening reading dismissive statements, "this is different therefore bad". It isn't great, but not because it isn't pure MVC.
There are several important issues with the framework.
Major Environmental (static) dependence from static & configuration creep. Statics have been used liberally, breaking encapsulation all over the place.
A lack of dependency injection has resulted in many areas of the framework being tied to each other in a non-intuitive, non-modular way.
I should only need the class API to know how to use it: not the config api, not the config parameter requirements, not pre-defined config values, not which classes need to be in the include path.
'Abitary Files' seem to be used quite frequently. Routing/configuration/logic is found in "return array()" files (!) rather than being part of an architecture which has place-holders for the composition of logic.
$route->add('GET', '/', function() { return new View(); });
would be better, with $route instanced and used in an appropriate location within the architecture.
The lack of MVC/some dispatch system has obscured how the rest of the library can be composed into an application and this has lead to statics and configuration creep.
My initial impression was that the author expected users of his library to take it and use it to build some problem/domain-specific architecture, however after seeing the example application i was disappointed.
I found the lack of MVC initially refreshing. I think a functional library with object oriented state management is an extremely interesting 'research' area for php frameworks, and it is certainly worth while releasing some non-mvc frameworks which take this route.
This is nevertheless a reasonable attempt for a person who hasnt written many frameworks before. Writing frameworks is an excellent way to improve design and conceptual programming skills; library programming is much more reliant on technique than application programming.
Way to actually provide some useful input. Upboat to you sir.
It's bad.
How exactly? It seems his compiler uses ? etc.
He is using PDO, but by default PDO is emulating the prepared statements. Thus removing all the benefits promised by native prepared statements.
I actually had the same issue, the routing was bad. The guy actually changed it but it looks like the docs haven't been updated yet... routes behave more like you'd expect now.
EDIT: actually he did update the docs, I guess both ways work. If you look under the heading "Organizing Routes" you can now use something other than a monolithic file.
Deleted before we saved it.
If this was on someone's resume as a recent project, it would be an instant non-hire.
Unless the author is a very young junior programmer with zero work experience and no formal training, and we could afford to spend years teaching them the basics.
There are already way to many PHP-hacks out there doing cargo-cult OOP, and most of them are unteachable.
If you wouldn't hire someone because you think they lack perfect OOP manners, I think I know a lot of people who wouldn't work for you if they had to.
From a hiring perspective (assuming this was a 'recent' project for the author) I'd take from this that they're willing to try new things and are good at completing projects in the general sense. I'll happily take a bit of time to fill in any knowledge gaps if I knew I was getting someone who was used to seeing a project through and could at least attempt to think outside of their own box.
so, if i want to use this, I can't have commas in my URLs? It's not a common requirement, but it is something that is valid to use. :/
I stopped reading after seeing how routes were handled. Seems to be an unconventional way of handing off requests to a controller/view.
I stopped reading when he suggested that Laravel had a gradual learning curve. http://en.wikipedia.org/wiki/Learning_curve
I really can't take any project that ignores all existing programming (PHP or otherwise) standards and best practices without any kind of justification seriously.
There may be thought behind it, but it smells like general cluelessness. It's just procedural code dumped into classes with zero comprehension of object oriented programming. And of course zero test coverage.
Even as an exercise in writing your own framework it is pretty pointless.
I know rolling your own framework is a good way to learn to programme but PHP doesn't need more frameworks. Really. Just stop.
Why not? Competition breeds innovation. It's not hurting anyone.
It breeds innovation when people are trying to do things differently. The thing is, most of these frameworks are very similar and rarely do anything innovative.
Building new framework is like reinventing a wheel.
Only .. you see .. all the php 'wheels' have been mostly rectangular.
Agreed... instead of rolling your own, there are plenty of great frameworks already out there that could use more contributors.
That's not nearly as fun though.
Deleted before we saved it.