If TypeScript still is a fad at this point, his definition of fad is far lengthier than mine is.
I'm fairly sure TypeScript will remain in popular use longer than whatever project you're working on π
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
If TypeScript still is a fad at this point, his definition of fad is far lengthier than mine is.
I'm fairly sure TypeScript will remain in popular use longer than whatever project you're working on π
CoffeeScript was a fad, but TypeScript seems to gaining more and more popularity these days, with new runtimes like deno supporting them natively. TypeScript finally gave Microsoft relevancy again in webdev world, so I bet they'll go a great length to make sure it stays that way. If Microsoft were still making their own browser engine, I bet they'll make it natively supports TypeScript too.
CoffeeScript was a fad because it didnβt solve anyoneβs problems. It was basically βlook how cool code you can writeβ.
TypeScript is gaining popularity because static typing solves real problems. Itβs also a superset of JavaScript instead of being a completely new language from scratch, which makes it easier for JavaScript devs to learn.
it felt to me like coffeescript solved problems that people had, then js got equivalent features. arguably that could happen to ts as well
A fad? No, definitely not. TypeScript brings features (and structure) that will /should probably make their way into JS.
It's sort of like asking, "does SASS replace CSS" or "is liquid the next HTML?" They're just implementations of features FE developers want in the core spec of JS, CSS, and HTML.
that will /should probably make their way into JS.
Not really, IMHO. The main advantage of TS is that it will help you catch errors without having to run a particular piece of code - i.e. you won't have to move to the third page of some multi-page form to discover a particular bug. In other words, it helps you catch bugs before your code even reaches your browser, so it doesn't bring you much to have them in the browser.
(There is a proposal to allow running TS in the browser, which would be nice, but you'd still run a type checker separately to actually catch the bugs.)
I think the important part is that the syntax will become standardised, rather than being defined by microsoft/typescript, potentially allowing for alternative implementations. It could also make the build step optional in some cases, which is something people dislike about typescript currently.
I think the syntax explicitly won't get standardised - but the places where syntax can be put will be (e.g. after a :
following a variable, before the =
). With, yes, the goal of eliminating the build step, but the type checker (which really is just a linter at this point) would still be able to define their own specific syntax. I don't think it could work any other way either, anyway.
Typescript makes writing Javascript a reasonable thing to do. Your manager is a fad.
Your manager is a fad.
If only...
5 years ago everything was moving to TypeScript. Now everything has moved. Developers are still catching up, but it will be one-way traffic from here.
I'm guessing your manager thinks TypeScript is like CoffeeScript. It is not like CoffeeScript.
Also, TypeScript is only the beginning. In the halls of the tech giants most devs view TypeScript as a sticking plaster until things can be moved to webassembly. It will be a long time until that makes any dent in JS, but it will also be one-way traffic when it does.
No, because raw-dogging JavaScript isn't something grown-up software shops do.
Can't they just use JSDoc?
Imagine changing your file extension from .js to .ts and calling it a fad. JS is TS. The difference is that TS does more (by actually doing stuff before runtime as a static analyzer, similar to eslint). If TS is a fad, then modern web dev is a fad.
Which, to be fair, it is.
When anyone in a professional setting says they don't like having a mega corp supporting something I lose a bit of respect for their opinion tbh.
Yes we all know mega corps suck.
But if you're using anything in a professional production environment that is meant to last in the long term this is 100% what you want.
Hi, I've been doing TypeScript in my day-job and hobbies for six and a bit years now. I would not write JS in any other way.
TS is also a superset of JS so all JS is valid (unless you turn on strict
mode). So there is no productivity loss/learning curve unless you want there to be.
In fact, a lot of people who think they're not using typescript are using it because their editors use typescript definitions for autocomplete and JSDoc type signatures are powered by typescript.
Javascript is a fad, we should all move to WASM. π
But no, TypeScript is not a fad. Unless a better "Typescript like" thing comes out - I know how in frontend land people like to make their own substitute framework that does something slightly different than an existing framework - But I don't really see why anyone would want to make a NewTypeScript, and not just expand existing TypeScript
A language that helps me write Javascript without writing Javascript? Nah, that ain't no fad, that's a grace from whatever god is up there.
Your manager is an idiot.
They already said he is a manager, no need to repeat
The developer of Svelte moved from Typescript to JSDoc and explained in depth in an interview (you can find it on youtube). ECMA (the dudes making Javascript/ECMAscript) also started noticing that maybe static typing would be useful and there's a proposal to add typing to it. Whether that's moving forward or not, no idea, but if it were to come to vanillaJS, it's imaginable that typescript would be much less useful than it is now.
Have you tried slapping your manager?
The only valid argument against typescript is that it is too similar to vanilla JavaScript. It does not go far enough. We need type systems like Ocaml's.
I suppose you can also complain about needing a build step, but I find this silly. There are so many tools that make this easy or automatic.
Personally I'd rather use JSDoc in my own projects for type annotations and call it a day. I find TS a bit annoying but that might be because I'm not that familiar with it.
That's just Typescript with extra steps.
Though I have also done this once or twice for single-file projects where I didn't want to deal with actually running tsc
. It has some annoying downsides though, e.g. you don't get to have a tsconfig.json
and the syntax sucks.
Microsoft had a proposal to allow TS annotations in JavaScript which would have been awesome and fixed the syntax issue.
Looks like it was discussed a year ago and hasn't really made much progress. Seems like lots of people wanting to shoehorn runtime type checking onto it.
Is it? I just have it auto-generate in my IDE with snippets. If I was using TS I would still document using TSDoc anyway. You can use jsconfig.json
instead.
If I was using TS I would still document using TSDoc anyway.
Yeah but you wouldn't put the types there. Putting types in JSDoc is awkward.
You can use jsconfig.json instead.
Unfortunately not. I even went as far as reading the source code for VSCode. There's no way to e.g. set noUncheckedIndexedAccess
.
I'm not a FE guy so don't write it much, but I'd always rather use typescript if I had to use anything like JS. Our FE guys use typescript at my current job and my previous one as well
I don't really get the appeal of strongly typed languages. Can't you just use try/catch blocks, and/or use functional programming and return early if the data structure of whatever you're working with isn't what you expected?
I guess it can help older code easier to maintain because the expected data structure is right there, but you could also just include it in a comment above the function.
I personally find TS slows down initial production of a project and raises so many unnecessary errors.
Is there some huge benefit that I'm missing? Because I don't really get the appeal. I mean, I do on some level, but I don't really understand why so many people are absolutely obsessed with TS.
Canβt you just use try/catch blocks
No, because what if whatever you're calling is updated and suddenly it throws a new exception where before it didn't? Python or JavaScript or other interpreted languages will never warn you about that.
if the data structure of whatever youβre working with isnβt what you expected?
That sounds like a whole lot of boilerplate I have to write to verify every time that something is what I expect. Static typing does that for me much easier and more reliably.
Some languages like Rust have so good type systems that often when a program compiles, it just works. You don't have to run the code to know that it functions if you only make a small change.
What kind of systems have you worked in? In small systems, the static analysis doesn't matter as much, but the benefits become bigger and bigger the more code there is to analyze.
I like typescript because my API can generate types for my FE project.
So, if i change my API, i pull in fresh types and fix the errors, and i get in-ide hints for the shape of payloads, responses and events. Not everything is simple CRUD.
Also, if you pull in a library, having types is a godsend
Interesting argument. I have used both typescript and JavaScript, but I spend 99% of my time writing firmware in C, because of this I LOVE strongly typed languages, and I get kinda annoyed/paranoid when my variable COULD change type quietly so end up doing (perhaps too much) type checks etc.
I can say with surety I hate programming in both Typescript and JavaScript, but I definitely hate Typescript less because of the typing.
Having said that, I don't really like the compiled javascript that comes out of the typescript compiler, because it puts some distance between the user and the code and I am all for clarity, especially when people have to go out of their way to not run this code.
If JavaScript implements type safety then I believe it will go away. If not then it will continue to be used.
TypeScript is the new DOC format.
Create a language/format. Spend all of your effort making it ubiquitous until it becomes the default "standard" in the workplace. Then charge a metric fuck-tonne for the "official" software that makes use of it.
It's how Office became their cash cow. They create the proprietary doc format, get everyone using it, and once it's embedded in the workplace, charge exorbitantly for the software that uses it.
Once they get everyone using TS as a new industry standard, they'll find a way to make people have to pay for it. Mark my words.
I donβt think your manager is sane.
Why on earth would we move back to JavaScript at this point.
Disclosure: I am a TypeScript dev and my boss is fully invested in Microsoft at this point. We use C# .Net and we use Azure and Teams.
He might've watched this video: https://youtu.be/5ChkQKUzDCs
TL;DR: Big projects, like Svelte, Drizzle and Turbo ditched TypeScript