Live data from Hacker News

You probably don't need a JavaScript framework

slack-files.com

171–180 of 356 posts

Re: You probably don't need a JavaScript framework

#171
post #112

To begin, React isn't a framework. It’s a tool. Would you compare a table saw to a workshop? That doesn’t make sense and neither does comparing React to a framework—especially if you’re saying you don’t need one. Furthermore, using a virtual DOM is not the purpose of React. Virtual DOM is merely a part of how React works. People don't buy cars to get an engine. They buy cars to get around places. People don't use Rea…

> To begin, React isn't a framework. The way I look at it: - If you use a library that augments your style of work but doesn't change it then it's a library. Maybe a tool. - If you use a library that replaces or changes your style of work then it is a framework. React is a framework in my opinion. It can be used as a library but it's almost never used that way; most people incorporate JSX and much of the virtual dom…

> React is a framework in my opinion. It can be used as a library but it's almost never used that way; most people incorporate JSX and much of the virtual dom into their workflow.

Yes it’s pedantic and arguments could be made either way. However my experience is that people comparing frameworks are often looking for something comprehensive—that solves (or makes provision to solve) a majority of the challenges they will face with a particular stack, so they can focus their energy instead on the problem domain.

React is far from this. It’s an important but relatively incomplete piece of the puzzle. React apps use a lot of other libraries to provide the missing pieces. A framework, to me, would be a system that ties these pieces together to solve for a large class of apps.

> While correct I cannot disagree with you enough. If you write clean, as-simple-as-possible code with clear separations of concerns it's dead easy to maintain and not necessarily "full of bugs". It really just boils down to how well a developer can architect an application to determine if their own framework is going to be a huge bottle neck / issue or a breeze. I've been through both :)

In my experience the number of developers that can do this successfully is relatively small. It requires a lot of experience and skill. Even if there were a large number, why reinvent the wheel for each project?

> I'm not a fan of this sentiment. If it makes the most sense (and it doesn't always) I try to avoid using frameworks but I would hardly call myself a cowboy (though perhaps I will going forward, ha).

Yes—be skeptical but also practical. Not every problem needs a framework but would your problem benefit? If yes, why not? Especially if you’re adopting something proven.

This is especially true if you’re writing something new and therefore still learning about the domain. I've seen a number of cases where a team decides against a framework, ends up with a mess on their hands, and later switches to one of the frameworks they were originally considering (at great cost).

One case in which it may make sense to write your own framework for a large application is when the app is relatively stable (therefore you can leverage your experience building it) and existing frameworks don’t meet your needs.

> The DOM API, as this article shows, provides quite a bit of functionality that many popular frameworks / libraries provide and as long as you don't need to target old browsers you're fine here.

This is true, although sometimes impractical in enterprise software. When jQuery came out it was a godsend in it’s ability to erase cross browser compatibility concerns. As time went this became less of a problem and now I no longer use jQuery. You won’t find me arguing to stick with something that used to make you more productive where better alternatives are now available or ready.

> Yes, angular and react do a lot for you but you can still write effective web applications without them with minimal "reinventing of the wheel". Just because someone provides a way to do X in a framework doesn't mean it's not easy to still do X without a framework. Many times the bulk of the framework's capabilities are supporting its own, specialized workflow that isn't always necessary.

I can say to sum up that this totally depends on who is working and what they are building. There is a ton of complexity that React and other “frameworks” abstract away for me. The core concepts powering these tools may not be that hard and perhaps more of us could take on the task, but the devil is in the details. Usually these libraries start out simple, but in the end it’s the edge cases and quirks that make them internally complex.

Re: You probably don't need a JavaScript framework

#172
post #86

Earlier quoted context omitted.

> Complexity requires structure in order to be maintainable. Structure is the job of the lead programmer(s), not some third party framework developer. And it should suit the specific job. It's as if we forgotten that programs have to be designed with an overall architecture based on our business, and instead just download off the shelve scaffoldings and try to adapt our business logic around their design. You know th…

>Complexity requires structure in order to be maintainable. A competent lead programmer will choose a structure that adheres to common best practices and is maintained by a community. Also known as a framework. >If you don't understand then you are either writing huge amounts of documentation and test code for your custom solution, or you are acknowledging that your app will be unmaintainable once you leave your posi…

>and has a community of people working to make those components even better for YOUR USE CASE.

How did the latter point derive from the former?

Frameworks come with prepackaged components and it's usually their way or the highway.

A framework might very well have a "community of people working to make those components even better" (period), but surely not "a community of people working to make those components even better for [MY] USE CASE".

If anything, a component's community try to make them as generic and all-encompassing as possible.

Contrast with libs, where I can cherry pick and use the one closest to my exact use cases.

>I guess I won't be hiring you then.

People use those kind of "arguments" a lot, as if they prove anything.

Depending on what those who say it are arguing against, it could both be a wise decision or the sign of an totally inept boss.

There are people who don't like frameworks that can code circles around people who do (and vice versa). If you don't want to hire the former, it's totally fine. Telling strangers who haven't applied to you, and have no intention to do so (and might be making hiring decisions themselves, elsewhere) that you won't hire them shows you in bad light -- trying to beat them into line not with arguments but with "boss" power.

Re: You probably don't need a JavaScript framework

#173
post #92
post #77

Earlier quoted context omitted.

The main contention of the article is that this "simplicity" is illusory. You end up writing just as much code, but now you've added a complex dependency you don't really understand but have to make your customers download, and ultimately have to test against

That seems incredibly anecdotal. Perhaps if you don't understand the framework you are using. Ember (for example), takes care of huge swathes of complexity for you. I can't imagine trying to build a: * client side router * data transportation/cache layer * view layer * model layer * build pipeline ... and more, in less code that just `npm install -g ember-cli` `ember new my-app` And then having a common app structure…

What? Seriously?

If you can't imagine trying to build these things, why on earth should you be trusted to use these things built by others?

All of your comments in this thread are so unnecessarily abrasive. And you just continue to give off an unfounded and indefensible air of smug superiority, when what you're really falling back on is ... the ability to run a command that puts you in a padded room so you don't hurt yourself?

Re: You probably don't need a JavaScript framework

#175
React is popular because it re-frames the meat and potatoes of frontend dev as a simple input -> output problem. VDOM merely helps make this approach performant at scale - it has little to do with why people actually use React.

Abusing MutationObserver to get "easy" 2-way data binding is precisely the sort of antipattern that React & Friends would have discouraged.

Re: You probably don't need a JavaScript framework

#176
post #112

To begin, React isn't a framework. It’s a tool. Would you compare a table saw to a workshop? That doesn’t make sense and neither does comparing React to a framework—especially if you’re saying you don’t need one. Furthermore, using a virtual DOM is not the purpose of React. Virtual DOM is merely a part of how React works. People don't buy cars to get an engine. They buy cars to get around places. People don't use Rea…

But the author has already tried to cover that aspect:

> I understand that React is only the view-layer, but in reality many of you are using things like Redux with it - along with other plugins. The result of that is a pretty heavy application.

Re: You probably don't need a JavaScript framework

#177
post #92

Earlier quoted context omitted.

That seems incredibly anecdotal. Perhaps if you don't understand the framework you are using. Ember (for example), takes care of huge swathes of complexity for you. I can't imagine trying to build a: * client side router * data transportation/cache layer * view layer * model layer * build pipeline ... and more, in less code that just `npm install -g ember-cli` `ember new my-app` And then having a common app structure…

What? Seriously? If you can't imagine trying to build these things, why on earth should you be trusted to use these things built by others? All of your comments in this thread are so unnecessarily abrasive. And you just continue to give off an unfounded and indefensible air of smug superiority, when what you're really falling back on is ... the ability to run a command that puts you in a padded room so you don't hurt…

> I can't imagine trying to build a ... and more, in less code that just...

Re: You probably don't need a JavaScript framework

#178
I really wish I didn't need a javascript framework, but I find this essay unpersuasive. He doens't seem to deal with the same kinds of problems I do. But I like that he's making the argument, and trying to pull out the parts where the web API has gotten a lot better. It's approaching maybe. I really do wish.

If we're lucky, maybe we can come up with something lighter weight (conceptually, and in terms of build tools needed, as much as in byte size) that is closer to the built-in browser API. I definitely don't feel like I can do what I need in a sane way with nothing but the browser API though.

Re: You probably don't need a JavaScript framework

#179

Earlier quoted context omitted.

How does a LAMP/RAILS app share server side rendering code with the client? It doesn't, because I don't need/want it to. Any data that needs to be passed to the client is rendered as JSON. Client-side get committed to the database via AJAX (to my buzzword-o-rific REST api), or with good-ol' POST. How does a LAMP/RAILS app share data models between the server and client? Again, not needed. How does a LAMP/RAILS app pr…

(gjolund: I can't reply to you directly, but consider this my reply) Because they're simple? They're relatively standard? They're compact? Because I don't have to learn a new god-damned framework for every single new assignment? When did software development become a paint-by-numbers exercise? There is a difference between spaghetti-code and engineering. Why do you want to write all that extra code instead of just pi…

It's a lot easier to learn React than what all of you think. It's especially easier to learn these frameworks when you tried to solve the problem without them and experienced the pain of not having them.

Re: You probably don't need a JavaScript framework

#180
post #91

One thing many people underestimate is how easy it is to run into XSS, XSRF, XSSI when not using a framework, in particular XSS when using native DOM APIs ("location.href = ..." - pwned. "e.innerHTML = ..." - pwned. "a.href = ..." - pwned. "*.src = ..." - pwned.). You might not need a framework, but you'll need a structured approach to avoid those problems, and frameworks can help a lot with security.

None of those are "pwned" if you know what you're doing. Idiot proofing is a real feature I grant you but it's not something you can blame the native DOM APIs for.

Anyone who knows what they're doing is one dumb moment away from not knowing what they're doing. I suspect I know no programmers that don't average at least a dumb moment per day. Your code reviewer is one dumb moment away from not catching it in your code review - which may be as simple as skimming a little too fast because the diff was a little too big. tl;dr: This:

> None of those are "pwned" if you know what you're doing.

... can be rephrased as "All of these are still 'pwned' on a daily basis."

Post reply on HN