Should You Use TypeScript? 5 Reasons You Shouldn't!

preview_player
Показать описание
There's hundreds of thousands of articles online about what is TypeScript and how to learn TypeScript but I haven't seen that many articles ask the question, Should you use TypeScript?

Like most complex questions the answer is frustratingly easy: it depends.

However I figured I'd delve a little deeper into reasons why you might or might not want to use TypeScript.

Plus I juggle in this video, so I'm pretty sure that makes it a much watch.

0:00 Intro
0:50 It depends!
1:30 Just Learning JavaScript
2:12 Small team
2:51 Faster without TypeScript
3:37 You Don't Want to
4:16 Type safety
4:33 Better Tooling
5:29 Backend engineers
6:13 Good for big teams
7:27 You want to!
7:35 Wrap up

——

Рекомендации по теме
Комментарии
Автор

Unless you're using Angular, which you shouldn't be unless you're an insignificant cog in the wheels of a big tech company that forces you to, TypeScript is an extra layer of complexity you absolutely don't need.

NBGTFO
Автор

The only thing I hate about TypeScript is it brings the illusion of types. You just trust your type definitions so much that you forget to actually check their values. In web development we work with APIs which the types are not certain, any abnormalities or changes to the API could break your code entirely. All the effort making those restrictions is nothing but digging your own grave on top of a lie. Scripting language should be versatile and adaptable, and somehow predict the future, not restricted to those types that you imagined.

ytboipoi
Автор

Generally there is an initial overhead but it pays dividends in no time at all

hugodsa
Автор

I guess it really comes down to personal preference and needs. You can be type-safe with conditional validation. Maybe even the "guard" approach that Elixir has. The bugs that strict types try to solve can also be solved by good tests. If you think about programming improvement as going from more imperative to more declarative and simpler, you probably see value in dynamic typing and more levels of abstraction. Though, if you think programming should be down to its roots in C/C++ with more tooling and complexity, you probably prefer a larger syntax and are more prone to strict types. This reminds me of both "go to" and "pointers" discussions. You can use low-level languages to build systems and high-level languages to build applications.

gustavostnt
Автор

In my team, there are lots of juniors. Forget about TS, getting quality JS with correct test cases itself is a big task. Anyway, I don't like C++.

jayasurian
Автор

Thanks for this! I have always been told that Typescript is fantastic, and while I can see its value, I can't find a real reason to use it. The main type issues I have with JS is getting data from elements that are numbers and having to do parseInt() every time so they won't be treated as a string. Other than that, I've never had an issue with JS

eddyk
Автор

The overhead of added Typescript is paid for in tenfolds when you can spot bugs before they happen, aswell as having autosuggest options available due to the type being known.

alegherix
Автор

I hate it and I love it... It was a struggle for me to get to learn Typescript, but when I'm finding out how to do things right in Typescript it just is very satisfying. And I think I'm going to love it even more. At the moment I still have some personal cli scripts that are still not written in Typescript, that is when I actually miss it!

jornejongsma
Автор

I agree with these points. Typescript's value comes from providing consistency and contracts across a large codebase or team. I've also found it valuable to have contracts when the frontend and backend are managed as separate apps. Personally tho - I'm a fan of types and generally prefer typescript over javascript.

wolfymaster
Автор

My problem with TS is how hard it is to set it up. It is not like using Java, KotLin or C# where everything is there out of the box... Between the config files, npm(whatever) libs and vscode complaining about things that are right and in accordance to documentation, just because you screwed up somewhere in a configuration is a pain in the butt. Python does "typing" right with type hints. You get the same value you get in TypeScript and you do not have to setup jack shit. That being said I much prefer when I arrive at some company project which has TypeScript all set up and ready to go.

franciscokloganb
Автор

"TypeScript will slow you down" is the argument I hear everywhere and can understand the least. When using JavaScript, I spend so much time on looking up API response types and figuring out the value of a variable after chaining many ".map" and ".filter" operations. The main benefit of TypeScript for me is development speed.

rhatalos
Автор

3:08 this is for NOOBS who dont know Typescript When you Know Typescript It is Faster It save time by it prevents silly mistakes when you are on a deadline or you want to ship faster. It save me many times can't tell you But When i was a noob in Typescript it kills me but now it helps me.

alinawaz
Автор

You should use Typescript, ex. If you are putting types in code you are still using TS because of type inference, and for beginners just add any for now, and later on when you progress come back put Exact type, refactoring is much better in TS than JS, so yea use TS 😁. Harry could you make a video about unit testing components in React/Next TS?

stefanbogdanovic
Автор

Using typescript on a project you considered to be mostly bug-free is a shocking, and satisfying experience after fixing it.

slob
Автор

If developers would just type their JSDoc comments, including documenting types, then plain JavaScript is perfectly fine in my opinion, also for large scale projects. And yes, IDEs such as vsCode do pick that up. But in practice I found that it’s hard to convince developers to consistently type JSDoc. Oh well then let them use their beloved TypeScript, tinker around with WebPack, and make everything way more complex than necessary just to avoid having to type proper documentation. ;)

rchin
Автор

If you’re just learning programming don’t use either. Javascript is too easy to mess up. I also really think when you’re starting out it’s best to use statically typed languages.

jabthejewboy
Автор

which one slows down:
1. func(name: string) ...
2. func(name) if(typeof name ...)

sasg
Автор

The only point I agree with on not using it is if you're just learning javascript. Moving fast or playing loose just because you're on a small team is pretty ridiculous.

Thorax
Автор

I don't know why people support Over-hyped topics like Typescript and they enjoy to use them without any good reason without asking the question of "Does Typescript really adds value to my project or just overcomplicate things?"

amirnoorani
Автор

Here's my beef with TypeScript - whenever I use a 3rd party JS library the documentation is generally in JS. Now to integrate it with something like Angular that uses TS I have to first convert that into TS. Convert every single thing from JS to TS.

geomukkath