TypeScript Slows You Down - Here’s Why

preview_player
Показать описание
I love TypeScript. I try to use it as little as possible. And that's a good thing. 🙏

#typescript

S/O Ph4seOn3 for the awesome edit 🙏
Рекомендации по теме
Комментарии
Автор

I honestly gauge where I am in my web dev journey based on how much of these little talks I actually understand. Getting better.

queerly__coded
Автор

100% agree. Have tried TS multiple times, been making all those messy types and felt like I don't wanna use it when it blocked me. But then tried Prisma w/ automatic type generation and then I got it. You should treat it like JS with types rather than typical serious (Java) language w/ types. More fun, less seriousness you know

лилпипка
Автор

ooof, the writing with type errors and then fix after got me on a strong no. that scares me :)

ThePrimeTimeagen
Автор

I don't like this purely based on the fact that this is not how you work with other static typing systems.

PaulSebastianM
Автор

Theo: don't block on TypeScript while deploying on Vercel
Me: trying to deploy create-t3-app on Vercel, getting blocked by TypeScript

mariansam_was_taken
Автор

Hey T3, thanks for this video.

I was recently learning TypeScript using a complete Udemy course, and the instructor always uses `tsc` and even doesn't emit files build when there are errors.
He is a great teacher, but I actually writed down your tips from your video in my notes to also take in mind.

Be well.

lucie_gamer_yt
Автор

thank you, this is indeed very helpful for me that recently switch to TS for my projects

m.ridwanriansyah
Автор

paying too much attention on the typechecking and also unnecessarily using return types had slowed me down a lot. When I started getting rid of these, it made it so much faster to move and ironically, felt more typesafe.

beancoffee
Автор

Typescript & live squigglies in your code editor is truly god's gift to earth

JacobSucksAtCode
Автор

Woah I've been having my TS errors block my browser output. So many good tips, this video totally shifted how I'm going to be using TS

zayn
Автор

about the CI thing I recently changed tests to run after the lint step. I used to require typechecks to be done first, but testing is the slowest part of my CI, so I wanna start it as early as possible. I still lint first to make sure the code even has a valid syntax at all, makes no sense to open 3 more CI steps that'll just fail because one file is missing a closing parenthesis. I've previously disabled linting in nextjs builds as well (and moved to yarn install --production, so prettier and the linter aren't even installed in deployments anymore) but wasn't aware you could also disable typechecks. I assume you still need it installed for dependency reasons tho?

Mitsunee_
Автор

While building a social media platform for an app contest, I remember spending almost a day creating a typesafe hook for my api calls, but I was too sleep deprived to realize how unproductive this was

davidzechowy
Автор

Damn, that's such golden advice. Thanks mate!

benfrese
Автор

his eyebrows have a mind of their own, one of the most expressive faces iv seen in a while, good video 10/10

puddle.studios
Автор

FUCK YEA.
I've been coding for an almost 15 years now, started to attend coding classes and contests in an age of 15 and back then I've been exclusively working with a statically-typed languages like C++ and even then I've been dealing with errors after I've laid my initial ideas and logic down. When I was first introduced do dynamic languages like PHP and JS - the ability to test your initial ideas without doing all this boilerplating - this what sold me on those technologies. It doesn't matter if my code is a set of data transformations, or a set of behavioural rules and relationships for entities, an algorithm is an algorithm, I wanna define a set of steps, test that all those steps are in a somewhat right order (sometimes with an unhealthy bunch of console logs, yeah) and move on to optimise and beautify my stuff, because it's very fucking hard (at least for me) to develop an idea further without having a sketch first. And for some twisted reason, it's not a 'normal' way of thinking anymore. People who were working within a dynamic JS environment suddenly are all about almost unhealthy boilerplating and writing a huge bunch of DTOs even before you figured out the business logic of a feature. Yeah, sometimes I wanna start by defining an interface or a data structure, but most of the time I just wanna test that my shit is following the order, defined by business logic and then move on.
It's specially true while building an UI components, where you need to type the props before you can test if this type actually fits because if you don't type it - well, nothing is rendered and you can go fuck yourself.
And people are actually seeing this as an upside. Incredible.
Not gonna lie, I was very sceptical about you and your channel at first, but after watching a couple of videos, specially the 'Is OOP Evil??? Reacting to best YT video' I was very glad that I've finally found a content creator with a strong common sense. Thanks for your content fam, appreciate it very much!

Quimmoo
Автор

I hate typescript. This you described happens to me everyday. I hate typescript.

ThugLifeModafocah
Автор

Agreed that types should be kept as close to the data definition as possible, I generally try to keep my interfaces enclosed in my controllers but I would also disagree slightly that this should be the general pactise, IMO an api directory makes things cleaner and it can be used to only document your APIs and entities and their 'shared' types (not all the types just the ones the API needs).

SayanMondal
Автор

I mostly agree, but want to point out one thing. I would never `fetch() as A`. It's input. I don't care if you just wrote the service and are running it behind a VPN, you need Zod in the middle of it.

`x = fetch() as unknown; Schema.parse(x)`. All set. You can always start with your zod schema being analog to an "any" until you're ready to dial it down.

(Also, to random readers, fetch() returns a response, and you need to call .text() or .json() on it and parse that)

Novagenesis
Автор

I think this is one of your most useful videos ever

YTCrazytieguy
Автор

to be honest I have been tempted to use typescript but never actually tried it cuz of mix reactions from the community at the same time I like to typesafe my functions or variables with comments, never had any issues with maintainability unless I'm working in a company

fnfal
join shbcf.ru