I'm gonna step out on this one because this topic has been a hot one in my head for quite some time now. Not only with AJAX, but frameworks in general.
To Framework, or Not To Framework... That is the question...
When I began programming, there were no frameworks for PHP, JavaScript, or AJAX (not sure if AJAX even existed back then). I programmed from scratch by hand, and have done so ever since. Anyway, I've been thinking about whether I should spend the time learning and eventually actually using a framework. I'm not entirely sure what I'm going to do, and the debate has been going on in my head now for months. Hopefully this entry will spark some comments, and bring some light to the debate to use a framework or not.
Anyway... here is my experience:
- I've created my own templating system which works just fine, and enables me to create applications very quickly - it's not robust at all when compared to the likes of codeigniter or cakePHP, but for my purposes, it works wonderfully, scales well, and can be used in highly complex apps.
- I worked on a project with a guy who was a framework junkie. He implemented multiple JS libraries (moo-tools, dojo, and most likely a few others) and I'm sure he used a PHP framework to code, and although his application was developed extremely quick, when actually loaded in the browser, it ran as fast as mud flowing uphill. Seriously, it had so much eye-candy, it took forever to actually do anything with his app. I was not impressed.
- Although I haven't done any work personally with any framework, I've read quite a bit about them, and consider myself at least a bit informed about them.
Now here are some questions I have:
- I know that frameworks simultaneously make coding faster, yet make executing code slower. I know this depends *highly* upon implementation and skill of the programmer, yet I can't get it out of my head that while implementing a canned framework, I'm importing thousands of lines of executable code which I'll never use. Should I be worried about that? Are the benefits of using a framework worth it?
- At the first programming job I ever had, I decided to code by hand (it was only HTML and a little JS), while my two colleagues decided to go the WYSIWYG route. While they were marginally faster than me at whipping out websites, I found that when their sites had bugs, they had no idea how to fix them, and would come to me. Because I had been coding by hand, and thus being able to figure out the bugs, I could squash their bugs much quicker than they could. Will frameworks create the same dependance upon a higher-level coding, thus disabling me from learning more about the core language? (Kind of a stupid question, I know, but broadened - I believe might still be relevant to users who have never coded PHP outside of a framework)
- As I understand it, to some level, frameworks standardize the codebase and make it easier for more developers to jump on board without having to learn the nuances of an eclectic developer. I'm worried that, should I decide to use a framework for a project, and find its capabilities lacking, or am unable to make the framework function for a part of the project, I would go around it, thus fudging the code somehow, and making more of a mess than had I not used the framework to begin with. Do frameworks provide all the funcionality needed to self-contain the code? Are they programatically restrictive?
I guess that's it for now. Hopefully this will spur some constructive debate and enlighten people like me who can definitely see the advantages to using a PHP framework, or a JS library, but can also see the negative side as well.