Earlier quoted context omitted.
Backend dev here. I tried to create a simple Angular app. I got into some kind of dependency hell on something simple. Going from Angular 7 to 8 broke some junk? Then trying to get Angular Bootstrap to work was hellish as well, especially when some kind of polyfills junk screwed up for IE. Ended up just linking to it directly to the jquery and bootstrap CDN... It's been a long time since I did any kind of major front…
Well, choosing the right tool for the job is part of being any kind of developer. If you could solve the problem with no framework/lib/state manager, why go that way? The fact that those tools exist doesn't mean you _have_ to use them.
Why is modern web development so complicated?
431–440 of 731 posts
Re: Why is modern web development so complicated?
#432Rise of the SPA is great. However, I think unless there is a good reason for having a SPA such as hybrid mobile app development, then there is no point of using SPA.
Normal server side web page rendering with latest modern version of jQueryish/Zapeto should be just fine for the non app type of web development.
Re: Why is modern web development so complicated?
#433A back end server with this configuration would have a handler layer for IO, business logic layer and data layer.
DI and IoC ensures that the IO layer doesn't know about the data layer as the logic layer takes it as a dependency. The IO layer consumes the logic layer and the logic layer doesn't care/know about that.
Front end is exactly like this. The data source is REST rather than a database. The UI layer is an event source and consumer. The logic layer notifies its consumers (the UI layer) that there has been a change. The rendering library doesn't matter, it's just a mechanism to represent the events it consumes.
The problem in front end is there has been no rational mechanism for DI in the libraries. React relied on the service locator pattern to deliver dependencies so to ensure quality decoupling you would need to have wrapped your components with a million functions.
``` withTheme(withUsers(withSomethingElse(withAnotherThing(Component)) ```
So rather than that, just use a single "service", redux, and forget about DI. Everything can do anything and all your logic is done inside that one thing.
Angular is no better. While they have a nice DI solution, it still relies on concrete implementations rather than abstractions. So your business logic must live within "angular services" and can not simply be "javascript" consumed by a rendering library.
Vue just missed the point entirely.
React context packaged this problem in an ergonomic box and, in my opinion, is a fantastic solution given the constraints. However at this point, the meta in front end programming is so irrational that it boggles my mind.
In the following example, you can see that I have an application which uses React as a renderer. React consumes a package from /platform. The package has no relationship to the presentational layer.
I could run the units in the package inside node or the browser console and it wouldn't care about its rendering library. The "PostStore" class exposes an API which consists of a getter and a stream. React consumes the stream, because it needs to be notified on changes.
https://stackblitz.com/edit/react-ts-biohay?file=gui%2Fapp.t...
Conversely, this loose coupling means that the view renderer is a small portion of the application. I could swap it out for another renderer. Preact, Svelte, whatever.
Front end is a mess.
Re: Why is modern web development so complicated?
#434It doesn't have to be complicated, if you get support from above. A few weeks ago I launched a new web site for a health care company. HTML, PHP, CSS, and MySQL. No frameworks. No javascript. No garbage. It replaced a site that was a mess of javascript libraries on top of frameworks on top of a half dozen jquery version and on and on and on. The company administrators, doctors, practitioners, etc... are so happy with…
Re: Why is modern web development so complicated?
#435Earlier quoted context omitted.
Easy if you don't have to have it pixel perfect for them. Just build it out with CSS Grid and the CSS variables, then look at the broken mess on IE and make it work. Who cares if things are not centered on IE11. It is not an HTML5 browser and is only there for legacy support - ActiveX and all that. Also add a banner at the top telling people they need to use their other browser for the page. What business are you in…
SME Finance Management for Europe (mostly D/A/CH), think of it as Xero/Freshbooks with very country specific features.
You can try the polyfill approach. This is generally not recommended as it wastes bandwidth. But since your customers have bandwidth you could go with polyfills. Or just stay stuck in the past with a niche of writing IE11 compatible stuff. That could be career limiting, IE11 is getting as irrelevant as 8.3 FAT filenames.
Re: Why is modern web development so complicated?
#436"Modern web development" tries to reinvent too many wheels.
I wish more developers/directors would try to approach this from the other direction: Making native OS apps as easily discoverable, installable, accessible, navigable, sharable, restorable, updatable and uninstallable, as websites:
• I want to be able to type "photo editor" and see Pixelmator on macOS, Paint.NET on Windows, Photoshop on both, and GIMP on Linux.
• When I choose an app it should open as fast as a website, loading incrementally, but remain available even after I'm offline (except for internet-dependent features) like other native apps.
• It should always launch the latest version, but should also allow me to "freeze" and locally archive a specific version.
• It should adopt the look, feel, and all the special features of the OS and device I'm currently using.
• I should be able to capture the UI state as a "link" and share it with other people, for example a specific page in the preferences window, or a particular workspace layout.
• It should remember my preferences across machines and OSes.
• After I have stopped using it for a while it should not take up any local storage on my machine.
We already have high-performant, energy-efficient UI toolkits and graphics and audio engines, we already have task switchers and various accessibility features, and we already have everything else that every web app is constantly trying to reinvent, each in its own half-baked way.
It's a constant shuffle of N steps forward, N+m steps back. "Oh look! A cool new technology for native apps! But wait, let's take a very roundabout detour to reimplement this in a crippled imitation so that browsers can host it too."
Re: Why is modern web development so complicated?
#437Earlier quoted context omitted.
jQuery isn't garbage as per se. It's a great library for directly querying & manipulating the DOM. Trying to make web applications with it is another story though. The lack of any state management is a nightmare, hence declarative frameworks/libraries such as React/Angular(JS)/Vue/Svelte etc. etc. came along.
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.
The reason is rooted in how browsers work.
In native software you can "just" render your data structures directly to the screen. In the browser, barring webgl, you can't render your data structures directly to the screen, instead, you're forced to interact with an imperative browser API to individually manage bespoke UI widgets that store their own state internally and can't understand nor access any of the data structures defined for your business logic. The only option left is to manually update the internal state of the browser UI widgets whenever you update the internal state of your application. Manually keeping the two states in snyc is a real pain, highly bug prone, and a maintenance nightmare. The front-end browser frameworks came along as a way to "auto-sync" the business logic state with the browser ui state.
Re: Why is modern web development so complicated?
#438Earlier quoted context omitted.
was just about to comment along these lines! i never understood those eschewing frameworks... in the above example a PHP framework like Laravel is in constant development by lots of people, with security updates and refinements pushed out on a regular basis. even if u are an uber-developer, in what situation is rolling your own ever the right choice? is your project that different from everyone else's?
Why don't you drive an 18 wheeler to work every day? They are used by millions of professional people every day who's job it is to drive! Why would you be different from all those people that you think you need to use a little car instead? The answer is obvious in both cases; You don't need it and it would be wasteful. If I don't have a huge database with constant read/write calls, If I don't have to try to manage mu…
In most cases you can buy a modestly sized vehicle from a manufacturer that still has a team of people ensuring the performance, utility, and safety of the vehicle.
Re: Why is modern web development so complicated?
#439Earlier quoted context omitted.
> At the point that they chose to use all this kit and write "beautiful ES6" So are you saying that most projects that use JS should avoid the use of ES6?
Well, either that or polyfill. Transpiling to JS may be a product of other motives (Typescript, Svelte, Elm etc.) While Ruby is pretty and all, I don't find that I'm enjoying the lie that is ES6, and don't even get me started on classes in JS, etc. Bottom line, JS isn't my favorite language, but I'm not dying reading/writing ES5, (nor does ES6 look lovely when I know that it's lying to me) and the advantages outweigh…
Something like htm [1] + ES6 modules is the best of both worlds IMO.
State management? Let React/Vue handle it [2]. No need for Redux/Vuex etc
Need to support IE11? Then yeah, I agree, go back to ES5.
[1] https://www.npmjs.com/package/htm#example [2] https://twitter.com/ryanflorence/status/905584958835638272
Re: Why is modern web development so complicated?
#440Earlier quoted context omitted.
This is fundamentally because our industry is built on opinions, not standards. You talk to one software engineer, and they'll say, "that's built in PHP, so it sucks; it should have been built with npm, obviously." Then you talk to another and they say, "I can't believe they built that with npm, the package management system is just terrible and the whole mess is bloated and there have been a ton of security issues.…
> "sure, that material might not be the most durable on the market, but unobtainium would have added $35 million to the project cost and ongoing maintenance costs would have gone up by another $5 million / year." > That right there is a comparison that developers can never, ever offer anyone that's writing the checks for a project. Sure they can. At Google there was an internal cheat sheet of "numbers every engineer…