Live data from Hacker News

Why is modern web development so complicated?

vrk.dev

511–520 of 731 posts

Re: Why is modern web development so complicated?

#511
post #426
post #295

Earlier quoted context omitted.

It's definitely not about the environment. Yes, there are browser inconsistencies, but for the most part, this is not a major issue today. The problem of js apps is handling asynchronicity, having to fetch data from the server and managing UI state and in the case of an SPA, having to take care of routing, permissions, timeouts, errors etc. When you sum it all up, you end up with a front-end that mostly needs to repl…

Well, the environment isn't the only factor, but it's the biggest one. You have to take care of routing, permissions, timeouts, errors etc on the server as well. Data being "an sql query away" on the server is similar to being "an AJAX call away" on the client. If you have a UI, you're going to have to manage UI state somewhere. Even if you have no client-side code, you've marshal that state into strings to send to t…

Your first paragraph is exactly my point. Because in an SPA, you have to handle it in both places, not only on the server. That makes it twice as hard as an old fashioned server-side mvc page.

> Data being "an sql query away" on the server is similar to being "an AJAX call away" on the client.

This is a bit disingenuous, since sql calls in most back end languages are synchronous. Also an ajax call needs to update the UI to tell the user something is happening. This might mean disabling controls, showing spinners etc. All of this goes away if you only use server-side rendering since form requests are natively handled by the browser.

> It's certainly not the case that asynchronicity makes you write shit code.

But it expands the number of cases you have to deal in the UI, to show all the loading states, error states etc.

Re: Why is modern web development so complicated?

#512

I think there should be a new razor, we can call it the Apple razor because Apple is the most common case. Basically, when tempted to ascribe the decisions of a successful entity to stupidity, consider that you may not be considering all the facts and facets. Yes, web development is complicated. Yes, that complexity is at times completely unwarranted. But , that does not mean that the originators of this complexity w…

Does facebook use react in its main, user-facing site? Does twitter ?

Yeah, totally. You can open React Devtools on Facebook and inspect it yourself. Twitter uses React for mobile and judging by their HTML, they might be server side rendering React for their desktop site too, since there's the hallmarks of React (react-root) and CSS in JS.

Re: Why is modern web development so complicated?

#513
post #400

Earlier quoted context omitted.

funny, that is the pattern I use, I don't consider it kiddy... it's just efficiant and easy to drop in. le sigh

I mean, if all you're doing is showing and hiding a mobile menu, you can do that in a really expanded form in like 5 lines of vanilla JS, and not have your user download 90 KB* of crap. *And you BETTER be using the minified version for production.

90 KB is probably bad for a marketing page, but it’s nothing for a B2B or internal use app, particularly when the second use is just the “you already have it” HTTP header response.

Good or bad depending on context.

Re: Why is modern web development so complicated?

#514
post #511
post #426

Earlier quoted context omitted.

Well, the environment isn't the only factor, but it's the biggest one. You have to take care of routing, permissions, timeouts, errors etc on the server as well. Data being "an sql query away" on the server is similar to being "an AJAX call away" on the client. If you have a UI, you're going to have to manage UI state somewhere. Even if you have no client-side code, you've marshal that state into strings to send to t…

Your first paragraph is exactly my point. Because in an SPA, you have to handle it in both places, not only on the server. That makes it twice as hard as an old fashioned server-side mvc page. > Data being "an sql query away" on the server is similar to being "an AJAX call away" on the client. This is a bit disingenuous, since sql calls in most back end languages are synchronous. Also an ajax call needs to update the…

Except no one is going to want to wait for a page refresh just to update a bit of data.

Re: Why is modern web development so complicated?

#515
post #362
post #59

Earlier quoted context omitted.

Did you consider that the next developer might well come along and post a similar comment: > It replaced a site that was pretty much a home-grown PHP framework written by a single developer. Random mixed logic in templates, hard to update CSS and a poorly designed 'not-an-ORM' ORM. Not to say that your rewrite is like that, but one man's garbage is another man's treasure.

...ORM use better code, I’ve actually found the opposite to be true.

I would tend to agree. Not a fan of database abuse / contempt. Turn on the SQL trace in Hibernate and weep. So much code wanking to be “performant”, which just waits for horrible database usage to grind along.

Re: Why is modern web development so complicated?

#516
post #360

Earlier quoted context omitted.

It's silly to do a round trip to the server just to change some local UI state, right?

Not really, this kind of thinking is exactly what led to the client-side JS framework mess. Round trips are just fine. Browsers are smart, servers are fast, and HTML compresses well. The site you're reading right now (HN) requires a reload. Stackoverflow requires a reload. Neither are slow to use. If your page is really that complicated, then I suggest Vue or Preact which are efficient and designed to progressively e…

Compression over HTTPS can be problematic, as it makes the key easier to crack.

I would like to trade out AngularJS for Vue someday, though.

Re: Why is modern web development so complicated?

#517

Earlier quoted context omitted.

And here's the trick to not building shit software: don't build shit software. It's a crude way to put it, but the reality is that you can build bad websites in any framework (including old PHP stuff and new JavaScript hype). You can also build good websites in any framework. It depends way more on the organisation or team developing it than on the libraries you use.

The trouble is that "don't build shit software" isn't actionable advice on how to avoid building shit software. For someone seeking to be a more skillful web software engineer, there's no information there.

I think that's the point. If you're looking for actionable advice in terms of "hammers are better than screwdrivers" you aren't going to find it. You'll find people purporting to give that advice. Look elsewhere, like "best practices for hammers" or "when to use a hammer instead of a screwdriver" or better yet "best practices for working as a team."

Re: Why is modern web development so complicated?

#518
post #416

Earlier quoted context omitted.

> Webcomponents once Chrome 77 drops and Firefox matches parity will finally be production worthy, and they're actually quite easy to build. What's changing in Chrome 77? A caniuse search for "web components" does not turn up anything that's not old news.

Form registration for webcomponents is coming. Personally when trying to create a component system it's been the number one blocker I've had. Your work arounds were not great - either you'd have to mirror an input in the lightdom (not good if you're using a library that strictly enforces a vdom), or you have to use a forked form component (not good as few people will know to use it and will wonder why the x-input isn…

Can you link me to a page describing this new functionality in action?

Re: Why is modern web development so complicated?

#519
post #501
post #464

Earlier quoted context omitted.

Five years ago, I decided I was never going to touch PHP ever again. I have been much happier professionally since that day.

I don’t know. I think I’d rather touch Symfony than Rails at the moment. And both probably beat out Node.js

Django multi-page app for me, with Postgres

Re: Why is modern web development so complicated?

#520
post #262

Earlier quoted context omitted.

The lack of any state management is a nightmare What makes the lack of state management a nightmare in the javascript world, but a complete non-issue when doing .NET or Qt apps? As someone who started with desktop apps and then moved into web dev, I never really understood why Javascript developers wanted a library to help them manage state.

All the state management stuff seems to be tied up in (=synonymous with) attempts to purify JS frameworks and codebases, as in "purely functional". It's... kinda silly and far removed from either the problem at hand, or the strengths of Javascript (such as they are) much of the time. Meanwhile objects representing various parts of the view, and plenty of models that don't look much like "modern" JS state management,…

The main benefit of purely functional systems is function composition. The ability to build entire programs through the composition of function primitives. Composition without dependencies.

The problem with javascript is that this concept is entirely lost on react developers. Due to the untyped nature of javascript and it's close linkage with html. HTML is made up of dependent components and this essentially puts dependency injection into javascript leading to JAVA like issues that the functional paradigm was suppose to solve.

Post reply on HN