views:

59

answers:

5

Hello

Sorry if this too open ended for this forum, but here goes. I mostly use languages such as PHP and Javascript without frameworks (e.g Jquery, Drupal, CakePHP). The only real exception to this for me, is Wordpress when 'traditional' coding is slower for building information sites.

I've dabbled with several frameworks over the past year and despite everyone else's (seemingly) good experiences with them, I seem to of hit a roadblock. My basic problem is that for the amount of time invested in effectively relearning a language, I don't get a lot in return. Jqeury as an example. There is really very little in that, that I couldn't accomplish easily with a few getElement.. commands. So my question is, what advantages do frameworks offer over previous coding styles?

Thanks from 2003 guy!

A: 

See:

Why Use a PHP Framework? The Benefits Explained

For me frameworks are life-savers, it is just initially that you invest your time in learning them. Once you have mastered them, you feel pretty much at home.

Traditional programming is time-consuming and highly error-prone and most importantly only you are responsible for debugging the issues and more because you have written it all in your own style.

Sarfraz
A: 

If you feel that learning jQuery is "relearning a language", then you probably need to work with Javascript some more, and do some reading about the nature of the language. Each of the popular frameworks impose a certain style of Javascript, each with its own foundational conceit upon which various facilities are built. However, they're all just Javascript, and the techniques they use aren't magic or special.

What you get from a framework is that stylistic consistency, coupled with the investment of time that the framework designers have spent towards ensuring cross-platform compatibility and performance. Yes, because it's all just Javascript and DOM APIs, you could certainly do it all yourself. It is a great thing, even as a full-time jQuery fanatic, to be fully aware of what those DOM APIs are and what they do, and to be fluent in their use. For the practical construction of real, production web sites, however, why would you want to shoulder the entire burden yourself?

Pointy
+1  A: 

To be simple: if your audience absolutely requires IE, use a library. If not, avoid it. The DOM API is sufficiently consistent and powerful in all other browsers. More about this issue here: http://azabani.com/51

Delan Azabani
"Sufficiently consistent" for what? Your statement makes a presumption about the sort of code that "should" be on a page. Native APIs are fine (especially for those willing to ignore half the internet and snub IE) but there are many situations that call for an additional layer of abstraction. Write your own framework if you feel the need to do so, of course.
Pointy
Can you explain "ignore half the internet"? Javacript DOM methods are almost universal, no?
YsoL8
No. Allow me to introduce you to a little browser called *Internet Explorer*.
Pointy
*"ignore half the internet"* = ignore IE, which holds ~60% of market share (and dropping thankfully). Yes they are universal, except in IE, which does anything moderately modern in a proprietary or unsupported way.
Delan Azabani
Here's a good reference: http://www.quirksmode.org/dom/w3c_core.html
Pointy
I'm still new to Javascript (can you tell?). I was under the impression that IE7 onward adhered to the DOM (more or less).
YsoL8
*IE7 onward adhered* Ahahaha, no. I'm sorry, you must be mistaken.
Delan Azabani
A: 

I guess if you already have a very big library with self written code, you can go with that. However every Framework does much work from you, and prevents you from making some simple mistakes or writing boiler plate code over and over again. Additionally a Framework can introduce you to new Design Patterns, that you have not used before but are now forced to use.

However you should always adapt your tools to your projects:

Simple Project: Own Library, forget about "bloaty" Frameworks Complex Project: Use a Framework that does much of the work for you

Tapdingo
A: 

In my opinion frameworks make life more easier, regarding to maintaining a larger web project. Most features are preprogrammed and ready to use. Often those frameworks offer different functions like multi-author and so on, which would need relatively much time to program it by hand. In my eyes such frameworks make sense when you have many edits in your content.

For a private Homepage, which is edited twice a year, such a framework won't make that much sense. Maybe it's nice to have a WYSIWYG-editor inside and donÄt have to upload something.

In my eyes frameworks are good for people, that aren't able to programm pages by hand or are so good, that people just don't want to hang up with "stupid coding" but editing the content.

For people like me, who want to have a learing effect, such frameworks don't offer much things to learn, because everything is done in browser. In this case only coding some extentions (joomla for instance) or something like that can bring me further.

At least it depends on the project (how big, how often to edit,...) and the one who realizes it ;-)

poeschlorn