Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Today, one can find a framework for just about any language, to suit just about any project. Most modern frameworks are fairly robust (generally speaking), with hour upon hour of testing, peer reviewed code, and great extensibility.

However, I think there is a downside to ANY framework in that programmers, as a community, may become so reliant upon their chosen frameworks that they no longer understand the underlying workings, or in the case of newer programmers, never learn the underlying workings to begin with. It is easy to become specialized to a degree that you are no longer a 'PHP programmer' (for example), but a "Drupal programmer", to the exclusion of anything else.

Who cares, right? We have the framework! We don't need to know how to "do it by hand"! Right?

The result of this loss of basic skills (sometimes to the extent that programmers who don't use frameworks are viewed as "outdated") is that it becomes common practice to use a framework where it is not required or appropriate. The features the framework facilitates wind up confused with what the base language is capable of. Developers start using frameworks to accomplish even the most basic of tasks, so that what once was considered a rudimentary process now involves large libraries with their own quirks, bugs, and dependencies. What was once accomplished in 20 lines is now accomplished by including a 20,000 line framework AND writing 20 lines to use the framework.

Conversely, one does not want to reinvent the wheel. If I'm writing code to accomplish some basic, common little task, I might feel like I am wasting my time when I know that framework XYZ offers all the features I am after, and a whole lot more. The "whole lot more" part still has me worried, but it doesn't seem that many even consider it anymore.

There has to be a good metric to determine when it is appropriate to use a framework. What do you consider the threshold to be, how do you decide when to use a framework, or, when not.

share|improve this question
    
When its a framework that's not a Microsoft proprietary product and you need to connect to an MSSql database. –  AndrewKS Feb 18 '11 at 22:15
1  
The point about everyone getting "too specialized" is quite ridiculous. Can you write assembler code for the x86 platform? If you can then can you do the same for let's say 8051? Even if you are able to do both there's plenty other things you can't do. Today it's TEAMWORK - you need to know as much as to be able to do your work & be able to cooperate with others. That's it. –  kubal5003 Feb 19 '11 at 0:35
    
When that framework is made in Perl. Bloated/closed frameworks also piss me off. MsTest is one example. –  Job Feb 19 '11 at 5:19
    
@kuba5003 - As it happens, I can write both, but that's not the point. :) Even were I unable to write in those languages, I still ought to have a conception of them -if I were going to write device drivers-, even though I could and probably would use a much more high level language to accomplish my end goal. In the web world, a "Drupal programmer" ought to have a foundation in PHP. My argument on this score is that there is a bell curve of specialization, and when you specialize to the exclusion of basic knowledge, there are diminishing returns. –  Chris Apr 8 '11 at 23:19
add comment

5 Answers

up vote 13 down vote accepted

"There has to be a good metric to determine when it is appropriate to use a framework."

Not really. If there were good metrics for determining appropriate use of any technology, you wouldn't see language, editor, and methodology holy wars.

The groups I've worked with all do the same thing - make a guess at costs and benefits, choose the most productive route, and hope they're right. It's not terribly scientific - one part intuition, three parts experience, one part susceptibility to marketing, one part cunning, and five parts rank opinion.

share|improve this answer
add comment

Frameworks are just tools. I don't think it's a framework's fault if it is overused, rather that of the person overusing it. The old saying "if you have a hammer, everything looks like a nail" shows this way of thinking has been existing long before even computers.

Becoming too specialized can indeed turn into a problem in the long term - for a developer as well as for biological species. For long term survival, one has to carefully balance the effort to develop his/her skills in multiple areas.

To answer your specific question, I don't think there is a metric for this. I prefer using a framework when it simplifies problem solving. If using a framework helps me solve a problem with 2 lines of code instead of 20, I will obviously use it. But even if its 20 lines against 20, I might decide to use a framework if it gives me better abstractions, closer to the problem domain, making the code easier to understand and maintain.

share|improve this answer
add comment

I think that frameworks may be overused in some contexts, yes. A framework is just a tool, yes. A framework allows you to get something running very quickly, and as such is an excellent prototyping tool.

Somewhere along the line, when your application reaches some level of complexity, the restrictions inherent in a framework begin to stifle further growth, it seems to me. The trick is to recognize when you have encountered such a tipping point, and then to decide what you are going to do about it.

share|improve this answer
add comment

Do the other developers know the framework?

If all developers know framework X, then given all other reasons for using the framework are viable, go for it! To me, it doesn't make any sense to enforce learning a specific framework when the majority of the development time will be spent learning the intricacies of the framework.

Regarding your statement on newer programmers not knowing the basics, you're a lot more compassionate than I am! Yes, it's a shame, but am I going to spend my time worrying about someone else's ineptitude? Nup. (Based on the assumption that these new members of the community aren't immediately working with you.)

share|improve this answer
add comment

I would use a framework if (and ONLY if) the following conditions hold true:

The framework seems likely to be supported for some time. I've had them go end-of-life on me before, and it's REALLY annoying. Especially when you're 9 months into your project, and switching isn't really an option anymore. And if the framework is ALREADY no longer supported, then think three times before you write something new using that framework. No matter how well you already know it.

The project actually matches the framework. As a pretty old example, have you seen the things that MFC was made to do? People did no end of strange things to make it work for types of apps where it just didn't make sense. Usually spending more time beating up on MFC than they would have spent just writing the app they wanted straight up.

The project team is capable of working within the framework. Some people don't or can't take the time to understand how an app should be written in a given framework, and instead they write things the way they usually do, instead of the way that the framework needs. This mis-match between code and framework usually ends up costing everyone lots of time and effort.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.