‘Stupid’ Question 13: How do I explain to my friend what a framework is?
From time to time I get questions about things that I mention on my blog or twitter from non-nerdy/geeky friends. As a part to the 365 questions I’ll add a few ‘how to explain questions’ – because I would love to get more non-programming friends involved in this world so I can share this beautiful world of programming.
.
You often hear programmers talk about frameworks, it’s framework that or framework this. And depending on who you ask, and the context of the question- anything can be a framework. But I would like you to think of the skeleton of a house, you’ve seen those when they start building houses. They set up the basic structure, the foundation; there is a plan, and maybe even a set of rules and recommendations for how to get the most out of this. How much is pre-defined varies, but all the houses with the same framework won’t end up looking the same. And that foundation, skeleton, plans, blueprints and so on is actually just code. Somebody has gone ahead and put together something that we can continue building on, and how much is done beforehand and how much we can add – or how many frameworks can be combined or work together varies. And as with houses, a solid foundation is of very high value as it helps build something faster and more stable – but only if it is a good framework and the builder knows what he/she is doing.
If you have a better explanantion let me know, these things can be really hard! :)
Comments
Great explanation! Even after 8 years in the game I sometimes have trouble explaining this. Perhaps the longer I work the harder it gets to explain other people. :) trying to explain the difference between a framework and a library can sometimes be hard, even to fellow developers!
"trying to explain the difference between a framework and a library can sometimes be hard, even to fellow developers!" Your code calls library code. Framework code calls your code. That's the best definition I know of: http://martinfowler.com/bliki/InversionOfControl.html No idea how to explain the difference to non-programmers, though. It's also known as the Hollywood Principle ("Don't call us, we'll call you"), so maybe an example about making phone calls might help to explain it?
My way of explaining the difference between a library and a framework, is that a library is a tool -- you use (or don't use) whatever part suits you, while a framework is a way of life: it affects every aspect of how the application is designed and implemented.
Last modified on 2012-08-01