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.
We Should Stop Using JavaScript According to Douglas Crockford (2023)
51–60 of 77 posts
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#52I 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…
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)
#53Earlier 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.
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)
#54The 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…
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#55The 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…
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)
#56I 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.
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)
#57As 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…
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)
#58NPM 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)
#59I 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.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#60At 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.