Viewing a single comment thread. View all comments

voxpoplar wrote

I think there's multiple factors to this. Part of it is Javascript itself. It has confusing and weird behaviour from being a language that for long time didn't so much have a standard as a bunch of different implementations in various browsers that converged on each other while collecting various unintended or undocumented behaviours that became standards simple because if they were changed it would break people's websites. There's also a bunch of reductant ways of doing similar things in it that are kind of confusing.

Here's a talk showing some weird unexpected behaviour. There's reasons for all of this stuff, but they're unintuitive and confusing at first glance.

Then there's the fact that web browsers are generally designed to be really forgiving. Webpages don't generally crash no matter what nonsense you put in the Javascript. The browser will allow the tab to do whatever you want with various values. This means it's very easy for people to make mistakes and not realise they've made them. Or to copy around code without really understanding what it's doing and just tweaking it semi-randomly until it does approximately what they want.

So while Javascript doesn't exactly make it hard to write good code, it makes it extremely easy to write incredibly awful code. Code that's impossible to understand, has lots of side effects or basically only works by accident.

So there is a lot of very very bad Javascript in the world. And for a long time there were not very good tools for working with it other thank text editors and then running it in a browser. Which made debugging Javascript absolute hell. There are better tools now but crying while not being able to understand why the webpage is doing what it was doing is a lot of people's experience with Javascript. And there's still a lot of Javascript that's not written with newer tools or written badly with those tools.

And even with all the better tools that exist now the language itself still lacks a lot of things. It's not really dynamically typed so much as there's a system for building objects that resembles a typing system. There's no inheritance. There's no interfaces. It's very limited and frameworks need very hacky systems in order to work. Using things like React to me feels very weird and like you're fighting the language a lot to make it work.

Then there's also just general dislike for the state of the modern web and what has been built with Javascript. I run NoScript in my browser because the vast majority of websites are much more pleasant to use when you don't let them run Javascript. Because the Javascript they run is mostly just for spying on you and making using the website slower and worse when all you want is to read a fucking article.

And finally there's a lot of criticism of the modern Javascript development ecosystem as it were. I don't have much skin in this game and don't have much opinions on it but the left-pad incident in particular spawned a million blog posts of people questioning how much web developers relied on jenga towers of hundreds of dependencies that could be doing god knows what.

4

voxpoplar wrote

Also if you're used to Python and go into your browser console and type print(thing) to try and get its value it brings up the print document dialogue in the browser which I find very funny.

3

twovests OP wrote

Oh I love these "weird JS behavior" talks and they're probably the reason I felt "Hmmm" in the first place about JS. (And the dependency issues you mentioned)

So while Javascript doesn't exactly make it hard to write good code, it makes it extremely easy to write incredibly awful code

This is an impactful takeaway

2