On one hand, this is great. As developers, we tend to solve the same problems over and over again. It makes sense to take advantage of code that’s already written that solves the problem we’re solving right now. On the other hand, it’s so easy to become over-reliant on frameworks. It’s so easy to solve every issue by looking for a a bit of code somebody else already wrote to solve our problem.
What’s so bad about frameworks?
Because someone who’s got jQuery and Bootstrap down can build just about anything, right?
If you don’t know how to create a multi-column, responsive layout that works across current versions of all major browsers without the use of a framework, then you simply aren’t equipped to properly evaluate a CSS framework and determine if it’s the right one for the project at hand.
When is it appropriate to use a framework?
You might think after that little rant that I don’t use frameworks, but you’d be wrong. I do. In fact, there are a few that I’m downright smitten with. All their potential drawbacks aside, there are times when it just doesn’t make sense to re-invent the wheel. Let’s be pragmatic. When should you use a framework?
- When you can read through a framework, understand everything it’s doing, and why it’s doing it. When you can understand what decisions were made, and agree with why they were made. Go grab an uncompressed copy of jQuery and read through it some time – it’s beautiful, it’s simple, it’s elegant, it’s smart.
- When you wrote it yourself. Any developer finds themselves solving the same issues over and over – if there isn’t a pre-built framework that matches your style, create one yourself. You’ll learn more than you thought possible about the language you’re working in and will develop an even deeper and greater understanding.
- When you are not, and do not desire to be, a developer, but you really just want to get something accomplished fast. In the real world, sometimes a business owner really does want to build out their own website. They don’t care about making a CSS layout work cross-browser for anyone but themselves. They’re unlikely to ever tackle a web development project again.
- You’re learning and you need a leg up to be competitive. There are a million caveats here, but let’s face it – we all need to pay our rent, or land that job, or finish that project before the deadline. If this is where you are, see if you can poke around in the framework you’re working with to understand what’s going on. Read the documentation to understand the point of view of the creator and the assumptions that were made. A well-written framework can be a great learning tool. Be very careful not to rely too heavily on a framework – that’s like a baby that continues to crawl long after he should have learned to walk. Take every opportunity you possibly can to work without a framework so you can learn.
Hand-crafted by master craftsmen
On a recent episode of The Big Web Show, Jeffery Zeldman described a perfect analogy.
Let’s say you wanted to learn to be a luthier – a violin-maker. You could attend an all-weekend intensive course in violin-making. There, you’d learn how to choose the best pre-cut pieces of wood to assemble into the violin body. You’d learn how to evaluate the different types of violin strings on the market and how to buy the best ones for the type of wood you used for the body. You’d learn how to buy the right bow to match the violin you made. You’re a luthier, but you’ve taken many shortcuts to arrive there, and you continue to take shortcuts while you ply your craft.
Or, you could go and be an apprentice in Stradivarius’s workshop. There, you’d learn to walk in the forest and select just the right tree to fell for the wood. You’d learn how to cut and cure the wood. You’d learn how to cure and cut sheep gut to make the strings. You might even learn which shepherds would sell you sheep that produced the best possible raw materials. You’d learn how to gather and treat horsehair to create a bow – what breeds of horses, what age of horse, etc. were the best. And eventually, after months or years of working with journeymen and masters, you’d eventually be awarded by a panel of masters and be allowed to join a guild and call yourself a master luthier. No shortcuts taken.
You can tear a poem apart to see what makes it technically tick, and say to yourself, when the works are laid out before you, the vowels, the consonants, the rhymes or rhythms, “Yes, this is it. This is why the poem moves me so. It is because of craftmanship.”
But you’re back again where you began. You’re back with the mystery of having been moved by words. The best craftsmanship always leaves holes and gaps in the works of the poem so that something that is not in the poem can creep, crawl, flash or thunder in. – Dylan Thomas, My Definition of Poetry
In our hurry-hurry world, we’re always in such a rush to get where we’re going, but there are no shortcuts to becoming a master.
Dig into the nitty-gritty details. Read up on different opinions about progressive enhancement and graceful degradation and form your own. Tear apart frameworks, looking for the assumptions, the points of view, the opinions. Look for all the places you can ask “What happens if …?” and find out. Experiment. Play. Ask questions. Anticipate the unexpected. Learn your craft and execute it beautifully.
Because code really is poetry.
Image credit: Alice Carrier
One thought on “Why frameworks make me cranky”
Yup, great article, a lot of what you said really resonates with me. Being new, myself to the design and development world, I have been developing strictly with Genesis thus far and learning a ton and loving it. I am aware that I have holes in my foundation when it comes to CSS and HTML and design best practices. Where would you recommend I start to re-learn the basics to fill the gaps in my knowledge?