by glutamate on 12/10/24, 10:35 AM
The author never actually says what is so wrong with JavaScript. I think it is quite a good dynamically typed language, and it certainly has some very high-performance implementations. If you don't like it, just use something else?
> Ultimately, JavaScript was the right thing at the right time. It ended up being folded, spindled, and mutilated to serve purposes that it isn’t well suited for
Counterpoint: many quirks in the language were addressed, e.g. introduction of === and with ESLint you get many of the practical advantages of a type checker. And when you need more safety, sprinkle TypeScript on top.
What I really want for Christmas is a TypeScript-to-native compiler.
by bambax on 12/10/24, 10:30 AM
This is a plea to use TypeScript instead of JS. Why not. Strong typing is certainly great. But the reason I don't use TypeScript isn't any of those listed: it's because it needs a compilation step, and I don't want that.
by mythz on 12/10/24, 10:41 AM
I'll happily use TypeScript for all my UI components, libraries and server code, most of the time with Bun thanks to its OOB support for TypeScript.
But for Web UIs I'll drop down to a #NoBuild "Simple, Modern JavaScript" [1] i.e. using JS Modules + JSDoc Type Annotations to avoid needing any npm modules/build steps/etc. I still benefit from a library's TypeScript definitions/VS Code intelli-sense/static analysis/etc but completely avoid any build/bundling complexity for the cost of a slightly more verbose syntax in JSDoc type hints.
I'd happily move to using ECMA Type Annotations proposal [2] if it ever got accepted, but alas TC39 moves slowly...
[1] https://servicestack.net/posts/javascript
[2] https://github.com/tc39/proposal-type-annotations
by dmmartins on 12/10/24, 11:21 AM
I don't get the "type checking is the solution for the problems of the world". A lot of good things were/are written without type checking. Most of the problems I see in production have nothing to do with the wrong type being used or some forgotten required parameter.
Also, typescript is just javascript with a mustache. It's the same thing
by Maksadbek on 12/10/24, 10:47 AM
Post "Say no to JavaScript" on a website that heavily uses javascript... ironic
by 1vuio0pswjnm7 on 12/10/24, 7:23 PM
I have said no to Javascript for over 20 years for reasons having nothing to do with the language. I actually like the way Javascript looks because it looks much like C. I have no problem with the Javascript language.
But Javascript is the language of choice for programs (scripts) that I do not care to run. By default, these undesired Javascripts are executed automatically with no user input when one uses a so-called "modern" web browser.
As such, I do not run Javascript. As it happens, the language is closely associated with the so-called "modern" browser, a program that I consider too big, too complex and too dificult to control. It takes far too long to compile, assuming the source code is even available.
I am submitting this comment without using a "modern" web browser.
by jacknews on 12/10/24, 1:22 PM
"Typing everything allows you to clearly and succinctly declare intentions with your code as well as enforce those intentions throughout your code base. For an application with many developers, being able to clearly and definitively express what code does is a huge advantage over code that requires a fellow developer to spend cognitive energy to figure that out."
Types are definitely useful in the fight to 'make invalid states impossible', but this rather overstates the case. They go only a very little way in documenting intent.
by rckt on 12/10/24, 10:27 AM
I never understood people discussing JS and TS as different entities. TS is JS, but with types. But to be fair I can't imagine now using untyped JS without an LSP of some sort.
by ghjfrdghibt on 12/10/24, 10:41 AM
I don't see JavaScript as the webbrowsers assembly, and whilst it can be, don't agree that the web browser is the new operating system. These are the two predicates used to justify the author's argument to use typescript.
I don't have a problem using typescript, but prefer dart if you need a strongly typed (null safe) language.
by baerrie on 12/10/24, 1:19 PM
I think the flexibility of JS forces you to be intentional with your code composition in order for it to not be a huge mess, which makes better programmers. With that being said, many programmers don’t want to think that hard so they rely on railroaded overly opinionated languages or write bad JS
by greener_grass on 12/10/24, 12:28 PM
JavaScript is a very capable language. It has better functional programming support than Java and Python. It has fewer footguns that C++. You can start with a scrappy prototype then gradually add type-checking later. Of the mainstream languages, it's actually one of the better ones!
by andrewstuart on 12/10/24, 12:00 PM
I promised myself I wouldn't respond to ridiculous posts on the Internet with zero credibility.
by JohnDeHope on 12/10/24, 11:50 AM
I hope wasm becomes the assembly language of the web, before JavaScript does.
by medo-bear on 12/10/24, 10:50 AM
Meanwhile in lisp world no one really cries about type errors. I wonder why
by qayxc on 12/10/24, 10:33 AM
The author seems to ignore the fact that type hints are a thing even with plain JS. Serious question: does the author "just say no to Python" as well?
If lack of explicit typing is the issue, then his rant would apply to most scripting languages and to single out JS seems odd to me...
by dave333 on 12/10/24, 7:04 PM
Most code doesn't last long enough to need maintenance.
by nottorp on 12/10/24, 10:52 AM
Translation: type less languages get messy when the project size grows. This is not only about javascript, it's also about python and whatever else is in fashion.
Still, the title is disappointing because switching to a type checked dialect of JS won't fix the bloat issues that are fundamental to the browser as a platform.
by lproven on 12/10/24, 11:19 AM
How disappointing.
It is not at all "say no to JS". It's "use my preferred flavour of JS instead."
I want to return to the pre-JS internet and especially the pre-JS Web.
Say no to Javascript at all in any variant. Also say no to PHP. Nothing of lasting value to humanity would be lost if both of them went away completely, forever.
by daft_pink on 12/10/24, 2:19 PM
Python is good for beginnners. Javascript ain’t.
by petercooper on 12/10/24, 11:31 AM
I thought this was a parody of Guardian-style opinion columns at first. You know,
"I have a strong opinion and here are Y meandering and mildly amusing/lighthearted reasons why" op-eds.
I like opinion columns and would love to see more about software development, but this one feels like it's going for the lowest of hanging fruit. Anyone who cares about JavaScript either way will already have an opinion and won't be won over by a humorous take.
I do like the author's style though, so don't interpret this as crapping on his work. Looking at the "More from this author", it seems this is his genuine style, and I found some of his other pieces to be good reads. More please.
by tobyhinloopen on 12/10/24, 10:54 AM
I was disappointed to read this is just a "Use TypeScript" instead.
Look, you can hot glue and tape all the types you want, but it is still JavaScript. No amount of compiler-enforced comments is changing that.
by rco8786 on 12/10/24, 11:17 AM
I'm a fan of TS, and have no issue with people's opinions on programming languages. But come on, the whole "built in a week" thing is pretty tired at this point. There have been many, many major iterations on Javascript since the 90s. There's nothing inherently wrong with vanilla JS these days. It has a few quirks like every language does, but overall generally does what you expect it to do.
by DecoySalamander on 12/10/24, 10:56 AM
This kind of rant, culminating in a hackneyed "created in a week" insult, usually comes from backend developers who jumped into frontend work thinking it was a silly little thing that could be mastered in under an hour, discovered that it was a whole separate field, and still failed to adjust their priors.
This time it comes from a "former Delphi product manager" turned clickbait writer. I just hope that my visit with adblock enabled didn't generate any form of income for him or his website.