7 ms·
I'm a little lost on the examples. There are reasons to use fetch and hooks, and the article seems to relegate them to being unnecessary 'trends' without doing
by duxup 6y ago
I'm a little lost on the examples.
There are reasons to use fetch and hooks, and the article seems to relegate them to being unnecessary 'trends' without doing what it suggests, actually evaluating what value they might have...
In React you can use hooks with a class heavy application and still be just fine / get the benefits of hooks in a given component(s).
If you want to use fetch, that also is hardly an ordeal to do / should not be a big cognitive load for anyone.
I get it, resume driven development bad, we get it, we hear it in opinion pieces all the time. Also you should think about it before rewriting an entire application. Yup, that makes sense.
But here we have examples of small changes that are pretty light weight... and no effort is made to do exactly what it suggests, evaluate those choices.
- runawaybottle 6y agoBut do we get it? If we get it, why is frontend churn so prevalent? I don’t think we get it.
- duxup 6y agoGet what?
- runawaybottle 6y agoResume driven development bad.
- christophilus 6y agoIs front end churn really so prevalent? I hear this opinion all the time, but React is 7 years old. I've been using it for around 5 years, I think. Redux is 5 years old. How old does the most popular web framework need to be before we consider it to be low churn? [Edit: Also, anecdote: before JS, I was mostly a C# developer, and the churn there was at least as bad, maybe worse in my personal experience. Over 15 years of my career, I had to learn ASP, then ASP.NET, and in the Windows app world, we went from WinForms to XAML, then .NET Core came out, and things shifted again... See Rails' history for more examples of churn. It's not like every other platform is a paragon of stability. Clojure is a bulwark of stability compared to just about anything else, but it's hardly fair to hold the front-end community up against that gold standard...]
- quxbar 6y agoJS has always been relevant as an ecosystem because it incorporates new ideas. I liked jQuery more than what came before it, and I like React more than jQuery. They make the task of translating an idea into a work app much easier for me, and other programmers I work with also benefit from more readable code. I wouldn't re-write an existing app to use fetch or hooks, but now that I've taken the time to learn, I'm happy I did. The vast majority of the mental work was done by other people, and I get to reap the benefits. The alternative to this is stagnation, and relegation to legacy systems... I guess the author wishes they could work in COBOL?
- deleted 6y ago[deleted]
- runawaybottle 6y agoI’m not sure if you realize your own paradox. Is churn really so prevalent? You then point out how prevalent it is in the .NET community. Yeah it’s prevalent, and if we resemble other shitty ecosystems then we need to introspect.
- christophilus 6y agoI do realize it. Maybe I should have added: churn as compared to what? JS doesn’t exist in a vacuum. Most language ecosystems experience churn. I explicitly mentioned we shouldn’t hold everyone to the gold standard of stability that is Clojure. But... maybe we should? I’m not entirely sure that churn is a binary good or bad. When you think, “Hm I have a more elegant solution to this common problem.” And then offer it to the world, you’ll be shot down with “churn” comments. Churn is way we experience experimentation and the slow progress towards a better solution. I, for one, am glad I no longer have to program COBOL. Anyway, there’s probably a happy medium. Even Clojure has had some front-end churn. Om is no longer the hotness. Reframe seems to have won. Clojure itself isn’t that old.
- deleted 6y ago[deleted]
- hombre_fatal 6y agoAll client-side development churns. Because it's hard, it runs on user devices in the field. And client development is not a solved problem. It's more a moving target of constant research because client devices aren't static either. It wasn't long ago that touch screens didn't even exist. The whole Apple client-dev ecosystem is still in the process of changing to Swift, and Apple is trying to develop SwiftUI into a compelling layer alongside/atop {App,UI}Kit. It's not just a web/JS challenge. Client dev is always changing.
- runawaybottle 6y agoI don’t think so. Frontend is knee deep in the process of creating cargo cult devs en masse, and I’m depressed by all of this.
- protonimitate 6y agoYeah, I'm becoming increasingly frustrated by the flood of "anti-hype-driven-development" blog posts being praised. The entire article could be summed up with: > Is it solving your problem, and what is the cost? And it cuts both ways. Change for the sake of change is bad. But so is stagnation for the sake of stagnation. Picking the best tool for the job and continuous improvement are the closest thing to universal advise in front-end land. The "everything new is bad" rhetoric is getting exhausting.
- hn_check 6y agoIn the JavaScript/web framework space, it is absolutely remarkable how much running to stand still occurs. How people making absolutely trivial apps have megabytes of frameworks, having injected many magnitudes extra complexity, for illusions. It's bizarre. It's like web developers have some major inferiority complex so there's this desperate need to make responding to a button and changing an input into some monstrosity of hilarious over-engineering, the result being some colossal piece of shit. There have been incredible advances in software engineering in general, but the web space is really a counter-example -- I really don't feel there has been beneficial movement in a decade or more. Which is why frameworks and approaches are all so temporal -- the lack of legitimacy makes it so easy to unseat for the next silver bullet for hilariously simple apps.
- brailsafe 6y agoI think the idea is to disassociate newness from improvement and only associate it with improvement when it's actually improvement. It's not wise to pick a different tool for every job, nor is it wise to only stick to one tool all the time. The fatigue imo comes from producing approximately the same output in ever more complex but not necessarily more interesting or better ways. If it does arguably provide a marked improvement, then definitely experiment and see how it might help
- oefrha 6y agoKinda funny the author refuses to evaluate a five-year-old (?) standard (fetch), labeling it a trend/hype. And what are they holding onto? A third party library they “used before”; even cited the number of GitHub stars — i.e. aggregate trendiness — to justify the choice. Pretty sure at some point someone dismissed it as a trend and held onto their XHR, and they would have had a better point.
- nailer 6y ago> Kinda funny the author refuses to evaluate a five-year-old (?) standard (fetch), labeling it a trend/hype. And what are they holding onto? Fetch is a very poor standard if you compare it to high-level HTTP clients that have been around since 2010-ish. However it's author states that it wasn't intended as a general purpose HTTP library but rather a low level tool that-level tools can make use of. So yes: you probably don't want to use fetch directly, making Headers objects using obscure methods, manually encoding query strings, and telling your HTTP client that you'd like to treat application/json as JSON and decode it. Use a library.
- hajile 6y agoLots of us remember the days of XmlHTTPRequest. Fetch is downright modern in comparison. You should understand how your browser actually works and in this case, it's actually gotten a lot easier.
- nailer 6y agoI don't think you quite understood the point: XHR was not fetches predecessor, because few people were using XHR directly when fetch was being designed and released. superagent was released in 2011, axios was released in 2014 (jQuery also had an HTTP client that was nice but I don't know much about it). Both of these libraries were wildly popular and do more out of the box than fetch (which came later) does. Standards should pave cowpaths. Fetch was designed in a bubble.
- duxup 6y ago
- julianeon 6y agoI’m personally becoming frustrated by the “we draw the line at React hooks” idea - which I feel like I’m seeing repeated. Like that’s the point at which learning new concepts crosses over from useful exercise to useless extravagance. So let me say something which is true, but totally against the spirit of this article: there should be 10x as many (!) tutorials about how to implement everything in React using hooks. My reasoning is pretty simple. For a new learner, unless you have a compelling counter example needing classes, you should use hooks. That’s what you should start off learning and that should be your go-to. But if you click away from this comment, right now, go to Google, and search for tutorials, despite this “best practice” advice, you’ll see an unholy mess of tutorials citing classes, with a few using hooks as though it’s some kind of new fangled, “out there” tech. I’m talking in the top 10 search results on Google’s front page. In 2020, long after the React team has introduced and explained them. Look, it’s simple. Aside from their other advantages, hooks make it easier to learn React, with less boilerplate. As a result, it would be better if beginner tutorials were updated to use them. Most have not been. But I see this complaint regularly, where hooks are trotted out as some kind of example of silly React maximalism. If you learned React then hooks are only going to take up like 2% of the total time budget you’ve already dedicated to learning the framework. It’s not hard, and it’s nothing like learning, say, Haskell. Using hooks to make cheap shots against overcomplicated JS frameworks is unfair, when they’re not overcomplicated and have a perfectly valid reason to exist.
- duxup 6y agoYeah hooks have such a low barrier to entry as far as ... just make a new component with hooks. There is less code, it's easy to do, anyone who has seen a class component doesn't need much of an introduction to understand it. I've got class heavy applications that will stay class heavy, but almost all new components are hooks and they're quick to write, evaluate what is going on, and work with.
- crooked-v 6y agoFor me, the key thing about hooks is that they both make it easier to write everything idemopotently and mostly force you to write everything idemopotently, both of which are great for future code maintenance purposes.
- munchbunny 6y agoI've settled on one maxim when it comes to evaluating new technologies: there is no free lunch. In real projects there is always fundamental complexity. Where will that fundamental complexity go? If a new framework/library/paradigm comes in looking really hyped up and cool, my automatic question is "well what's the catch?" There always is a real caveat in there somewhere. Usually the new shiny thing solves one class of problems at the cost of making a different class of problems harder to solve. The important question isn't what the shiny thing makes easier, because everybody and their grandmother is telling you what that is. The important question is what that shiny thing makes harder. React, for example, is awkward for continuous, time-stepped state (games) because what you see is an interpolation of many objects transitioning between many states. It's not that the abstraction can't work, it's that it's a clumsy one to apply. Thankfully the vast majority of web apps don't have this issue, so it's usually fine, until you try to make something real-time. Same story with NoSQL databases. The canonical issue there is that joins are much more expensive. So how much do you need those joins? Turns out some non-trivial number of scenarios are fine without joins, but for CRUD apps, turns out a substantial number of things are easier with joins.
- duxup 6y agoI think you, unlike the writer, would seem to wish to put the time into evaluating. The article though takes two pretty low cost / easy to use bits of tech (fetch, hooks) ... and relegates them to being "trends" without really evaluating them.