| ▲ | only-one1701 12 hours ago | |
Something I keep thinking about when I consider the trade-offs between building a site with HTML/CSS wherever possible vs JS is what the actual _experience_ of writing and maintaining HTML/CSS is vs JS. JS gets knocked around a bunch compared to "real" languages (although less so in recent years), but at the end of the day, it's a programming language. You can write a loop in it. Writing a web server in C++ is a way to get excellent performance. So why don't most people do it? | ||
| ▲ | breve 10 hours ago | parent | next [-] | |
> Writing a web server in C++ is a way to get excellent performance. So why don't most people do it? Because they already wrote it in C. Apache and Nginx are both written in C. Together they run 57.7% of all web servers: | ||
| ▲ | yurishimo 4 hours ago | parent | prev [-] | |
JS got popular because some devs were trying to realize a world where the same code can be shared on the front and backend. I think on the surface, it was a noble goal with good intentions. Having only one programming language to handle is going to create some efficiency gains when you work in a large company with thousands of devs who all need training want to share knowledge as a larger organization. In the past decade, we went full JS as an industry and now we’re starting to swing back. Server side interactivity like Phoenix Liveview, C# Blazor, HTMX, PHP/Laravel Livewire, Rails Hotwire, all of these are different abstractions around JS to make interoperability between the frontend and backend more manageable and they’ve come a long way to closing the gap. Advancements in HTML/CSS standards also deserve credit for closing the gap but we’re still not quite there yet. But at the end of the day, the web is dynamic. As new tools and techniques are discovered, the industry will continue to evolve and certain “hacks” will become new standards and ignorant newcomers will reinvent the wheel again to achieve some crazy interactive design because they didn’t know any better! And it wil work, mostly. Until the way we interact with browsers changes, I feel that we’ll continue to bolt on new features over time and the web will continue to evolve. Just like the iPhone, a surge of use of smart glasses could change the computing paradigm or perhaps its some other device entirely. So you can (and should!) try to optimize for today, but trying to optimize for tomorrow will always carry the risk irrelevance if the market pivots quickly. Bleeding edge is risky but so is falling behind. | ||