Live data from Hacker News

We Should Stop Using JavaScript According to Douglas Crockford (2023)

old.reddit.com

51–60 of 77 posts

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#51
The real culprit here is UI. Yes, there are many better languages and runtimes than JS without a doubt. But most of their UI libraries are just as terrible if not more terrible than HTML/CSS/JS. And that is because developing sensible but also flexible and easy-to-use patterns for user-reactivity and data-presentation is HARD.

So sure, start a clean new operating system with a clean language with a clean runtime. I don't look forward to using whatever mess of a UI toolkit that gets built on top of it.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#52

I think I agree with everything he's saying. There have been arguments against javascript for a long time. If anything though, I think they've diminished over time as the language has improved. I still don't really like it. But there still isn't a technology that can do what js does. That is, distribute apps in a truly cross-platform, zero-install way. So people will keep using it at least as long as that's true. I'm…

> But there still isn't a technology that can do what js does. That is, distribute apps in a truly cross-platform, zero-install way.

It's not a technology problem. You could accomplish this with almost anything - the problem is getting enough adoption to be in a majority of devices. Aside from web browsers the only example I know of are the "super apps" like WeChat.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#53
post #48

Earlier quoted context omitted.

The difference is that the “_comment” as a processing directive is that the JS value and the raw file reflect the same data, where the comment would be invisible at runtime. In this way “_comment” isn’t a workaround, it’s the reflection of the reason the decision was made in the first place (no difference between value and raw).

This is exactly right. Comments in JSON would have killed it.

Strong disagree. We ended up with a Markdown-like menagerie of parsers and serializers with varying degrees of spec-compliance and non-compliant options. In practice, there are plenty of config files that consist of json-with-comments.

I'm good with banning comments in mostly machine-targeted files. But human edited config files that I work on are mostly json these days, and have been. The "_comment" field is not in any schema. No receiving system will read it, other than to throw for schema-non-compliance. I want to leave a message for other human readers inline. If comments would have killed JSON, then we shouldn't have adopted it for config files, because I guess JSON is killing config files?

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#54
post #51

The real culprit here is UI. Yes, there are many better languages and runtimes than JS without a doubt. But most of their UI libraries are just as terrible if not more terrible than HTML/CSS/JS. And that is because developing sensible but also flexible and easy-to-use patterns for user-reactivity and data-presentation is HARD. So sure, start a clean new operating system with a clean language with a clean runtime. I d…

To add on top of that HTML/CSS/JS is really only serious open/free not owned by any for profit org cross platform UI toolkit. That is why Electron is quite popular.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#55

The entire history of programming languages has been: - Create a simplistic programming language that looks easy to learn and use but ends up being deceptively complex to apply to real world problems - Fix those problems with a more rigorous approach that's hard to learn but stands up to real pressure - Ignore all the lessons learned and create another simplistic programming language that looks easy to learn and use…

I'm pretty sure we could skip some of the worst ones, such as the interrelations of type coercion and equality. Variable hoisting isn't as big a deal with let, but we could remove that entirely. We could align null and undefined.

We could fix parseint. Instanceof/typeof could align with expectations. Array could be a first class type, and we could have a split between floating point and integer.

We could force global scope to be intentional, with some sort of global keyword. We could get rid of optional semicolons and go one way or the other. We could get rid if "==".

I think cleaning up equality would do the best for bug removal, but with what we've learned over the last 30 years we absolutely could clean up the worst sources of confusion.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#56
post #52

I think I agree with everything he's saying. There have been arguments against javascript for a long time. If anything though, I think they've diminished over time as the language has improved. I still don't really like it. But there still isn't a technology that can do what js does. That is, distribute apps in a truly cross-platform, zero-install way. So people will keep using it at least as long as that's true. I'm…

> But there still isn't a technology that can do what js does. That is, distribute apps in a truly cross-platform, zero-install way. It's not a technology problem. You could accomplish this with almost anything - the problem is getting enough adoption to be in a majority of devices. Aside from web browsers the only example I know of are the "super apps" like WeChat.

Something like roblox could eventually morph into it. Except the corporate overlords would not be able to help themselves from enshittifying out of usefulness.

Web standards (and email) occupy a unique position that will be hard to replicate. And not for technology reasons.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#57
post #16

As stroustrup said, “There are only two kinds of languages: the ones people complain about and the ones nobody uses.” There are many better languages than JS, and the browser ecosystem has shut down innovation in PLs, but there are some pretty large upsides to the era of language stability that we have now. I'm wary of incrementally improving a root layer and throwing out the enormous ecosystem of tooling and librari…

> the enormous ecosystem of tooling and libraries in the process

Many of which don't even survive a year. And the worst is that they're actually solving the same stuff again and again. Managing libs manually in the jQuery era was not fun, but the NPM libraries galore we have now is worst IMO.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#58
JavaScript is a colossal solution to the demands of product, design, business, users and other stakeholders. Crockford was one of the first to effectively sell it to engineers. It has developed into a nice language with modern features and an incredible debugger, and objectively (to the people we serve, whether users or other clients) the browser is a much richer, more capable and reliable platform today as a result.

NPM has by its nature and on many individual occasions done lasting damage to the project, the reputation of the language and professionalism of the JavaScript community. There is a lot of frustration over this, as well as the "10,000 frameworks" issues (which seemed overwhelming for a time), these and other experiences justifiably put a lot of people off who decided never to get into JavaScript because it seemed like a shitshow.

How much criticism of the web platform today is about its vestigial language features? Very little it seems, compared to 10-20 years ago when the language actually sucked and was considered a joke. It doesn't make sense to stop using it because it's mature and in place, we invested in this thing (as far as the web goes). No, JavaScript's biggest issues are apparently cultural.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#59

I have disabled JavaScript on mobile Safari because I can’t install uBlock Origin and most websites are blackmailing me with either injecting surveillance stuff or credit my bank. Without JavaScript, all popups are gone

Yup, and it’s faster, but most websites don’t work.

Some don’t. If they are worth it, you can open them with another browser

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#60
Years ago, I went to one of Douglas Crockford's talks where he advocated for non-blocking server-side code with Node.js. This was long before Javascript and Node.js had "async."

At the time, Node.js only worked with callbacks, and compared to threaded code in most other languages, the callbacks quickly became cumbersome and difficult to follow.

I asked, "Is there a way to make callback code cleaner?"

Doug's answer had no insight, it was basically something like, "they're messy, deal with it."

A few years later, C# introduced "async" and Javascript quickly followed.

---

The thing is, maintainability of code is very critical. A lot of code doesn't need the kind of scalability that Douglas was advocating in his speech; maintainability is a lot more important than shaving off a few CPU cycles.

I now take everything he says with a lot of grains of salt.

Post reply on HN