DEV Community

Rethinking the Modern Web

Oxford Harrison on February 12, 2023

Frontend has an engineering problem! It is one field that has forged about the most enviable tooling ecosystem by roughly every measure - from gro...
Collapse
 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ • Edited

This. So much this.

I've seen a huge decline in knowledge of 'the basics' over the years. I've watched candidates pale with utter panic when I ask them to implement a simple app on a live coding interview - and stop them when they start importing their favourite framework, reminding them that I asked them to build it using plain JavaScript.

The number of 'modern' websites on which basic, expected web page functionality does not work is insane. Probably largely because they've been created by devs who have no idea about how a basic webpage works, and what those pages are already capable of. The problem gets worse when these devs then become senior and evangelise junior devs... the issue just gets compounded. We end up with teams 'driving a car with zero knowledge of how the engine works, or having any care about how it performs'.

The fact that there is a dwindling pool of people who actually understand there is a problem, coupled with the fact that these are the very people with the understanding and knowledge to come up with viable ways forward... makes me quite pessimistic for the future of web development. That's why it's great to read stuff like this... it gives me hope.

I'll definitely be checking out your ideas on GitHub.

Collapse
 
htho profile image
Hauke T.

For this reason I filter Stack overflow. I don't want to read or answer questions about simple Tasks wrapped in Vue, Angular or React Boiler-Plate because the people are not able to split the problem from the framework.

Why this Vue based answer?
stackoverflow.com/a/61725139/1635906

Collapse
 
oxharris profile image
Oxford Harrison

Resonates very much with me. Thanks for sharing.

Collapse
 
peerreynders profile image
peerreynders • Edited

One issue that "web native" continues to fail to address is the other One App for the Price of Two problem (i.e. not the re-hydration one).

Ultimately the Gen 0 web was constrained by this as the chosen server side implementation language was never supported on the browser.

So whenever there was some beneficial client side interactivity, it needed to be implemented with JavaScript and that JavaScript code became the second application (the server side application being the first) of the whole "web app system".

Remix and SolidStart solve this problem by adopting JavaScript as the common language for both the server and the client (no need to wait for WASM-based tooling to mature). Now only one application needs to be maintained.

Furthermore even today most of the HTML on the web isn't "created without tools" but instead dynamically generated by PHP engines (which have their roots way back in 1995).

Yet somehow in the past 28 years no "web standard" platform (server and browser) and language agnostic, performant approach to HTML templating has emerged. Even design-system.service.gov.uk relies on a JS-based tool for HTML templating: Mozilla's Nunjucks.

So it shouldn't be too surprising that JSX has become the predominant HTML templating abstraction. While many associate JSX directly with React it is actually an independent DSL that frameworks can use to inform their HTML/DOM generation process. Love it or hate it, this may lead JSX to have a wider and more long term impact than web components.

Collapse
 
nielsabildgaard profile image
Niels Abildgaard

I think Eleventy's introduction of the .webc format might be interesting here. It's an approach to templating that aims to lean into web component and native browser design. I could see it becoming more standardized as a native templating language in the future: 11ty.dev/docs/languages/webc/

But you know... the future is hard to predict :-)

Collapse
 
peerreynders profile image
peerreynders • Edited

The issue with web components is that their fundamental design is entirely rooted in the client side rendering era.

Effective server side HTML templating essentially boils down to efficient string concatenation. Client side templating on the other hand is about creating a DOM tree which is an entirely different ballgame.

Debunking Server Rendering as the Silver Bullet.

With Gen 2 SSR you have already lost the TTI game if you need to spin up something like jsdom for server side rendering.

Similarly WCs were never designed to accommodate efficient server side renderingโ€”even though they can be designed in a certain way to be server-friendly but that tends to get into the "one component for the price of two" territory, something most people aren't prepared to get into.

Thread Thread
 
nielsabildgaard profile image
Niels Abildgaard

I agree that web compenents can be improved upon. I don't think there's any reason to believe that the current state of the standard will be static for all future. So the question becomes whether the limitations are fundamental or can be overcome in time.

I think we have a fundamental disagreement of where the web is or should be headed in the future. I am of the belief that we collectively gave server-side rendering a good shot, but it turns out to be inefficient in all cases and close to impossible to scale efficiently. Static sites and pushing some work to the clients solves these problems - even as the pendulum swung too far. SPAs are also a terrible idea.

I bring up .webc because it is a format I believe could be supported natively in the browser to allow importing and using web components with no Javascript required.

It is true that .webc points in the direction of building a DOM tree rather than concatensting strings. I strongly disagree with you on the point that concatenating strings is a better way to go.

Browsers already parse HTML immediately to DOM trees and act on those. Going back to string concatenation after the structure reaches the browser is in fact less optimal.

So if you want native templating executed by the browser, something that leans into the tree structure is more efficient.

.webc, to me, looks like a format that could theoretically be used both in frontend and backend, lending itself to the powerful semantics and abstractions web developers are already used to today. Standardization and adoption will decide its fate.

Thread Thread
 
peerreynders profile image
peerreynders • Edited

I am of the belief that we collectively gave server-side rendering a good shot, but it turns out to be inefficient in all cases and close to impossible to scale efficiently.

That may be a fair assessment of the Gen 0 web but Gen 3 is shifting towards "what can be done on the server will be done on the server (or edge) while what has to be done on the client stays on the client".

Ebay has successfully applied this approach with marko at least since 2014 while the rest of the world was drooling over SPAs and React.

I strongly disagree with you on the point that concatenating strings is a better way to go.
Going back to string concatenation after the structure reaches the browser is in fact less optimal.

I was talking about templating as string concatenation on the server because the server has to produce HTML. Templating on the browser has to produce DOM as event handlers have to be bound (while event handlers are pointless on the server). A unified approach to templating would have gone a long way towards eliminating the "One App for the Price of Two" problem.

I bring up .webc because it is a format I believe could be supported natively in the browser to allow importing and using web components with no Javascript required.

Hot take: client side runtime components are an anti-pattern on the web.

Browsers efficiently deal with page scoped HTML and CSS and don't benefit from components at runtime.

It's understandable that design-time components are at times a useful approach though in some cases the component scope is still too coarse-grained for optimal design and architecture.

The reusability argument keeps coming up with components but it's just a different flavour of the reusability kool-aid that came with (class-based) Object-Oriented Programming. Nothing has mitigated the Rule of Three: reusability takes additional effort, sometimes a lot, it never "just happens".

And typically something reusable will need to be flexible to be reusable; this tends to lead to the inclusion of capabilities that aren't always used, i.e. it leads to bloat.

A lean web abhors bloat. That's why I don't think bundlers are going anywhere; their treeshaking is essential for stripping out code that supports unused capabilities.

Thread Thread
 
nielsabildgaard profile image
Niels Abildgaard

Browsers efficiently deal with page scoped HTML and CSS and don't benefit from components at runtime.

I'd add: "...for now".

Given the right semantics and format (and e.g. not requiring Javascript code to register web components) would enable the browser to leverage more significant caching strategies that are very similar to what is currently done for HTML and CSS.

See for example the chat in this thread: dev.to/nielsabildgaard/comment/24plb

Collapse
 
oxharris profile image
Oxford Harrison

Lol. I enjoyed this! And I'm happy to cover exactly this in a follow up post.

Collapse
 
christoslitras profile image
Christos Litras

Whenever I read such articles, I'm thinking that people tend to easily forget why libraries like React/Vue/Svelte exist in the first place. People seem to be forgetting, or maybe lucky enough to never came across some jQuery spaghetti nightmare apps or the PHP/ASP templating and concatenating of the past.

And what is proposed, vanilla JS, really? Start and use getElementById or querySelector and then write a bunch of lines just to make a single variables' value to be reactive and apply that to the DOM using native Proxies, well thanks but no thanks for me.

Don't reinvent the wheel just because the technology stack seems hard to you.
We can write simple web apps using vanilla JS with HTML/CSS but for complex application, the way is by using a mature and reliable library/framework rather than creating a custom framework/library that does things I want "the native way".

Collapse
 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ • Edited

Did you read all of the proposals in GitHub? It sounds like you may not have, or possibly didn't understand what is being proposed?

There are some really good ideas in there.

Collapse
 
nielsabildgaard profile image
Niels Abildgaard

The standards are moving really fast these days, and a lot is changing---and has changed since the launch of youmightnotneedjquery.com/ :-)

There are also a lot of much smaller ways to get started with building slightly dynamic websites - you may not need a full frontend framework. See e.g. dev.to/bindthis/avoid-server-side-...

There are still lots of good reasons for frontend frameworks to exist---but there are also lots of cases that do not need them (and where leaning into what the web already does well would result in a better solution), where they are still used, to the detriment of user experience.

It's... nuanced, basically :-)

Collapse
 
fa7ad profile image
Fahad Hossain • Edited

It's... nuanced, basically :-)

Basically everything is nuanced xD

There are also a lot of much smaller ways to get started with building slightly dynamic websites - you may not need a full frontend framework. See e.g. dev.to/bindthis/avoid-server-side-...

This is purely anecdotal,
I was once a junior dev that thought "this application is small enough, maybe I can get away with a much smaller framework." and for a while I did get away with it. Until product decisions made it nearly impossible to work with the small framework; worse still, no one else on the team knew the tiny framework. So, in the end we had to give up and rewrite the application in a scary big framework because in the end the little bump in size was nothing compared to the unmaintainable mess that would have resulted in continuing to use an obscure tiny framework that might be abandoned in 3 months.
If you're thinking, "hey how about relying purely on platform code and no framework".
This can go one of two ways and imo both are terrible,

  1. You write spaghetti code because native platform offers very little in the way of code re-usability etc.
  2. You bring in some additional tooling, come up with some patterns and re-usable chunks of code.... congrats you just made your own special framework; bonus, there's little to no documentation for it. Good luck explaining it to a guy who has never worked in your org/team xD
Collapse
 
nielsabildgaard profile image
Niels Abildgaard

Overall, I think you're very right that these current (branded) platforms of web development (like React) are taking away from good adoption of more web-native approaches. And that the native web platform is actually very good, albeit under-tooled, today.

I am seeing a bigger picture than just the web here, too. The current situation, where lots of developers know only React and not web development coincides with a significant and global relative shortage of senior competences in general in the industry---largely due to the huge amounts of developers being trained globally, while there are often too few opportunities for junior developers to develop truly senior skills, or be trained by truly senior developers.

In a world where deep platform understanding (and deep software engineering knowledge) is a bit too sparse, big and powerful tools become an easy way to keep developers productive. Developers only have to learn one tool.

Not too long from now, companies will start to realize the damage that can quickly be done by software developers with an extremely limited purview. You've pointed out several of them in this post: teams build solutions that perform poorly in real-world conditions. We're not there yet, but when companies start realizing in general, developers will be pushed to change with changing demands.

I think it's interesting to observe how these changes are slowly starting. Svelte's CSS outputs to CSS files, and you can get similar results with plugins for React etc. The emergence of HTML-first frameworks (Astro, Eleventy), as you mention, are another important data point. Eleventy 2's .webc format leans heavily into (HTML-like) web component syntax, enabling complex static-site generation from HTML-like data.

React is like a powerful hammer, and a lot of developers have learned that most things can be hammered in. With experience and changing requirements we will see a shift towards a more analytical approach, where the right tool is used for the job. I hope.


On the whole, I agree with your observations and I am very aligned with your hopes for the future. I look forward to following your posts on this.

On a more granular note, I think there are a few of the data points you pull together that miss the mark a little bit---but there's a real chance that I'm just missing the exact point you are making.

For example, as I mentioned above, Svelte outputs its CSS natively as CSS files, rather than Javascript. That nuance is important because Svelte is a part of the tendency towards a more web-native world. There's still a long way to go, and your other criticisms (e.g. it requires learning a wholly new syntax - even as that syntax is closer to native Javascript) are still valid.

Also, while HTML imports are a really cool way to import web components for use in a page, there is no HTML-native way to embed an external HTML resource inside another---a case which HTML modules support very well within the context it is run in. In my opinion, HTML and CSS modules are an obvious extension of ES modules, which are now standard. I would like to also see more powerful HTML imports, but I can understand why the standards are currently coalescing around a single standard.

As a point against HTML and CSS support in ES module imports, you quote (source unclear) a paragraph saying that Javascript is supposed to be a "DOM-agnostic programming language". It is unclear to me where that idea comes from, seeing as Javascript includes all the abstractions that make up the DOM in the bundled standard library. This seems like a misrepresentation of what Javascript is, has always been, and will continue to be.


Your post makes me reflect on the bigger picture of how the web is evolving. I remember when jQuery was all the rage, and I remember when youmightnotneedjquery.com launched and blew my mind. Heck, I remember when ActiveX, Flash or Java Applets were trying to take over as the primary platforms for interactivity on the web, and I remember how the standards-based approach won.

In all these cases the branded, private alternatives to the standards disappeared after the best of their ideas were included into the standards.

In a way that's the history we're still seeing repeating here. The web enables incredible exploration and innovation, even in ways that are not well-supported by or even run parallel with the intentions of the standards. That has historically been a great advantage, leading to a lot of innovation, and most of the bad ideas being discarded.

I'm confident that the standards are (generally) moving in the right direction (even if there are some missteps), and we're getting an even more powerful web platform. And I'm very excited about that!

To me the real question is how much damage React has done through trying to make itself synonymous with web development - just like Flash or Java applets did. Some people will eventually have to retrain, but in the process I think they will learn how to become better and more versatile developers. Hopefully.

Collapse
 
oxharris profile image
Oxford Harrison • Edited

Plus one that Svelte outputs to CSS and we should care about that detail. So that leaves us with half of the charges against Svelte. Lol. (But should we really get into saving our individual frameworks?) Generally, there are some of these derails that exist at a drilled-in level but which don't really help the overarching philosophy nor move the web forward to new possibilities.


Re: HTML Imports: having put the problem statement well this way...

while HTML imports are a really cool way to import web components for use in a page, there is no HTML-native way to embed an external HTML resource inside another

...what constitutes a corresponding solution? A JavaScript-native way or indeed a HTML-native way? Aren't there credible standards for loading subresources to converge on in the HTML space?


Re: JavaScript and the DOM: am I missing your point? Is the DOM part of the JavaScript programming language or rather the other way around?

Collapse
 
nielsabildgaard profile image
Niels Abildgaard

Re: Frameworks: Yeah---the note on Svelte is perhaps a bit pedantic in the big picture. I agree with your overall thoughts, and I don't mean to detract from them! I'm sure something even better than Svelte will come along (but I think we're a good ways away from standards so good we don't need frameworks)!


Re: HTML Imports: Agreed - a fully native import in HTML would be really cool. I'll point again to .webc as a format that could have relevance, by leaning into the (already established) Web Component syntax. Imagine <my-component src="/my-component.webc"></my-component> or somethink like this, off the top of my head:

<link rel="component" name="my-component" href="/my-component.webc">
<!-- ... -->
<my-component>
  <h1>This is placed inside the component.</h1>
  <p>.webc supports slots, too.</p>
</my-component>
Enter fullscreen mode Exit fullscreen mode

Re: Javascript and the DOM: I think the two are so intertwined that it is nonsensical to consider them as separate in any way :-) The DOM is designed to be manipulated by Javascript. Javascript is designed to manipulate the DOM.

Thread Thread
 
oxharris profile image
Oxford Harrison

Really great thoughts you've shared in all. I fully embrace them. And we might even have more to converse on in my next piece in this series. Looking forward to that. (I'd love to bring the .webc idea up in that article where we can play with it alongside other ideas.)

Regarding JavaScript and the DOM, this MDN reference might be what I really have in mind. TL;DR: these two things just happen to meet each other in the browser (and browser-like environments), whereas they're really independent standards. You can expect to see DOM implementations in other languages like Java, and you can even more so find JavaScript runtimes that have no idea of the DOM. E.g. node.js

Thread Thread
 
nielsabildgaard profile image
Niels Abildgaard • Edited

I look forward to reading your next piece :-)

I understand your view on Javascript, and I agree that it has uses where the DOM is not present. And that the standards for the two are separate.

The context of my original comment was this sentence, which seems to imply not just different standards, but a lack of coupling between the DOM and Javascript:

And notice how this comes even at the risk of tight-coupling a supposed general-purpose, DOM-agnostic programming language with the DOM!

To zoom out a bit, this sentence comes in the context of critique of HTML modules, e.g. import htmlData from '/someFile.html';. I don't think supporting common formats for imports really ties Javascript any closer to "the web" or "the DOM" than e.g. support for importing JSON files does.

(JSON is not the same as Javascript objects---and you could just write your files as Javascript files if you wanted a more clean/less tightly-coupled to web technologies approach to Javascript.)

I would also welcome import of e.g. XML data in a standardized way, and across environments (web, Node.js, deno).

Perhaps I am just reading too much into "DOM-agnostic", or the idea that Javascript isn't already (in design terms) quite tightly coupled to the design of the DOM. It would be incredibly hard to change one without consideration for the other, c.f. backwards compatibility to 1995 (for both the language and the DOM classes), having co-evolved with the web platform, etc.

Thread Thread
 
efpage profile image
Eckehard

The Chrome rendering engine and the Javascript V8 engine are both written in C++, so I suppose there is no "natural" connection between the two. But the HTML-DOM-API opens the DOM for any kind of manipulation, including creation of the whole DOM tree. So I suppose, the API is mainly an interface to the rendering core.

So, if we build websites mainly with Javascript, using Javascript to create HTML to let the rendering engine create the DOM might possibly not be the most clever thing we can do. In any case it is not the fastest...

Thread Thread
 
nielsabildgaard profile image
Niels Abildgaard

As an example of this, when Flutter builds for web, it renders everything in a canvas - no DOM.

It has a lot of other downsides. HTML/the DOM is a really good model for supporting accessibility needs, for example.

Collapse
 
efpage profile image
Eckehard • Edited

One part of the problem is, that HTML is still a child of the late 80ยดs. While the web went through lotยดs of transistions, the core did not change much. It is like flying to the moon on a VW beetle. Now we have a supercharged, fusion powered beetle, but in the core it is still a car, not a rocket.

See my post do we really need HTML for more details and a different approach. There are also some really lightweight demos on dev.to

If you start building a rocket not based on cars, you will loose a lot of ballast :-)

Collapse
 
oxharris profile image
Oxford Harrison

Hilarious analogy.

Collapse
 
jankapunkt profile image
Jan Kรผster • Edited

From what I have learned the last years I came to the following rules (top-to-bottom) I try to follow, where possible:

  • if there is no use-case for it from a user perspective, cut it
  • if you can define it using plain html, use plain html
  • if you can style / animate it using css, use css
  • if you can model it using JSON files, use JSON files
  • if you can process it using vanilla JS + web standards, use them

Someone might wonder, why I added the first line, which is not related to html, css, js etc. but I honestly believe, that all this framework mania is also a result of the scope-creepiness of developers, managers, ceos etc.

The less features a web-app requires (the name app already implies a lot!) the less there is real need for big, complex frameworks, bundling, transpiling etc.

I broke that down for my personal website and came the result that I will do it by hand with html, css and super minimal vanilla js. Took me roughly one day to complete it, including 100% lighthouse score.

I would even advocate for simple use-case websites, that there is no need for a database! Unless your total amount of files goes into the hundrets or above you may be totally well using JSON files.

The argument that it may have to scale is to me again a scope-creep argument, leading to premature optimization for scale and - again - bloated code with lots of unused code shipped to clients.

Collapse
 
oxharris profile image
Oxford Harrison

I found that the older you get, the more you come to these principles. You begin to see the "more" in "less".

Collapse
 
leob profile image
leob • Edited

Yeah with stuff like Astro and Remix the trend is clear - back to "shipping" more HTML, less JS ... progressive enhancement. In a way we've come full circle - but with tons of complexity (and overhead?) added :)

Honestly you can't blame the "abstract the web" folks, because the web as a platform was just not cutting it - not as an application development platform, that is - it was underpowered.

But look at how much the "native" web standards have grown and evolved, and how browsers have become more capable - the 'native' web now is becoming a credible app development platform.

(case in point: native browser support for ES6, so that we can - at some point - finally get rid of Webpack/Babel and the need to eternally "build and bundle")

Now the only ;) remaining problems are:

  • native web is becoming better ... really good even ... but still not quite there?
  • frameworks frameworks frameworks, too many options ... framework fatigue
  • builders, bundlers, tools, more tools ... tooling fatigue
  • native web APIs are huge (just look at CSS), does it still all fit in my head? :-D

Seems simplicity won't ever come back, but well, probably ChatGPT or its successors might be writing much of our code in the future anyway :-D

Collapse
 
oxharris profile image
Oxford Harrison

I agree with you. To be fair "abstract the web" was good thinking at the time; the web was indeed TOO underpowered! But what went wrong? Staying fixated to a mission whose premise has changed! It's a depressing insight when you realize how much of today's innovation is still living in the past, solving for "already solved problems".

And simplicity is sooner than you think. Trust this woke generation and its new quest!

(No, we aren't asking for too much; just let's collapse the current heaps and crates of legacy tooling, and we'll be fine.)

Collapse
 
leob profile image
leob • Edited

Nice one:

when you realize how much of today's innovation is still living in the past, solving for "already solved problems"

But CAN we already, realistically, build any kind of complex/sophisticated web app WITHOUT any sort of add-on tooling or framework?

Thread Thread
 
oxharris profile image
Oxford Harrison • Edited

Spoiler: No!

how far does this go in real life? Build a twitter clone with zero tooling? Uhh, that has never been the idea, and we may never get there! The web platform is anything but a framework of its own! At some point, we are going to have to need higher-level abstractions over native lower-level features! Where there seems to be a bit of a bad news is that the current state of HTML and the DOM makes that happen sooner; it isn't long into the journey before gaps and dips in the platform gets you into forced labour! But we can easily turn this around...

And let's stress again that we are here because we chose to move forward with the framework web and not the platform.

Thread Thread
 
leob profile image
leob • Edited

The fact that a whole bunch of browser vendors need to all faithfully implement these complex standards is one key reason why "web the platform" has advanced at a snail's pace (but it's picking up speed now) ... let's be honest, for a long time (the longest time) the web as an app development platform has been severely underpowered, JS frameworks were realistically the only way to do anything sophisticated with it.

(remember the "browser wars" of the 90s with Microsoft at its center, and actively and deliberately trying tp sabotage the standards with its own proprietary nastiness - the multiple "modes" of IE, ugh, shudder)

But aren't web components the way forward then? And what about web assembly?

Collapse
 
dastasoft profile image
dastasoft

Thanks for sharing this article, I would like to point out also some points that I have found in different places that I think plays an important role in this situation:

  • Many companies tend to think frontend = easy stuff and backend = very complex, sensitive and difficult so, for frontend the choice in most cases is to dedicate their staff with less experience and less resources, while in backend there is a constant talk about architecture, best practices, how to improve security, etc. So my point here is, we have to admit that frontend now, in some cases, has a lot of logic and cannot be approached like 15 years ago.

  • One size for all, as engineers I think one of the most important things we should do is to use the right tools to achieve the best solutions and nowadays I think it's easier than ever to get caught in the FOMO/hype train and end up making simple websites that don't even require JS at all with high bundles.

In a way this is normal, or at least expected, as our industry continues to gain traction and tools become better abstractions it is entirely to be expected that we will see more products with less overall quality or deep understanding of the whys.

Collapse
 
oxharris profile image
Oxford Harrison

Very well put. Those two points stand out. And these things don't easily correct themselves. It's sad.

Collapse
 
efpage profile image
Eckehard • Edited

Reading your post again Iยดm really amazed: I totally agree to your analysis - every single line. Just with a different result.

Hope I can gain some insights from WebQuit. Just, my concludions are a bit different.

I have been working as a programmer for a long time, and here things are a bit different. Most programming languages provide a small, but universal set of keywords and you can - more or less - express anything with this instruction set. C++ has about 60 keywords, thats all. Truely, there are libraries or apiยดs, that contain 10.000th of routines, but all are expressed with these 60 keywords only.

On the WEB, things are very different. You have to learn at least:

  • HTML
  • CSS
  • Javascript
  • AJAX
  • JSON
  • PHP
  • SQL

Each tool provides its own syntax, keywords, semantics, wording etc. and is probably different in version 2 from version 1

Then you are prepared for - noting much! You just know the basiscs. Now you start learning a framework, a toolbox, a new philosophy to create your first website. Are 2000 pages enough to get a coarse overview over React or Angular or JQuery? And did this change with version 2?

So, overall, the only common sense on the WEB is Javascript. Regardless of what you do, there will be at least be some Javascript included. So, I decided to go with JS only, for convenience or just to keep things simple.

What I found: Itยดs working. You can do all the things with Javascript in an easy, well orgaized way. I need precisely no tools at all to do all the things, you might need a framework and a toolchain for. Just VScode and a browser - thatยดs all (possibly a tiny bit of PHP, sorry).

I found that the "one tool to rule them all" works pretty nice with Javascript and you may gain a lot of convenience here. And you can use some old fashion rules to control the chaos. Maybe this is not for everybody, but it works for me.

You have described the frustation to use tools to reduce the complexity, which finally bring more complexity to your toolchain? This is simply not true for my approach. The more tools I have, the simpler my life is. As each tool is only a JS library, they just bring more opportunities, no frustration.

I hope you can use some of this Ideas for your approach too. I would love to bring the best of both worlds together.

Collapse
 
miketalbot profile image
Mike Talbot โญ • Edited

Yeah this for me. I've find the idea of JS everywhere initially counterintuitive (and it may suffer from build steps etc). The productivity boost we have from JS vertically through back to front end has been major and decisive. Shared libraries of our own that are always in sync, no mind shift for the developer, etc, etc...

So Javascript for everything and any output is effectively an object code artefact?

I started coding in assembly language and C. I wrote whole games in assembly language (yep, that old - one of them sold more that 500k units too!) Do I think we should go back to assembly because you can squeeze out the most performance... no. Assembly language has become 99.999% the target of compilers. HTML being the target of a compiler is no different. A DSL for a VM that renders things is ok in my book I've decided.

Of course it would help if the tools got out of the way and the result wasn't bloat... But I'm all for the 1 ring.

Collapse
 
efpage profile image
Eckehard

We should definitively not go back to assembler. But there is a tendency to reinvent the wheel with every new platform we get. It is like you need a different driver license for every new car. Does this boost our performance?

Collapse
 
rytis profile image
Rytis

What a great article! So many references, I will have to spend a full working day reading them all!

I'm very glad that you've mentioned Hype Driven Development, because that has been my exact experience with frontend development. There was a time when I've learned React, and I've actually really liked it. I've even built a couple of sites with it. Then they've decided that classes are now considered old and discouraged, it's all about functional components. After a year I needed to revisit React for a project that I had, and to my utter shock I've realized, that I no longer know React โ€“ it's a totally different library now. I kinda gave up on frontend after that.

It started out as a great idea and a great solution, but it has morphed into something really horrible. You don't need to look too far โ€“ Facebook's performance is atrocious, and so is the performance of any slightly bigger website written with React.

Another thing that terrifies me is the emergence of JS in the backend world. I can imagine a bunch of suits in a meeting room: "You know all these frontend devs that we have? Let's make them also do backend. They don't have to learn anything new, because they can use the same language for that". And then you get billing modules written in a language that only uses double precision floats for the numbers.

Collapse
 
fruntend profile image
fruntend

ะกongratulations ๐Ÿฅณ! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up ๐Ÿ‘

Collapse
 
oxharris profile image
Oxford Harrison

Many thanks here.

Collapse
 
bretbernhoft profile image
Bret Bernhoft

This is one of the more interesting posts I've read on this platform. Thank you for getting back to the basics with your ideas.

Collapse
 
bennypowers profile image
Benny Powers ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡จ๐Ÿ‡ฆ

There are so many of us that have been

  • writing good HTML and custom elements for progressive enhancement
  • working with the platform
  • not bullying people into accepting the supremacy of javascript/frameworks

but those voices are not as shrill as certain framework stans, who have gone out of their way to discredit their critics

Collapse
 
oxharris profile image
Oxford Harrison

This. The web against the web!

Collapse
 
yw662 profile image
yw662 • Edited

I don't think it is a real issue to have a "web app" to support "platforms without javascript support". If it is an informative page, yes it is better if it can work without javascript, it is great if it provides a human readable result for curl. But if it is an app, curl is not your target platform.
So "build everything to js" is not really that bad if you are working on apps, like games, online tools or the comment box for dev.to, instead of pages, like wikipedia or dev.to (except comment box).
And, custom elements, as one of the native web thing, needs js.

As a react hater, the biggest issue I found with being native is type checks, analysis and verification. Native web APIs have a dynamic and permissive nature, eg. a random generated piece of text has a good chance to be a valid html document, you just need a <!DOCTYPE>. They have to because they are supposed to be compatible. But it is really hard to tell whether you are doing things right because it will never fail until it has to.

Collapse
 
dbroadhurst profile image
David Broadhurst

The day a developer started their web development career they signed up for abstraction. The DOM abstracts the GPU, JavaScript abstracts the CPU and memory. All things considered frameworks are the last 1/100th abstraction layer.

Although the developer stack has increased in complexity using this stack has become trivial. Using something like NestJS It's easy to create a project that has all modern development features and with little effort and deploy to the cloud.

Typescript has pretty much replaced Javascript for good reason, it's a great abstraction that comes with extra complexity but increases developer productivity and reduces runtime errors.

As always selecting the right tool for the job is critical. Building a low complexity website requires different tooling and skills than making a highly interactive web app. I think there's still a few more abstraction layers to come such as AI code generation and Low / No Code tools that will push even more abstraction and widen the debate.

Collapse
 
insidewhy profile image
insidewhy

I think react is responsible for a lot of this (I'd say angular also if it was still popular).

Everyone loves it, but it really isn't very good. You constantly have to worry about implementation details of react itself to write even a basic component.

Everybody got on a really lousy bandwagon. Then if you want to make money as a front end engineer you're forced to learn it because it's where 90% of the money is.

I'm not against abstractions when they give you more than they take away, I'm not against frameworks, I'm just confounded that the very worst frameworks are the more popular ones.

Collapse
 
sentadoensilla profile image
sentadoensilla

Versioning -> use -> deprecated, all in the same year. Why become javascript as annoying as java and insane as android. Why????????
Please stop to annoying javascript. Versioning and deprecating in same year is insane for developer they became person with framework addiction

Collapse
 
efpage profile image
Eckehard

Is this really true for Javascript?

There certainly is some progress in JS over the years, and not all browsers are in line with the newest ECMA-version. But there are valuable tools like Can I Use... to find a common sense.

Nobody stops you from using older versions of Javascript, and if you go with a version, that is about 3-4 years old, you will probably get no compatibility issues.

Collapse
 
yw662 profile image
yw662 • Edited

The only "real versioning" they have ever done to js is "use strict". It is really only two versions in js: the old one and the strict one. Nothing is ever deprecated in js.

Collapse
 
yw662 profile image
yw662

Besides the react lock in, we have npm and webpack (or bundler) lock in as well. It doesn't have to be npm or webpack, it doesn't have to be node, but we have to pick a compiler/bundler we like in the end because those libraries are designed to be used like that. This is worse than the react lock in.

Collapse
 
m18ab profile image
Spenser McLaughlin

As a new developer in the field, the most confusing aspect about all of these platforms is the tradeoff between features and performance. Youโ€™d think that heavy frameworks like React would be able to deliver far more features and functionality than a web component architecture, but that isn't the case.
To me, these approaches are already far more approachable than React and Angular. Having a pre-existing knowledge of Java and Python, the proprietary syntax of React and Angular was far more confusing than web components. The big issue is that the other two have much more support, so providing exposure and resources for web components and VanillaJS is key.
On my first stab at web development, web components werenโ€™t immediately easiest to work with, as they required a little more setup than Vue or Angular. In those frameworks, I could just copy and paste my CSS and HTML into a boilerplate and have it work with almost no hitches. However, after this initial step, building on my code and using JS in these frameworks was considerably more difficult than it was in the web component structure, where it was ported over much more easily.
Nonetheless, when I was actually tooling the JS together, nothing clicked immediately. What was especially confusing at first was the inability to style certain parts of my card, which I later learned was due to it being inaccessible within the ShadowRoot. This caused me to struggle with connecting buttons (not part of my card) to the actual style changes I wanted to appear in my card.
However, what helped me get through my issues was finding similar issues on Stack Overflow (such as this one and this one).

Collapse
 
drewknab profile image
Drew Knab

We've been rethinking the modern web every three years since XHTML 1.0 was a hot new spec.

Collapse
 
csaltos profile image
Carlos Saltos

I'm so glad we are using Elm in my company ... nowadays the best trade off between traditional and modern with a unified platform