DEV Community

David Wickes
David Wickes

Posted on • Edited 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 (330)

Collapse
 
azmat_ulhaq profile image
Azmat Ulhaq

We were using Bootstrap earlier and it is convenient for beginners. Also, we created lots of websites using the Bootstrap framework. I don't have much idea about other frameworks but you can try as per your requirement.

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.

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