WTF!?

So Javascript has these functions to get the nodes in a document…
document.createTreeWalker and document.createNodeIterator that create a TreeWalker and a NodeIterator respectively.

But because this language is dogshit invented by a complete and utter failure of a homophobic organism, those are of course
not compatible with the standard iteration protocols of the language and you can’t just write document.createNodeIterator(document.body, NodeFilter.SHOW_TEXT).forEach(n => use(n));, because that would be way too easy!

No,
NodeIterators and TreeWalkers have their own incompatible interface and there isn’t even an easy way to convert them into an array or something similarly usable, because again, that would require to have more than room-temperature IQ when designing a language, and we all know that homophobes lack that!

Seriously, how has this failure of an excuse for a programming language managed to stay the only language shipped in browsers? Why did google not just force dart into chrome and tell people to use something that’s at least slightly less shitty?

Like how many different sequentially accessible container types that all have different and incompatible interfaces and are various degrees of difficult to turn into something usable does this crap have?

#Javascript #ecmascript #js #webdev

@Fiona personally, I just force #JavaScript off because the only #JS I see is #malware!

  • There are ZERO reasons to mandate JS because there are a shitton of goid sites that use none and those ain't inferior at all!
@kkarhan Oh, I agree that you can do amazing stuff without JS and am only using it for things where there is really no reasonable alternative on my website (such as storing and loading user-settings in local storage, if you disable it the settings still work because the actual functionality is in CSS, but it won’t persist across pages; or for things like slide-show mode to bind key-presses to navigation).

Like: For pure documents you don’t need it, but at some point being able to create an app that is truly cross-plattform and doesn’t require installation
is nice. The example of one such thing that I need to work on more again is my voice training app which is fully written in typescript and uses native browser-APIs. It isn’t perfect, but it is way more privacy preserving than anything else that’s out there.
Free 🏳️‍⚧️ Voice Training

@Fiona maybe take a look at how #dread do it, cuz they store settings and allowncustomization yet the only #JS they have onsite is some code that pops up telling people to disable #JavaScript!
@kkarhan dread? Do you have a link?

That said, the only way I see to store settings without JS is to send them to the server and store them there, which is way more invasive for privacy than putting them into local storage.