So, a lot of buzz has been going around lately with MVC style developing.
Is it just more, or did people just magically start using this?
I have been programing websites and developing software applications for over 11 years and I started using MVC (or as I like to say, UI-Business-Data) for at least 6 years.
I understand the MVC design pattern and have used it with the Zend Framework. Personally i didn't like it, but that is because i'm so used to my own framework and design patterns that MVC seems a little over the top to me and brings too many grey areas when it comes to properly splitting up the code in to the different layers. Like everything, there is never 1 pattern fits all instead the more experienced developer uses the best tools (patterns in this case) for the job.
The MVC pattern has been around for some time and is always cropping up because it's so widely used. It's also quite an easy pattern to grasp which makes it good for developing a "known" framework architecture which results in a smaller learning curve. Sure, there are better architectures... but the problem is educating people about them... especially when most people already know the MVC one.
You are right, there are always times when you just simply need to grab something from the db and then bring it straight to the UI.. but for the most part, it has been helpful to me in organizing my websites.
I like MVC, i think its a good design pattern - but I also think it can very easily become abused! I've just recently seen some horrible implementations of MVC which almost made it pointless because it took far too long to do something relatively simple. However, I think implemented right, it can be useful.
Frameworks are good if you want to build a relatively easy site, quickly. Zend Framework is a good framework and obviously, being Zend, it has a lot of following. But its also a massive framework and comes with quite a steep learning curve - since ZF 1.0 was released its being used and talked about more and more.
What I don't like about frameworks is its quite easy to spend a lot of time learning how to do something with a framework rather than just getting things done.
I split up my websites in UI-logic-data too, easier to maintain them.
Yeah, I know a lot of people who abuse them. For really simple websites or implementations, they combine this HUGE overhead of frameworks of the MVC system which.. just adds to much to their website which is used to run a simple shopping cart script.
I really don't like how people are going crazy with JavaScript frameworks these days either. Sure, they don't add a huge overhead to the loading of a webpage, but it's enough to notice. Especially for people who load up the whole jQuery library and only use one thing from it. I mean.. how idiotic is that? I would rather just code my own JS for that one (or multiple things) that I know will work and I can change for that website I'm working on, plus it eliminates clutter and confusion.
I think most people use frameworks etc for the simplest of things because they think they might use more of the features in the future
Anyone who has read a design pattern book will know that design patterns (and mvc) are not complete... instead you have to mold each pattern to the situation.... but then like anything... some people try to use them everywhere and mess up some code by using too many design patterns that don't quite fit the problem.
I think they're really useful. There is an overhead but its not necessarily massive - and once its been minified and gzipped it doesn't add a huge amount of time. The advantage to using a JS framework is similar to any other frameworks - rapid development. You don't have to waste your time coding many functions when they're already available. You also don't need to worry about getting the JS to work cross-browser too, because its been dealt with in the framework.
Having said that, I don't use a JS framework for my personal projects (we use jQuery at work), because its good to learn more about JS instead of just relying on a framework - there will come a time when the framework doesn't have what you need, you can then either write a plugin or just keep fleshing our your own JS library.
I think that brings up a good point. How does gzipping a JS file or framework or myriad of JS files speed up processing? I know, you put it on Google's servers, but they still have to ungzip it... I never understood that.
Another point for JS framework is it often shortens the code you write... so if you write a lot of JS code... the code you have saved by using the framework may actually total LESS than if you hadn't used the framework at all! Unless you end up writing your own framework... eg with prototype:
This: document.getElementById("id")
Becomes: $('id')
Saving you quite a few characters... add this a few tousand times and you've saved quite a lot of space by using the framework let alone how much space method chaining saves!
Anyway... first of all you start with a huge JS file... you've just typed it out... you minify it first which removes all comments and whitespace (tabs, spaces, new lines). This reduces the filesize quite a lot. Then you gzip it... which basically compresses the .js file BEFORE sending it over the internet. This makes the filesize even smaller! Then when you get it your end, it's uncompressed and ready to be displayed... so instead of downloading a 300kb file, you only download a 50k file.
For coderprofile all js and .php files are gzipped... css are not gzipped because IE don't like gzipped CSS files for some reason and they break. There's no point gzipping images either because they usually add more overhead than the gains you get from a smaller file size (jpg for example are already compressed).
You do not have permission to post replies to topics in this board. If you want to join in with discussions and create new topics please register. If you want to register your own free account with us, please click here.
Not enough time to do something productive I run out of ideas Too hard to show people my creations Everything i do has too many errors, and it's too hard I don't get bored!!!
please login to cast your vote and see the results of this poll