Silly Rabbit... Frameworks are for Prototypes
blog.getify.com
blog.getify.com
Agreed. For example, you should never use anything above assembly, and especially not high-level languages like C++, Haskell or JavaScript, which are filled with abstractions. Those are fine for prototyping, but for production you should switch to good ol' NASM, only making calls to libraries when appropriate.
We're all familiar with spaghetti code--you know, functional flow that winds its way through the source files and ends up in a big tangle.
"Aha!" we say, "This is awful, let's fix it."
So, we build all these layers of abstraction, with the hope that we can swap out any layer at random and things will be fine. This is lasagna code, and ends up being a gooey mess whenever you try to change a layer--you can always add layers, mind you, but actually removing one in the middle can prove to be quite messy.
The fix is ravioli code: Little self-contained bits of code with small, well-defined boundaries and implementations well-isolated from the outside world only communicating through messages.
~
The author does make a valid point, though: debugging through lots of abstractions is kind of a pain in the neck, and depending on the app a bunch of custom concrete code can be a lot simpler to maintain.
That's the siren song, though...that code is much easier to deal with until it isn't and then you're screwed.
You are reinventing the wheel, slowing yourself down and making maintenance more difficult by creating everything from scratch everytime. I think that's common sense among developers.
That's exactly how everyone else develops (but using open-source libraries): use a module system and glue together things from previous successful projects (made by other people). Why your own private framework is better than what is out there is a whole different matter.
And, btw, it's not private. Most of my code is on github. I just don't try to force it down others' throats.
Picking up bits and pieces from old code isn't a framework. Its a specific tool. Think of Backbone or Ember or Angular as a mechanic shop. Things work a very certain way. The copy and paste code from other sites is a hammer, or wrench. You don't have to use them a certain way, but when you have them, you can use how they are intended.
Unless it solves a specific problem you have, not using any framework will almost always mean more bugs, brittle code, a less consistent API, lots of documentation effort (or lack of) and a much larger learning curve for people other than yourself.
Not to mention that these frameworks undergo alot more extensive testing than an average developers code will ever go through. By using a framework you benefit from not having to go through the pain of dealing with all the different browser models and quirks that every version introduces or takes away.
For really advanced or incredibly high performance tasks you might be correct but to me that is the 1% of tasks, for everything else a framework should give you all the scaffolding you need allowing you to instead focus on tasks that add real value into the product/service you are working on.
What I don't do is make intrusive assumptions about the entirety of your application's architecture simply because you include my one little focused tool.
This is particularly what I value in open source frameworks - the hundreds, thousands, tens of thousands, maybe even million of man-hours that have gone into debugging edge cases, cross-browserifying, and finding security holes, stuff I would never be able to replicate on my own in any reasonable time frame. Especially the latter, given the security situation on the internet these days.
My SOP is, stand on the shoulders of giants, unless there's a particular requirement that precludes doing so. Such requirements are rare, most client work actively benefits from use of a framework.
Lots of frameworks interoperate well and are amenable to customisations. The good ones are more than sufficient for most client needs, even for prolonged production usage.
Most open source frameworks are results of thousands of man-hours of effort by specialists from different backgrounds. Many aspects like security, modularity and functionality are examined by hundreds of eyes. It is perhaps naive to assume that one's knowledge of the domain is so good that they can roll out their own framework much better than what anyone else has produced.
In fact, if that person is so capable, they should be encouraged to post their code for a public review and help others (or possibly be severely critiqued for their questionable design choices).
Ironically, the site I vaguely referred to in the post WAS actually fully open-sourced. But NOT so that people could look at that code and say "Ah, he's saying that I should always do that same thing with every site I build".
In fact, the truth is that it is too easy in programming to skip the painstaking effort of reading and adapting to someone else's codebase. It is simply convenient to throw everything away and start from scratch embracing the (in)famous "Not Invented Here" syndrome.
I think this definition is a good starting point for thinking about the difference between a framework and a library.
If your goal is to move forward on a complex project adding features instead of re-inventing the wheel for n-th time, use a framework.
So there are only 3 possible choices:
1. reinvent the wheel 2. use a framework 3. write your own framework.
This 'light glue code to bind together my libraries' thing someone mentioned. That. That IS a frikkin' framework! And it sounds clunky as hell.
But...
> You know what I did? I wrote a framework for that site, and I called it “the site”.
The key differences between my "framework" and these popular frameworks:
1. I'm not holding out my "framework" for that specific site as some general reusable "best practice" for every other site on the planet.
2. It's highly customized, and customizable, to the specific site. When I don't like how events interact with views, I don't need to worry about forking some general framework project (and creating upstream update nightmares) and hacking into the guts of it to change the assumptions it makes. My "framework" is much thinner of abstraction, and far less convoluted.
Not because my "framework" is better. Just because my "framework" is specific to the task.
Oh.
I think the best way to look at it, is use what you need. You don't need a 140 piece tool set to hammer a nail.
My customers do not care about it at all, except for the fact that the site looks better than if I had done it from scratch. My users probably do not even have any idea what a CSS framework is.
Yeah, if it makes more money, some day, I might consider dedicating some of it to replacing the CSS framework. But it's really, really far down on my list of things to do. There are lots of improvements I could make to the UI without ditching the framework, for instance, that would add real value to my customers, and/or increase conversions.
It's all about the economics and tradeoffs of different choices, in the end. Sometimes a framework is a good tradeoff, sometimes it isn't, and it depends entirely on the particular set of details involved in any given situation.
1) the overall structure of these arguments is "I've found the one true way to work, anyone who works differently is wrong, but I'm just sharing my opinion so you can't critisize me back" aka "I'm right, you're wrong, IMO, neiner neiner neiner"
2) the author claims that for a major site he wrote his own " URL history management, navigation, Ajax’ing of links, templates, events, etc.". And that this is a good thing. He, like framework authors before him, made inevitable design decisions, created conventions and generally created a way of working inside the app. Now people who aren't him are going to have to maintain this work. Instead of giving his client a standard framework that new hires might have experience in, he gave them MyFramework(tm). He has worked against long term maintainability and then congratulated himself for it.
2b) as they learned more, he re wrote based on specific knowledge of his own system. With an established framework, others could have opined, with his self-rolled framework he was a key-man.
3) In his discussion of backbone he throws up an incomplete straw man of "only 2 of 10 know it" then concludes "therefore learning my framework is just as reasonable.". False. First, backbone is extensively documented and almost guaranteed to be easier to learn than a custom rolled framework. Second, time invested by the other 8 in learning backbone is a re-usable skill they can carry with them to their next job, as opposed to time learning your framework that will not transfer. Third, backbone experts are available on call and on demand, if they need to grow the team or you get hit by a bus your client can replace you more easily if the app is written in backbone.
4) Maintenance. Here he claims that his framework is at least as well documented as other frameworks, and implies that it is better documented. He then says it is hard to write good code and good documentation without a framework, so don't be lazy and do it. "it seems many people have trouble building maintainable code without [frameworks]. Don’t be one of those lazy people." His example here goes completely against his larger point in any reasonable interpretation. If many people have trouble writing maintainable code without a framework, all else equal, that's a very strong argument for using a framework.
5) pain now vs later. He assumes here that all frameworks are optimized to get going quickly to the detriment of long term maintainability. This is patently false. Django and Ember come immediately to mind as frameworks that explicitly make you do things a slightly harder way because future self will thank you. Some frameworks (Wordpress comes to mind) optimize for getting started quickly, but at best this article is an attack on those.
6) extreme narcissism. "Your boss and your client don’t understand our industry, they don’t understand how the web platform works. And they will rarely care about such details. They’ll never care if you never help teach them by pushing back.".
6 cont) he happily puts his interests as paramount, then disregards the perspectives of others. Managers care about the long term viability of the project and hiring and budget, not just one person's happiness on the project. Instead of saying "they don't care about our industry" perhaps the author should spend more time positing that they are reasonable people whose requests come from reasonable places. They have information and concerns that you don't, stop waiving your hands and calling their perspective invalid.
This article is myopic. Self centered. Selfish. Unnecessarily inflammatory. And, almost entirely wrong from start to end.
You said "almost entirely wrong". What did I get right?
* when a project has extremely high performance requiremets, rolling your own often makes sense.
* some frameworks do make really bad long term tradeoffs in the name of getting started quickly. (ironically though, I don't think any of the frameworks you listed fall into this category)
* if you have something that you're guaranteed is only going to be maintained by yourself (ie your own blog) then a lot of what you've said becomes "not wrong"
There are probably other things, but those are the two that come immediately to mind.
Instead I saw someone proudly bragging about reinventing the wheel and NIH syndrome. Which is mind-boggling.
I use all kinds of public OSS'd libraries and tools. I just don't use frameworks that prescribe an exact way those should be glued together, nor do I stick my own opinions about how the glue should work out "there" to try and convince others they should do it exactly like I do.
I think mostly, you want to always know what the limitations of your framework are, and never be afraid to dive into the source of the framework to see why certain things are slow/buggy, etc. If you can do this, you will be in much better shape than 75% of the users using that framework.