by tlug · 6y ago · 0 comments
The search engines these days cannot even function without a JS interpreter, something that surely increases the complexity and cost of building one.
Long gone are the days when one cared about semantic elegance of HTML code, per-site optimized CSS stored in an external file for easy caching, only occassional use of JS for easier navigation...
Nowadays you don't build websites, you have to build "apps". It's one of many signs of the "appification" of Internet.
That said, how would you propose to do syntax highlighting instead of
> just a wall of <div>s and <span>s, for every single visible character
? Rather than being a wall, it looks to me like it's actually a tree of <divs> and <span>s for every line and every _token_.
I think the author has used Prism[1], so I assume the highlighting was done client-side, but even if you were to do the task server-side I think you'd end up with similar HTML/CSS, no?
What would be a better approach to solving the same problem?
[1]: https://prismjs.com/
Agree that it's a mess of div and spans, but it does the job.
Of course you'd use spans to do syntax highlighting, just like you'd use JavaScript to do interactivity. You know what the commenter means–using these in places where they aren't necessary at all.
well, on the other hand manually crafting the syntax-highlighted block of code isn't a lot of fun either
If someone writes a buggy, inefficient C program, we fix the bugs, we don't abandon C and rewrite everything in assembly because the resulting machine code is prettier.
Several languages have popped up to address buggy, inefficient C programs and the problems they cause.
They came up with an app, full of JS. Don't get me wrong, I write apps for my own use (quasar / vue) so I like frameworks, but I wanted a simple plain page.
Since they wanted to use a framework, I asked them to use https://motherfuckingwebsite.com/ as the template and after some initial gasps of horror we had a working web page.
It’s perfect for personal sites, landing pages, documentation, etc.
I wonder if at some point while building a JS interpreter in the early days of Google for search reasons, they realized that the interpreter they spent all the time on could be packaged into a new browser to compete with Internet Exploder. Maybe instead it was all a conscious decision at the beginning.
Google has parsed JS-generated content from businesses I work at and made it searchable within their index. That's a hoax?
Why would I care about semantic HTML? HTML is at large generated for me, and is an implementation detail. I don't want to read nor "craft" HTML.
> per-site optimized CSS stored in an external file for easy caching
Is this not the standard nowadays, getting CSS files from a cache typically on a proxy like cloudflare?
The AMP spec mandates the exact opposite, for whatever that's worth as a "standard."