TypeScript is 'not worth it' Svelte switches to JavaScript and JSDoc
devclass.com
devclass.com
> we are not abandoning type safety or anything daft like that — we're just moving type declarations from .ts files to .js files with JSDoc annotations.
> As a user of Svelte, this won't affect your ability to use TypeScript with Svelte at all — functions exported from Svelte will still have all the same benefits of TypeScript that you're used to
> Our commitment to TypeScript is stronger than ever
Svelte wanted to ditch the need for a build step in testing. Most library authors already tolerate having a build step for multiple reasons, and have no need to go this route. If your builds are too slow, you'd just use a fast compiler like esbuild and reserve the tsc pass for CI/tests and local IDE type checking. (There are still some advantages of not needing a build step, but IMO most people don't mind it as long as it's fast.)
If JS had a type syntax, this would be no issue at all. Unfortunately, who knows if that'll ever come to pass.
As far as I can tell the Svelte developers are not claiming at all that you should abandon typechecking, which is what a lot of people seem to be reading out of this.
That happens every day in other languages. Lots of C++ projects require Visual Studio on Windows, sometimes certain other tools (e.g. https://winscp.net/forum/viewtopic.php?t=25209). Other projects expect you to use the official compiler, because almost nobody ever tried using a non official compiler with that project and how see how things would go. I don't know how it is a problem if TypeScript compiler is required (by itself).
TypeScript, the ES's and TC39s are a mistake since the beginning and ruined JavaScript. The root cause of all this is "JavaScript sucks and we want to build big complicated apps with it" and by "we" I mean big software teams working at big tech companies earning a small fortune every year.
If I have to write TypeScript, then I might just write Java or even C#, since it's a lousy copy of those languages. ( and yes, I say that very loosely ).
The modern ES[insert number] classes are weak and out of place and the module system is a complete joke and disaster. Truly! those people were either on drugs or are playing a joke on the "design by committee" phenomenon.
Yes, Javascript is not a great language, but it won not just because of distribution but also because it as made to be simple to pick up. Have any of these people watched a beginner and not-so beginner try to pick up "modern JavaScript" or TypeScript? Even Java looks like Basic in comparison!.
Thank God TypeScript and ES6 won over Dash/Dart from Google, but god damn it what an hollow victory.
As for myself, this old curmudgeon, I just stopped caring and ignored all of this frontend cesspool. Waiting/hoping all of this rots away.
You might just write it in an object-oriented way... but OOP sucks.
> Have any of these people watched a beginner and not-so beginner try to pick up "modern JavaScript" or TypeScript?
What are you talking about?
Don't know how beginners would feel about writing gradle tasks though. Don't know if they can cross-compile Java to the browser as well.
I all this complication to show some clicky things on a web browser while inputting some data?
Why does your recommendation starts with "just download some other dudes code" to START a project?
These questions are obviously a means to make a point.
You can cross-compile Java and I'm not even defending Java, I used it as an example if we are going to suffer with this Rube Goldberg machine of mediocrity, then we might as well just program in Java, since it has the better tech and their package/import stuff is light years better than any TS or ES script and btw, it looks pretty much just like Java/C# now.
The JS people in charge completely lost the plot and given the nature of the industry, many software devs just started their careers with ES5/6/Typescript and don't even realize how ridiculous this whole thing is.
The problem was the misplaced "need" to make "Javascript" a "serious", best-of-breed ( ugh.. ) language to make big complicated web-apps. Given the premise and the context, of course we end with something like Typescript, which is as boring and mind numbing as Java.
How ironic it is to see the "hip" cool people at the time ending up with a mediocre copycat version of the Java world.. :)
What do you want to do now? I thought setting up projects for beginners is too complicated. Now you expect them to bootstrap production environments. Which one is it?
> I all this complication to show some clicky things on a web browser while inputting some data?
You sound like a person who has no clue about frontend development. I know, because I used to speak the same way before going full-stack. It's not bad to not understand things, but I think it's bad to not understand things and have loud opinions about it.
If you seriously see no reason in using frontend technologies, you are free to pick whatever you like best. But then you act like you are smarter than a whole industry - which I doubt.
> just download some other dudes code
How is that different from using a library?
> package/import stuff is light years better than any TS or ES script
So your critizing the TS module system? I don't know. I don't have issues with that.
It's really hard to follow you as you are constantly topic-hopping. Would really help if you named some examples of why TS is so bad.
I can only tell you from my experience that having one language for frontend and backend reduces the amount of context switches as a dev and leads to a faster feedback cycle. Eventually, adding business value becomes easier and that is what it's all about. Not some weird culture wars about languages.
https://rescript-lang.org/ https://animaomnium.github.io/what-austral-proves/
So for me I guess I’m saying the threshold is lower just because I already feel like I need to keep some diversity in our codebase.
/*
* Function that adds
* @param {number} a One number to add
* @param {number} b Another number to add
* @return {number} The added numbers
*/
function add(a, b) {
return a + b;
}
Ts syntax looks like this: function add(a: number, b: number) {
return a + b;
}
You can use JS doc in TS as well, to document all the values. You just don’t put the types in :)Dupe of https://news.ycombinator.com/item?id=35892250
They're not changing away from TypeScript. They're changing from the TypeScript-style syntax for inline type annotations to the JSDoc-style syntax for type annotations in comments. They're still using TypeScript for type-checking, but now the source code can also run as-is. Dupe at <some URL>