PHP Framework : Lose-Lose situation
Long time no update, huh? Well, I’m alive and well. After a couple of my love stories, now back to programming.
I have had some experience with PHP frameworks: CakePHP, CodeIgnitor and KohahaPHP. I never have used Zend Framework, though, but I think I can imagine what it like.
I know what is the propose of those frameworks: for rapid website developing. Sound good, eh? But actually it isn’t.
With the size of those frameworks, the documentation is huge, and the time need to read and understand documentation could have been used to finished other projects already. But understand once, write forever? No, because one day they will have a release which break backward compatibility….
And for me, there is another reason. As you know, I’m Thai and English isn’t my mother tongue. So when I read long English text with less or no paragraph break, I will feel tired and stop reading. This happen to my mother tongue too, to be honest. But There are several languages which I can read forever without feeling tired. Let me name some: C, PHP and Java. Yes, I can read source code very well, including the messy source code and code from decompiling obfuscated Java bytecode (exception for Assembly and Machine Code which I can’t read =)). So, with large framework, I’ll have to peek inside the core file and read to understand what is ‘under the hood’.
So far, I have been developing a framework myself too. I think since I wrote it, I would have understood it very well that I can write freely. How wrong I was…
No, my framework isn’t finished yet, but according to my plan it should be very fast and fail-safe (meaning: have very with good error system, even parse error will not break the site with parse-before-include system). But as I continue writing the framework, I realise something…
First, let me introduce you to The Simple PHP Framework. This framework have very basic functionality but great as a site skeleton. I have build time-limited website from zero with this framework and my basic MVC system. It is really great.
Back on the track, as I continue writing my framework, I started to realise that there is nearly no different between my planned framework and the Simple PHP Framework coupled with my own MVC. Well, it would be a framework, but if I compare it to frameworks out there, it would be just a code snippet.
Let see pros and cons of my framework and ‘framework out there’:
Framework out there:
Pros.
- Fast to develop
- Great MVC.
- Good support and community.
- Great DBL/ORM
- Great helpers (HTML, Form, etc.)
Cons.
- Mostly slow
- Need time to learn
- Complicated.
- I just want to use 0.01% of its features =)
SPF + My MVC:
Pros.
- Easy to understand, and thus use.
- Easy to extend with small codebase
- Highly customisable
- Small and fast, no unused code loaded.
Cons.
- Usable DBL/ORM (handcooked)
- No support =( (but you know it well, don’t you?)
- You need to coded everything on your own.
It does seem that ‘framework out there’ wins, but trust me, with ‘framework out there’, you will normally take more time to develop same website if, and only if, you website needs strange feature and needs. But if you don’t have them, why don’t you just use CMS???
Well, this only applied if you are skilled developer. If you are newbie, framework definitely easier to deal with, but code it yourself with some friends or guru to asked will help you improved your skill fast!
about 1 year ago
Interested. Let me try yours
(with a manual and suggestion, please).
Now my blog is almost finished. Only the management page and a problem with those stupid radio boxes still unfinished.
[ Why do 2 Thais talk to each other in Eng. - - ]
about 1 year ago
You should be able to use mine without any help, actually.
Because this is English blog =)