DEV Community

David Wickes
David Wickes

Posted on • Updated on

Why You Shouldn't Use A Web Framework

What framework are you using? Are you using Bootstrap, or Materialize, or Foundation? Or Vue, or Angular 1, or Angular 2, or Ember? Or Ruby on Rails, or Sinatra, or Express, or Meteor, or Flask, or Korbin, or Hapi, or Spring, or...

Frameworks are all terrible. All of them. I'm serious - they are making you all into bad developers. Stop using them now.

Let's talk about this, as I may have lost most of you with that opening. Why do people like you like frameworks? Are you weak or are you stupid? Or both?

A framework means I don't need to reinvent the wheel

Sure, I'm building a bike. I don't need to reinvent the wheel, I'll just grab a framework with a wheel.

And a steering wheel

And a bonnet. In blue.

And an engine.

And a CD player

What, you don't have any CDs? Fine, just don't use it. Or just use the CD player to MP3 player adapter.

For your bike.

Which you're still building. But now on top of a car.

But it's fine, because AutocarJS has a modular plugin system to allow you to add bicycle pedals to your car-bike abomination. It's easy. Just type 'autocar scaffold add pedals'. Or edit the autocar.js.manifest.nightmare file.

This is much easier, eh?

"You don't need to reinvent the wheel" is fine under two conditions:

  • you know how a wheel works
  • you know how this wheel works
  • this wheel doesn't come with a whole bunch of crap you'll never use
  • you only want a wheel

It's easier for beginners to use a framework

Sure, if you're a Sith.

What? Yeah, a Sith Lord in a weird black bunker. You went for the fast path to ULTIMATE POWER, but you still don't really know how HTTP works. Or what a POST request looks like. Or how to write a form element. Or how to use a database without some freaky ActiveRecord nightmare layered on top...

And it's addictive, Because you don't know how anything works you'll spend your career chasing the NewShinyFrameworkJS because ShinyFrameWorkJS didn't quite do what you needed. You will suffer from eternal imposter syndrome because you don't know how anything works. You will get your job done, you will be a 'React Developer' or an 'Rails Developer' and you will wonder what went wrong.

True story. When someone interviewed for a position at a well known coding bootcamp they were asked to do the FizzBuzz kata in Ruby. First thing they typed at the command line?

gem install rails
Enter fullscreen mode Exit fullscreen mode

You're Anakin Skywalker and all you've got to look forward to is a life where you have no idea how anything works and your career and livelihood is built on the sand of your ignorance. No, you're not Darth Vader. You're not that cool. You're Anakin and you suck.

Angry Vader is Angry

But it's really hard without a framework

Is it? Is it really? Have you tried to write something without using a framework? I mean, can you write a beautiful, complicated, client-facing website without a framework? Say something like GitHub...

Github has no framework nao

YES YOU CAN!

The web is a much better place than it was ten years ago - hell, ten months ago. You don't need a framework - you just need to spend a few minutes reading the docs on MDN. You don't need Sass, CSS has variables now. You don't need Bootstrap, flexbox or grid are your friends.

What about that server stuff? How does that even work unless I'm using
a framework?

Are you kidding? Have you seen how simple HTTP is?

Easy HTTPeasy

Look, an HTTP request:

GET /hello-world?framework=none HTTP/1.1
Accept: text/html
Host: my-hello-world-server.com
Enter fullscreen mode Exit fullscreen mode

Does this seem too hard to parse? Really? You can read it like it's words almost. It's just a big old string. You should be able to extract out the which content type you want to accept, the method, and the query string parameters for this with any language you choose. If it's this easy, why are you relying on a bloated, opinionated framework to do all the work for you?

I'm not saying you should write your own abstraction over HTTP - almost every modern programming language has an abstraction built in that will do the heavy lifting for you. And if it's not built in then it's a readily available library. Go use one of them - an easier way of interpreting requests and responses over a socket. Which is really all you need.

'Abstraction over HTTP' is the key idea here. That's the bit that needs abstracting away from a stream of bytes over a socket into something sane. A framework is an abstraction over... a whole mess of things. It's usually an abstraction over somebody else's idea of what a website or a program ought to be. It's not your idea, it's not your product - it's theirs and it's limiting your creativity.

Learn the basics, not someone's abstraction

Stack Overflow is full of questions like "how do I do X in framework Y" with answers that range from "why do you want to do X?", "No, you can't", or "you can't do X, but why not do Z?".

It's because the poor dev asking was used to using a framework where the database was attached to the request object or whatever, and now they're using NewShinyFramework with a completely different abstraction. They leaned the wrong thing.

If you want a solid start to a career, don't learn a framework and a framework's abstraction; learn the fundamentals.

Don't learn Express's routing system; learn how HTTP works.

Don't get familiar with ActiveRecord hacks to make your queries faster, learn to write SQL.

Don't learn how to build React with Redux with Bootstrap with JQuery, learn HTML, CSS and JavaScript.

For 99% of what you need to do, they will be more than enough.

This knowledge will never get stale.

Unlike frameworks.


Update

I wrote a continuation and response to this post:

Latest comments (329)

Collapse
 
wholostevee profile image
Evee

I'm so glad I came across this, I'll make it short and sweet, there are going to be plenty of nerds in the comments over here defending their frameworks but I'm glad someone mentioned the elephant in the room, the people who wrote the languages you're using obviously didn't use frameworks and by coincidence they're writing better code than anyone in the comments here, most people obviously don't understand what's going on behind the hood and think they're programming when they use frameworks, I personally hate them all, i like my code to be optimal and don't trust whoever is writing these frameworks to be as good as me and that's why i didn't move into web development since I would have to use something like react which is so cringe. 100% agree with this, if i could write code with this guy I would.

Collapse
 
manelgonzalezops profile image
ManiloxGT

Just get a girlfriend

Collapse
 
devs001 profile image
devender

We can go much deeper learn how assabley work . But we need build something great on what our predecessor have done or are nothing different then chimpanzee cus they can't learn new things with communication

Collapse
 
king11 profile image
Lakshya Singh

I come from the future and everyone here is a MERN Stack Developer sadly ;___;

Collapse
 
joaquin144 profile image
Joaquin144

I am new to development. today's my 2nd day in android.
How should I proceed? I want to be among top 1% developers. Any suggestions on what and what not to do?

I also feel the same about frameworks- That they can make a program super easy but can never make you feel the true taste of programming. The time and effort you spend in creating little things develops your intellect- a thing which frameworks can't do.
One should definitely go for frameworks provided that he knows the logic behind them.

Collapse
 
33nano profile image
Manyong'oments

'Learn the basics, not someone's abstraction ' That hits pretty deep. Hugo is the way to go

Collapse
 
joshua_am12 profile image
Joshua

I'll just leave this here. The next guy to develop a solid new language will probably be asian, indian, or europian.

Collapse
 
joshua_am12 profile image
Joshua • Edited

I also think it's a generational thing. X and millennial think they know everything without making a single contribution to the society. That's the general theme, and a college degree validates all of their view points in their eyes. It's falling out of popularity according to statistics.

Collapse
 
joshua_am12 profile image
Joshua

Some guy said it'd take 5 years to create a login page wow. Some people just join for a dollar bill, others like what it is that they do.

Collapse
 
ozzythegiant profile image
Oziel Perez

I think the point of a framework is really so that we can have our development team on board when it comes to how to write an app. It also makes it easier to integrate newly hired developers on to a project right away. As a developer that has dabbled with many frameworks, I believe you can still learn what goes on under the hood, to some degree, by looking at the concepts that most frameworks have. For example, in back end development, most frameworks use an MVC architecture. Over time, this architecture should help you easily pick up new frameworks, or code your own from scratch. Thing is, we all have deadlines to meet so a framework really helps us to get things moving quickly, knowing we are using well tested tools for the web.

Collapse
 
dcook profile image
Dan Cook • Edited

In regards to missing deadlines, etc, if you don't use frameworks: No, it would actually be faster, and the code would be smaller, because you can design it intentionally (more on this in a bit).

There is skill in knowing when (for each thing or at each layer) to use a well designed tried and true library versus rolling your own, but in either case that's about composable units that you use to fill in holes of meaning (aka abstractions) in your program.

With frameworks, it's the reverse: You fill in the holes of something that's not the thing you are designing (how could it be?), and which must deal with 1000 other things that do not apply to your project, but affect what you get and how you must use it.

In either case, the software being developed exists solely to model and enact some specific human value, which must inevitably be designed and delivered.

So the real problem is actually not about frameworks per se, but that that design is rarely ever direct or intentional. Instead you get (in either case) a mess of mechanisms & patterns from which the desired model/behavior is supposed to emerge (e.g. by slicing it up among these things and rigging it to trigger in some clever way). It doesn't have to be either a bunch of kooky pattern(s) and mechanisms or a framework that does it for you. Just regular old programming paraphernalia, and good old abstractions of the actual human value.

Any decent program can be built on a simple foundation of abstractions that are fairly 1:1 with the human understanding of what the software is, and what it does (which are two separate things, btw). And those upon lower level abstractions, etc. But at each level, you are making components that compose like libraries, NOT a framework, and not a clever wire-up of a bunch of "patterns" (e.g. AOP).

But as soon as you break any of those rules, you get an incoherent mess. And unfortunately this stuff (which should be basic fundamentals) is not taught or understood very well, and many programming languages, paradigms, patterns, tools, and frameworks violate and/or encourage you to violate one or more of these.

And so frameworks only solve an artificial problem, while making it more impossible to address the fundamental problems they fail to solve, because the backbone of your software is now this framework instead of a codafied model of the value it's supposedly designed to deliver.

Collapse
 
leob profile image
leob • Edited

Right:

"Frameworks are all terrible. All of them. I'm serious - they are making you all into bad developers. Stop using them now" ...

All I can say is, total rubbish, biggest nonsense I've ever heard.

If I'm on a project or a job and I have to pay my bills at the end of the month, then the only thing which counts is "does it get the job done". If it does, then just keep using it. If it works, it works, it's that simple. In many (most?) cases it's not even for me to decide whether or not to use a framework, or which one for that matter.

If you have such a strong opinion about this then don't preach - show!

Convince me that it's so easy, and realistically feasible for a person with deadlines and without tons of time on their hands. Show me the absolute minimum CSS (and JS) that's needed for a real-world website, covering (amongst others) CSS resets, viewport, typography, color scheme, layout (grid, responsive), accessibility ...

When I see a convincing example of something that takes care of all this (and doesn't take weeks to put together), then I'll gladly drop my frameworks.

Oh and don't get me wrong, I'm 100% for learning and mastering the fundamentals, but that doesn't mean that not using a framework would be realistic or even a viable option on many projects.

Collapse
 
louislow profile image
Louis Low

Yep, the post title is a bit misleading. Strong words like joining a cult.

Collapse
 
trexsatya profile image
Satyendra kumar

Clearly, people are not going to avoid frameworks. A middleway could be - use the framework, but develop customize it often, that way you'd be forced to know the things under the hood.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.