Live data from Hacker News

Second-Guessing the Modern Web

macwright.org

171–180 of 467 posts

Re: Second-Guessing the Modern Web

#171

Earlier quoted context omitted.

That's what the C devs said about all the people learning Java. "We are raising a cohort of developers who knows nothing about memory management." Sure, there are things you do not know if all you know is React, but technological changes make it irrelevant in all but the most niche of cases.

Except that "niche cases" here means "everything you do with software but not in a web browser".

I meant to constrain my comment to the web development sphere. Niche cases mean some scenarios where bandwidth limitations prevent the use of React or something.

Although you can use React for mobile (Native) and desktop (Electron)

Re: Second-Guessing the Modern Web

#172
I've barely used Next.js, so take this with a grain of salt, but to me the whole "hybrid" approach where you statically-render-and-hydrate has always felt like one big heaping pile of hack. The amount of grotesque complexity that's required to achieve this "best of both worlds" solution, and the number of asterisks that have to be added to that title, have never sat right with me.

I'm a believer that you simply need to decide from the outset: "Is this a web app that people are going to dwell on? Are they going to stay here and use it or are they simply going to visit it?" And if yes, go all-in on treating it as a capital-a App whose "binary" consists of minified JavaScript, and if no, just stick with server-rendering. Most things fit neatly into one or the other. There's no need to shoot for the moon.

I do have to disagree with this part, though:

> The high performance parts aren’t React...The level of abstraction that React works on is too high

In my experience it's perfectly possible to write your complex, screaming-performance app in React or the like and spot-optimize it as needed. I've done that sort of thing myself. Now, something like Mapbox probably lives mostly in WebGL, which is not concerned with the DOM, so that portion isn't really relevant to React. And the question does get more complicated when it comes to shipping an embeddable widget. But at a base level, I think React and its abstractions are perfectly well-suited to high-performance apps.

Re: Second-Guessing the Modern Web

#173

Earlier quoted context omitted.

I mean, what did you think he was going to say? React is bad, we're dropping it?

"React is bad in your case, drop it." I know it's far out idea in tech, to flat out tell someone "you don't need this, you just save time and money and get a better result of you don't use what we made", but it shouldn't be. React is fine per se, the problem is throwing these "simple, magic" solutions onto everything , without even caring what mountains of code end up running as a result. The minimum for a Discourse…

PHP is literally the reason I first used Kubernetes in anger because the sheer impossibility of getting sane deployment configuration without dockerization meant we had to get something that could manage them for us.

Re: Second-Guessing the Modern Web

#174
post #47

I empathize with the author but client-side technologies like React have a pretty clear advantage that explains why they're popular: for the people that are tasked to make websites (i.e. us, HN readers), they're easier to work with and they save us time. It outweighs all the end-user-facing cons by a lot, because companies need us, and our salaries are expensive. It's true that they are largely more complex than O.G.…

It outweighs all the end-user-facing cons by a lot, because companies need us, and our salaries are expensive. As a user and developer myself, that's the sort of selfish attitude that really really angers your users. I sometimes wonder if the people claiming to hate client-side technologies or disable JS in their browsers have actually ever had to build a complex website to put food on their table. My bet is the answ…

zero need of JS

XHR was invented because without it, Microsoft couldn't make a web-based email client that behaved the way users expected an email client to behave. 20 years ago. I'm not sure you can reasonably claim this stuff is not also strongly driven by the expectations of users and and the desire to meet those expectations.

Re: Second-Guessing the Modern Web

#175
post #152

Earlier quoted context omitted.

You suggest React is at once both "easier to work with"; and "largely more complex" and "gatekeeping" (harder to learn?). Aren't those opposites?

Check out the sibling comments. Complex does not mean hard to use. My car is complex, but it's pretty easy to get a driver's license. Gatekeeping refers to making it seem like it's too hard to get into and therefore not worth trying for beginners/non-technical folk.

So by "gatekeeping", you mean that you think it just seems harder to get into, but actually isn't harder to get into?

What do you think makes it falsely seem harder to get into for beginners, when it isn't really?

Re: Second-Guessing the Modern Web

#176

I’m tempted to step back and evaluate this on another level. Our industry is very big, and any industry that gets that big will be able to house a lot of people just for the sake of it. If you think we have a large amount of fresh frontend people, understand they are hired almost with a one to one correspondence with fresh product/business people. Modern product development is essentially a polishing job on every com…

I think you're bordering on a contentious idea that I will take a step further. I would argue that frontend, nearly in its entirety, is effectively one giant bike-shed operation. And like you're alluding to, it's an operation that exists mostly because there is money to burn. At best, frontend exists to save backend engineers the trouble of dealing with the tedium of HTML/CSS.

As an example, the article brought up Craigslist; renowned for its brutalism. Craigslist would only be hindered by any frontend changes: arbitrary and confusing interface changes, (necessarily) slower load times, and increased complexity.

That said, I agree with the article that HTML form UX often requires more advance strategies like React and Vue. The decision requires discretion, of course.

Re: Second-Guessing the Modern Web

#177
post #87

The problem with not using a JS framework is that eventually, the investors/business person/design team/frontend enjoying devs wants this highly animated site with all sorts of little toggles, confirmation boxes, popup models, toasts, etc. It is far nicer doing that in React where you can just casually npm in some online component that does that rather than in vanilla JS or jQuery. React is basically a compromise bet…

> Developers like simple sites like Hacker News. Nobody else does. One word : Craigslist.

For being the behemoth it is, amazon.com has a relatively simple frontend. Most links are simple html that loads a new page. It's doing fairly well.

Re: Second-Guessing the Modern Web

#178
I strongly support this sentiment. I’ve recently come to the conclusion (after building a non-trivial react app from scratch) that the optimal use case is in a rails/django/go/whatever app that only uses react to handle front end state for the hairy components while the lion’s share is handled by the server.

Re: Second-Guessing the Modern Web

#179
People use React not because because it's shiny (guess what, it's not, React was first launched 2013 - six years ago, and it's more aged than jQuery's age when React was born), nor because they want everything to be an SPA (contrary to common HN belief), the use it because it gives a battle-tested, excellent solution for components and reactivity. That's really the only reason why React is prospering, and why other libraries are trying to get inspired from React and tries to copy it's API surface. (Preact, Crank.js, etc...)

For the pages to not use React, we really only need one thing: Built in reactivity to web components (custom elements). That's really the only reason why React is used. If you want to see static pages without JS, you could also need a method to define custom elements declaratively (in HTML).

That two things is the solution to this problem. Not saying that web developers just want shiny things and everything is bloated.

Re: Second-Guessing the Modern Web

#180

Earlier quoted context omitted.

A lot things can be easier if you do things the "wrong way". App development can be faster if you don't use Typescript, liberally use the "any" type, or just avoid. Most of recent javascript tech like React, Redux, Typescript, et all, came to reign in the multi-paradigm language that is Javascript so that larger organizations can actually make maintainable error free code from a language and ecosystem that is very ea…

> A lot things can be easier if you do things the "wrong way". > It depends on your setup and use cases whether or not something is overkill, but for any reasonably large app just doing some HTML and javascript is not going to be enough to keep things maintainable... I don't think you are responding to the point that the previous comment is making. The point is that there is a spectrum from let's say, traditional, to…

I did address that it depends on your requirements. But my point is that it is highly unlikely that any requirements would be better served by vanilla JS + html than say writing your code with ES Next or React, unless you truly have some sort of limited use one-off thing.

Tools like webpack, babel, and react are also orthogonal to whether or not you're doing an SPA. These new tools aren't just to make your app a SPA, but are meant to decouple the maintainability of your code from the implementation details. React itself isn't even a framework but a paradigm which just happens to have a specific implementation that requires their runtime. The most recent shift is to turn your components into pure functions, and this is less about the framework and more about decoupling your app rendering logic from the react implementation. There's no objective argument that writing vanilla JS is better than writing modern ES next code. These language improvements are done to improve the failings of the javascript language after all.

You can totally use React to purely statically render your website. This is what most SSR implementations do, and the only reason JS is still activated is most modern apps require interactivity.

If you start doing vanilla JS and HTML you're doing a direct implementation. That's almost always the wrong way just because of browser differences between operating systems, mobile vs desktop, and all the other features that aren't really bells and whistles but more and more necessary as technology serves a bigger role. Perhaps in 1990 it's fine that a website can be made for a specific user for a specific purpose.

Post reply on HN