DEV Community

Victor Basumatary
Victor Basumatary

Posted on

Why Do Frameworks Suck?

I believe the answer is bias.

Another way to frame the question would be: Why doesn't the framework feel half as elegant and easy-to-use in the real world compared to the quickstart tutorial and example projects?

We gotta take into account the framework developer(s)'s original intention when developing the framework. What problem were they trying to solve? All frameworks are built to solve a problem. A framework to solve a general class of problems? Now that's difficult. Very difficult. As difficult as making a class that's "general". Which is why people just make interfaces. I think.

I remember when I first tried PHP. I was a kid. It was magic. I didn't understand jack except that echo "Hello world"; gives me some output in the browser. And that's all that really mattered. Then I understood it a little better, and had also begun to think about abstract ideas like modularity. That muddied the water. It's been a long time since I felt that magic when I was a kid.

Yes modularity is good, I mean who here likes to go through hundreds of lines of copy-pasted code amirite? But it's bad if the modular code was never designed to solve your problem. Modularity in high level languages usually come in the form of files, classes, namespaces, etc. and they work great. You take it a step further and you get frameworks. The difference is the modularity is no longer general. Facebook was built with PHP. There are many PHP frameworks for building websites, like Laravel. It's not impossible but you'll feel lesser pain building Facebook without a framework than with one. Probably. Please leave comments. Thanks.

Frameworks have a place. They're amazing if every dev using one knows exactly what it was built for and why. Otherwise it's a lot of reading the docs, logs, stackoverflow, and cursing the screen. The beauty about the design of computer languages and their strictness is that they guide you in how to build a program. "NO YOU CAN'T PUT A STRING THERE please use a string type thanks." Frameworks try to emulate that, at a higher level, but imo usually fails spectacularly.

These are just my thoughts. I didn't think everything through. Woke up maybe 2h ago.

Top comments (1)

vlence profile image
Victor Basumatary

I suppose another nice thing about frameworks is that it's really easy to organize tests. The framework itself tells you how to organize tests. Once you have some experience with the framework you can write tests before writing any logic. Like that the tests act like todolists.

An Animated Guide to Node.js Event Loop

Node.js doesnโ€™t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.