r/javascript • • Sep 23 '19

You might not need a framework

https://medium.com/@pljeskavicica/you-might-not-need-a-framework-79444bda50d2
70 Upvotes

129 comments sorted by

View all comments

271

u/ogurson Sep 23 '19

Hahhah oh my...
To all advocates of custom, self-written frameworks: wait till you'll find yourself in project where other guy thought the same way and now you need to understand his "small, smart, sexy invention" without docs or any other help on the internet. Then you'll appreciate value of thousands of stack overflow posts that keep answers to all problems in angular, react and vue.

0

u/[deleted] Sep 23 '19

[deleted]

30

u/[deleted] Sep 23 '19

No, and no. The frameworks you see are from software engineers, teams of them, that are much more capable than Jacob at Ad Buy Accounts, Inc.

Rolling your own code should always be a second choice, and a possibility in evaluation, but one you do not take lightly.

0

u/[deleted] Sep 23 '19

[deleted]

12

u/[deleted] Sep 23 '19

The point is that the chance of your homegrown framework being architecurally better, with better documentation and what not, than a widely used framework known and used by many are slim. Like you say, the good survive.

Not to mention the business value of being able to hire people who already know said framework, instead of having to spend a month or more to get to know the homegrown framework.

2

u/Silhouette Sep 23 '19

The point is that the chance of your homegrown framework being architecurally better, with better documentation and what not, than a widely used framework known and used by many are slim.

Better for what, though? Only your team knows the requirements for each specific project you are working on. What you're calling a homegrown framework really just means having some considered software architecture, which obviously we've been doing since long before frameworks became popular. What you actually need for your current project might be much simpler than any of the big name frameworks that have to cater to a broad audience with varying requirements. What you need might also be more specialised than the big name frameworks that naturally concentrate on common general requirements that many projects have. Or what you need might be a pretty good fit for a lot of other projects and using an established framework might be a good idea.

1

u/[deleted] Sep 23 '19

Sure you gotta evaluate all your options, and if homegrown is the way to go, it's the way to go. However for the majority of apps, it probably isn't.

I don't really understand why this keeps coming up every now and then.

2

u/Silhouette Sep 23 '19

For the majority of apps, if we're talking about typical browser-hosted front-ends for CRUD applications, you might well be right. But there are many others where it isn't necessarily the best choice.

You'd think it would be pretty obvious that in a field as diverse as software development there would be more than one way to do things, but this keeps coming up because there is a certain kind of person who will state strongly and with little if any qualification that frameworks are always the way to go. There are several examples already in this very discussion.

Then new and inexperienced developers will believe those claims, because they don't know any better and they make the typical mistake of trusting the person who shouts loudest.

And then later, those developers might end up working for me. A lot of the engagements we take on are to build those more demanding systems, and often for our work the off-the-shelf frameworks do have limited value and can become a serious liability down the line.

So then we have to spend a lot of time and effort undoing the damage and opening the closed mind again before that developer can work at the level we need and contribute value to the project.

I truly believe this is not a healthy culture for our industry. It tries to systematically eliminate creativity, and in doing so it produces developers who lack the skills and knowledge and experience to do any better, ultimately reducing both productivity and quality of results. It's dumbing down the whole industry, just like managers who think developers should be interchangeable commodities or hiring processes that are geared to buzzwords and brain teasers because they're all bad HR people can cope with.

3

u/volimsir Sep 23 '19

This is one of the reasons why I wrote this article.

I have junior developers in my company that don't know how a browser fetch works. Or that Redux is not a part of React. Or how to execute a query selector without jQuery.

I think there should be more emphasis on good fundamentals, and explaining how things work in vanilla, because it makes you understand the language, and deal with problems better.

2

u/Silhouette Sep 23 '19

I think there should be more emphasis on good fundamentals

I've found that this is true of almost anything worth doing in life. :-)

1

u/[deleted] Sep 23 '19

It’s a bit like saying that a team might need to write their own language for their business.

It’s possible and I’m sure it’s occasionally true, but the vast majority of software is solved on top of the previously solved problems. It’s why those layers exist.

2

u/Silhouette Sep 23 '19

It’s a bit like saying that a team might need to write their own language for their business.

Except it isn't, because building the equivalent basic infrastructure for a new project is potentially something you can do in the first morning of development, on top of standardised tools and languages, and using well-known libraries on a case-by-case basis as appropriate. The difference in effort and risk between what you're describing and what I'm describing is many orders of magnitude.

1

u/[deleted] Sep 23 '19

That’s where the contention is. To have a library that can reliably and speedily do what you need to do takes a lot of time and resources. Time and resources you seem to think aren’t necessary.

Building the underlying structure is an expensive and constant endeavour, one that is solved already in almost every case.

1

u/Silhouette Sep 23 '19

To have a library that can reliably and speedily do what you need to do takes a lot of time and resources.

That depends entirely on what you need to do, how good your in-house resources are, and how good any available external options are.

Am I going to reinvent the wheel if I need a reasonably efficient DOM update library for declarative rendering? No. Several people did that already and they work fine, while building it from scratch would be a lot of work for us.

Am I going to define my own software architecture for a complicated web app that is expected to be maintained over the long term? Probably. The cost to build what we need will be a tiny part of the overall development effort, it will be tailored for that specific application's requirements and environment, and it won't have all the limitations and risks that come with depending on an external framework for the skeleton of the system in this context.

Am I going to work the same way if I'm building a routine web front-end to a line of business application that will be delivered within a month and then not changed very much after that? Maybe, maybe not. In that context, an off-the-shelf framework might get the job done faster if the requirements are typical and unlikely to change fundamentally during the relatively short development process.

My point is that there is no universal rule for these things. Sometimes ready-made frameworks do save time. Sometimes it's more effective to build the structure in-house and use external libraries topically.