Get over frameworks.

Years ago I was looking for an answer to a pretty simple CMS question, I believe on WordPress, and not surprisingly, I found an answer on StackOverflow related to whatever random query question I had.

One of the comments stayed with me. In more or less words the user said - “I agree with this solution. Though I usually write my own CMS from project to project so I don’t have to mess with this stuff.

Aside from the useless vanity that this added to the conversation, I was and remain still pretty shocked at this response. 

Certainly on the surface, it’s a bit of trying to show off, but it unfortunately fails. At the initial time, I thought, in my inexperience, “Wow, I wonder how you would make a system like WordPress from scratch."

Today, I’m reminded of Joel Spolsky’s article - “Things you should never do, part one” - shaming folks who casually and often with pride throw out “old” code as if it had rusted. In the article, Spolsky observes that, yeah, learning someone else’s codebase is harder than birthing your own, but provided codebases, whether from a legacy project or from a package CMS framework, have one advantage - they’ve been tested and have loads of bug resistant lines in them.

While I was willing to admit pretty early on that it was a waste of my time to write link functions or SQL sanitizers, when it came to the front end I was pretty adamant that I was not only an expert, but my code was better than dealing with a front end framework whether in for JS or CSS.

Of course I used jQuery and CMS provided JS libraries, but I scoffed at Angular, Ember, and particularly Bootstrap. After all, I didn’t want a site like everyone else, and my service connections would be simpler if I didn’t have to write them around a controller and factory object.

Bullshit.

Now look - I love to learn how things work, to get to how a sorting or searching algorithm works, and just feel like I could maybe build something from scratch. I like to think I could butcher a pig if necessary from my years in the kitchen. 

But if you actually are trying to build something - an application with intent, meaning, and users - then there is absolutely no reason to waste your time writing an email validation function or creating your own binding system. If software is about expression, you aren’t expressing yourself. You’re repeating others.

Is there any shame in an architect using a plumber? Does he or she have to design all the pipes? Sure maybe in some cases - but I seriously doubt any architect is crafting their own nails. 

So using front end frameworks like Angular / Ember and Bootstrap as sounding boards let’s dispel a couple ideas (mainly my own) about using frameworks:

I’m cheating myself and not learning because I’m just putting together someone else’s stuff like Legos.

No. In fact the opposite, you are learning how to tackle the problem that your application theoretically solves. Ideally, this is the hard part and unique problem space that you and NO ONE ELSE has. 

Again, if you want to try and make Pac-Man from scratch to learn how a game engine works, by all means, but when you sit down to make your 8-bit art action clone, which is so unique, the thing that you need to focus on is delivering the product. No one is gonna pat you on the back because you wrote an engine from scratch if no one ever plays the game.

I have to undo a bunch of stuff and the framework just gets in my way.

No, just no. If you so chose to use the ‘btn btn-default’ from Bootstrap to style your <button> then you have about 10 CSS rules to override. Furthermore, nothing in the framework is going out of its way to make all buttons do this style. Even if you get an annoying rule like:

strong { font-weight:normal; }  // THIS IS REAL

Just override this. Likewise, you are welcome to not have the application owned by any controllers if you so chose. Even with a server-side framework, you can always plop users into the folder you need and work around routing if so be it. Wanna Drupal site with a Blog powered by Wordpress, and a help section run by Rails then a custom “About Me” page - you can do this.

Oh geeze, there’s always just another framework I’ll have to learn.

Yeah, no shit. That’s called technological progress. Sooner you get over this, the better. There’s a pile of languages to learn, but understand that most languages / frameworks / build tools and so on are related to others and are usually designed to solve a specific problem. They are a tool.

Maybe employers will plaster that you need to know every JS framework under the pale blue moon, but that’s hiring managers trying to cover their asses. You will use the framework that is most appropriate to your problem space, and knowledge in one will most likely support skill acquisition in another.

For example, I worked with Ember professionally for a little bit and ended up loving it. However, when I approached my next spec project, I chose Angular instead as it better integrated with Rails and had a slightly lighter touch than Ember in my opinion. 

What if I need to customize something?

Knock yourself out! You may need some wild form interaction such that Bootstrap isn’t going to cut it. Cool - just use its grid system. Or dont! Need some JS that doesn’t work well with JS frameworks’ Promise system or data binding? Not sure how that would happen - but yeah, go ahead.

One Small Caveat

With a lot of module development particularly with Drupal front end tools, I have seen a giant mess of code that was nearly impossible to undo to make work for my clients’ needs and I’ve had to do basic stuff like Slideshows consistently.

This mainly happens as a lot of modules are created with the following thought in mind: “Hey, I built this really specific tool for my company. Let me make the colors look like Garland, kill the logo and BOOM! open source.”

Totally fair, but where content entry and front end meet, symbiosis is necessary. Often this is what is missing - the front end is provided and then content entry is jammed into there like adding cocktails to a light salad lunch.

Overall

Get over it random guy from StackOverflow years ago - use the tools to save time and customize as you need, focusing on your problem / domain space more than your ability to craft something by hand.

Think about it - a custom car may look cool, but damn, I certainly don’t want to be in an accident in one. Use tested software to make your products survivable in the wild.