It's Okay to Use Frameworks

It's Okay to Use Frameworks

I recently sat in on a conversation that rubbed me the wrong way. Ultimately the group ended up going with the decision I agreed with but the conversation we had to get there should have been a whole lot shorter. The group was debating the finer points of using frameworks that are developed by third parties. For example: AngularJS, JQuery, Backbone, Knockout, etc. I'm not entirely sure if the point I took away was the point they were trying to make but I don't know what else they could have been advocating. They kept saying how hesitant they were to use any frameworks; JQuery seemed to be the only one that was generally acceptable and anything else was a "big risk" according to those in the meeting.

The general consensus for much of the conversation was that at any point in time the developer of the framework you choose could just pull the rug out from under you. They didn't offer any actual examples of this happening but I'm sure there are plenty of examples out there where the author just let the project go stale. What I could not understand was why they were expressing this concern when every single library they mentioned was open source. They kept discussing how terrible it would be if Google suddenly dropped AngularJS or created an entirely new framework that deprecated the old one, or made fatal changes in future updates. They spoke of these "problems" with a tone that implied how much worse that situation would be than if we owned the framework ourselves and were always the only ones responsible for maintaining it.

Setting aside the fact that I couldn't find any good examples of super popular frameworks just being tossed to the wind forever, I can't see why open-source dependencies are a problem. Right now at this very minute AngularJS is awesome; it's a wonderful framework that makes client-side MVC development a breeze and oh so much fun. That means that AngularJS is good enough right now to make me want to use it. The Angular code is totally open-source and all I need to do in order to make sure that it stays available to me forever is to click one single button on Github.

It's not going anywhere unless the entirety of Github vanishes too (even then all I'd need to have done is clone the repository to any machine I desire). Once I've forked/cloned the repository the code that I already love as it is right this minute will be available to me forever. I won't lie, If Google decided tomorrow to toss Angular out on its ass and give a middle finger to the entire web development industry that would suck pretty bad and I would be sad. Google is the author and largest contributor, so the biggest source of bug fixes would be gone. Any future issues with the existing code will have to be solved by me; but is that really true? I think it's very safe to say that if Google took their repository down it would be back up that same day by somebody else. At first there would be a ton of AngularJS repositories scattered all over with nothing "official" yet, but the community is not completely disjointed. With time one or a few popular AngularJS forks would emerge and the community would start contributing as they always have. What did we really lose here?

The same applies if Google released a totally upside down major version that was not at all backward compatible or if they ditched Angular for a new framework that would deprecate it; you don't have to upgrade. So ultimately the code isn't going anywhere and we could continue using it and iterating on it for as long as we feel like it's benefitting us. Compare that to the approach of building something "Angular-like" from scratch so that we can maintain it forever. You've saved yourself almost nothing if you re-invent the wheel like that just for the sake of avoiding a third-party open-source dependency. You'd ultimately be taking all that hypothetical work you were so afraid of having to do if/when Angular vanishes from the face of the Earth and placed it at the front. To the novice that might seem pretty reasonable, doing that work up front so as to avoid having to do it later, but you don't even know that you really would have to do that work later (it's more than likely that you won't).

By doing all the work of re-inventing your favorite web framework at the start of your project you are guaranteeing that your project will take you longer to write. By using something like Angular you eliminate tons of low-level work up front with the faint risk of having to do some more work later. What many developers fail to realize is that maintaining a well-written framework after it dies is so much easier than replacing the framework in your large enterprise application. If you really ended up having to do that at some point then you've lost nothing and are just back to square one, except that you now have an awesome and well-documented codebase to maintain as your framework instead of a "get it out the door ASAP" piece of garbage that you wrote in the beginning to avoid your imaginary "doomsday" scenario.

Stop wasting your time and use the frameworks that you like. Putting in a little time to learn some of the popular frameworks will save you so much effort in the long run. Building everything from scratch is an easy way to let the rest of the industry whirl past you while you toil away re-writing yesterday's technology only to find out that in five years you have to replace it anyway because your code wasn't scalable enough to keep up. The bug fixes, added features, and newer deprecating frameworks are all bonuses. If you like a framework and its working for you right now then use it! If your application is an enormous enterprise application and you're worried that you'll have to rip a deprecated framework out of it down the road, ask yourself if picking a well-written and well-documented open-source framework is really going to be the end of times for your application if that situation actually happens. The worst case scenario is that your team eventually has to carry their own fork of the code forward.

We are human and that makes it easy for us to get caught up debating problems that barely actually exist, if at all. I've spent more time reading these arguments than I have re-writing an application because the framework I wrote it all against got swallowed by a black hole. I encourage all of you to stand on the shoulders of the giants in the industry and feel confident about that decision.

Happy Coding!