I love using typescript! TypeScript integrates well with React, with the type definitions and other tools which makes it a very good choice for building scalable React applications!
You didn't watch the vid. He wants you to use typescript. The video is about how typescript is usually taught/introduced to people, and how extremely counterintuitive that is. Theo of t3 made a similar video recently. Its an excellent point that all pro type safety webdevs should consider evangelizing.
I love TypeScript, I'm teaching my student TypeScript now. For web development, I prefer TypeScript + SvelteKit instead of React (even I have more than 5 years exp in React).
In my opinion, if you are using a type-checking tool, you are not naming variables correctly. How difficult it is to understand that the variable "people" is an Array and "person" is an object and "firstName" is a string? You can infer the type of a variable by its name (if its properly named). Type-checking is a waste of time and till date I have never understood why people are so adamant on using it.
You putting a fake type on a javascript variable doesn't ensure it won't break omg you people are brainwashed. At runtime it indeed can break and the type can be still changed. Typescript doesn't make Javascript magically unable to change type at will.....
Make a crud app, with react, typescript, integrate it with fire base and go a step further and use redux to persist user login info in local storage. This will look good on your resume and 100% make you stand out from other candidates
@@abdiastar6451 If you do the above it shows your way behind the technology curve and learning obsolete patterns. Redux lol...Persisting that info in local storage is the most unsafe place to do this kind of work and would show the employer you know nothing about security and would compromise a project.This is comical
Typescript is a waste of time. All you streamers pushing this nonsense is a joke. Javascript is a dynamic language and you guys keep trying your best to force it to be compiled eliminating several inherit features. Typescript makes your code hard to read, is convoluted and they keep updating it putting more and more confusing syntax into it so normal javascript looks like a foreign language. The only thing your doing with Typescript is obfuscating source code because your used to a compiled language. Most of you streamers including you just use when you don't know how to type a complex type or object. Its a joke
Exactly. But sadly, just take any documentation for ie Tanstack Query/Tables and everything is written in TS. I aggree with you 100 % and people are making dynamic language like javascript so limited just because the think it has to be. It’s like when somebody found a fixed width and desktop only websites (best viewed in IE at 1024x768) and later discovered “responsivity” while in a fact whole web was responsive since the beginning. I thing TS came for people coming from Java world because they had to specify the types and were nervous they can’t have anything like that in JavaScript, without realizing it’s not needed. Like when somebody is looking for a shift for manual transmission car when driving automatic…
MIcrosoft pushes out money for people to make ads for it I guess. Just like they do with all their other crap software. They want us to use teams, sharepoint and other really bad software.
I'm a strong believer in type safety having programmed in C++ for over 20 years, which is a strongly typed language. It was quite unnerving to learn JavaScript, where variables can flip their type seemingly at will whenever it happens to be convenient. It seemed at first that I was programming in a fun house of mirrors. But I've resisted TypeScript not because it's scary but because my brain is a FIFO of limited size, and cramming too much into it at once will only cause other stuff to fall out the other end. Front end development for me is way too complicated and if it wasn't for Kyle and Kevin I'd still be in the weeds. But they've safely guided me through my first web application which is nearing completion. So I'm finally comfortable enough with JavaScript, HTML, and CSS that, although still not expert, I'm ready for new challenges and TypeScript will definitely be part of that.
The learning curve for web development and C++ is just so different. I feel like C++ is more complicated, but less to learn than web development where you have dozens of languages, frameworks and other tools to learn. This can be overwhelming.
have u tried TS already? sounds like you have a solid foundation of knowledge, you should really try it, at first you I'll feel like you're going a bit slower, after that you'll never look back lol
Interesting how a C++ with 20+ years of experience can find learning front-end unnerving. I always thought C languages (with the exception of C#) were incredibly difficult to learn. On the other hand, I used to love JS for everything as its freedom was unmatched... until I had to work on a medium project of my own with new frameworks I just started to learn, then I understood the "JS is the language that lets you shoot yourself in both feet before telling you that something might be wrong". Pretty sure you'll pick this in no time!
We use it to help cast our responses from a rust backend. Serde sends a specific object, and me have matching types to help determine the response without validation
I like types when they exist in a statically typed language, designed from day 1, not when they are strapped on to dynamic scripting languages like JS and Python. Types in Rust and C++ are fantastic, typescript is garbage.
I don't use typescript on the front-end, only on the back-end. The question I ask is, if you use the typescript just to type the components, why should you use the typescript that brings another compilation process, if there is the PropTypes of Javascript?
typescript is sooooooo useful, at work, we switched over to using typescript for all of our projects. and we have definitely lessened our debugging time. BUT; can you do a crash course on how to use usecontext with typescript.... its complicated.
I have a love/hate relationship with TS, strong typed code makes life easier for large applications but some of JS's power is lost in translation and TS could have a better implementation.
Great video. I was "forced" to learn ts as the project I was contributing to was written in it. I was kinda taken aback to see prop types are like 99% of the use case.
It took just one small project to convince me to never go back to JavaScript. TS drastically cuts the debugging time (depending on the project, of course). But, I think it's understandable, since I do some C# stuff, so maybe I'm just used to static typing. I like when IDE is yelling at me :)
I've kept trying but giving up on typescript because of problems like your firebase issue. Always one or two things that require extremely complex custom type definitions. If one thing doesn't work, you can't complete the project. Would love a tutorial showing how you would approach something like your firebase problem.
There is always a solution without having to abandon TypeScript completely. In the beginning it is extremely annoying to work with TS, but once you get used to the common TS compile errors that you get, you quickly learn how to fix them.
The code may be more verbose, but the main benefit is that you catch errors in compile time rather than runtime. The goal is to make things fail early.
These issues can happen. Check the errors you are getting, and then debug any code related to those issues, if you can’t figure it out, a simple google search would never hurt, if that doesn’t work, then you may be able to ignore types for some lines of code. I wouldn’t recommend this unless there was no other choice, and the code with type issues you have a full understanding of how it works and it has already been tested thoroughly.
Yeah while these guys are trying to figure out the TS syntax and the new FOTM TS changes I would have already shipped and made $$$$. Go tell your boss it takes you longer than most developers because your writing in two languages that helps no one but makes you feel good inside
@@troy5370 I work in an organization which understands the complexity of software engineering which isn't just about shipping fast. Secondly, skilled engineers are not slowed down by TS as you are assuming. Rather, TS helps them.
This is not about what I wanted to hear about TS and haloloyaa, no, this is always what I felt about Typescript and I was feeling a little odd from people that without any thinking just evaluate your ability to code in the FE based on ur knowledge of TS, I remember once I got rejected because one of my side-projects I was showing case its codebase in the interview was written in Vanilla JS. 🤧
Should I unsubscribe because I don’t like the click bait bashing on the Language I love the most… or should I keep watching because at least Kyle’s smiles is worth the time 🎭 I don’t know 🤷🏻♂️ so I guess I will have the answer if I watch…
3 features of TypeScript to know so you can get 95% of the benefits when using it: 1. How to create types 2. How to assign those types to variables or arguments in a function 3. How to create and use generics
I think it's actually cleaner to use generics with document.querySelector instead of casting it as a type. document.querySelector('.whitespace') as HTMLDivElement;
People new to TS like to complain about the extra steps with setup, having to add type annotations to function parameters, but it saves time in the long run. An insane amount of time. TS actually saves tons of time.
I have a Love/Love relationship with TypeScript and I have have been pleased with the Love/Love relationship I have with NodeJS and VsCode I am probably just a rare example of people who is completely in love relationship every one else seems to have been forced into an arranged marriage like an unwanted wedding 💍 I feel lucky to have this passion when I read the comment and read all the horror stories of people who have no choice but to learn TypeScript never stating learning something was so easy… it is obviously 🙄 just because it doesn’t get complicated until you get hooked it is just a terribly complicated language sometimes but it is just so easy to get the basics of it…
well, fun fact i used smartphone to code and manage to create some simple useful website, and a few bots for telegram. i dont use typescript because there is no vs code on smarthpone yet :(
This is indeed true. You don't need to know typescript to be able to use typescript. I just changed all my file extension from .js to .ts. Now I'm using typescript... Now I just need to make my app work again.
This almost seems like writing VBA code with "Option Explicit" turned on. Without it turned on, it could be a nightmare to troubleshoot if there are bugs.
What are your thoughts about the difference between type and interface? Is there any situation when is better to use interface rather than type, thanks!
- interfaces can only define objects - With JavaScript, in OOP, when you want to do inheritance it is not possible to extend more than one class. But with the reserved keyword "implements" in Typescript, we can add several interfaces to a class - Unlike `types` interfaces can be redefined, properties are thus merged This is what comes to me. Sorry if it's not clear, but English is not my native language
Ppl who find TS difficult, learn some basics & just jump right in and start a new project. Don't try to learn everything under the sun before starting a TS proj. You will be overwhelmed & It's really unproductive imo.
I'm java dev. recently I'm trying to do front end staff as well. As my programing background is on strict typed language, ts is relieving language for me
My main problem with typescript is, once you go typescript, you can't use normal non typed javascript library out of the box. You have to do some shenanigan to make it works.
I just started my web development journey less than 3 years ago. I'm sticking to vanilla Javascript + React for the coming years. (With a hint of NextJS, hehe)
Don't. Switching to Typescript is a lot easier than trying to figure out React in plain JS, and it saves you a lot of time writing code. Benefits happens in less than a day.
If you want to do react with typescript, you simply have to know typescript, as you just write javascript in react. A better video request would be like what EXTRA stuff a react developer has to know about typescript, beyond "vanilla typescript".
I’m a big fan of typescript. I use the T3 stack and having types for everything makes things easier in a full-stack app imo. I can’t imagine going back.
Isn't it sad? We'd gone through entire circle from type-strict (Algol/C/whatever) to type-lazy (AWK/Tcl/whatever) to typeless, then type-specified again. I need some Ada code to relax. 😉
Having coded a lot in Pascal, C is only moderately typed to me, but I started with BASIC. So..., that was some crap... Anyway, yeah my journey was cyclic as you say. So when it came time to learn JS, having VS Code was all I needed to not make type errors. Now I am learning typescript so I can read other people's code. Lol.
Great video!!! Thank you so much! I really love Typescript, and specially I love the initial philosophy which it born, helping a lot in development adding type safety... but I believe that Typescript miss the direction in some point! Crazy coded complex types like those that you indicate in the Firebase library is the part that adds unnecessary complexity and, for me, simply adds no value... only more cognitive load in large projects. When I see a type coded like that, having a hard time TRYING to understand what it does (specially when must be fixed because a bug introduced by another developer), is when I love the JS simplicity and readability, and return to code in JS, but using JSDoc (as other user posted) to enforce types. Once again, thank you so much for this video!!
I agree to an extent, but when you're using a library that doesn't have types, it is really really really really annoying. And until you end up having that problem, you really don't have anything to worry about. But I think that you may be underestimating how annoying that is for the beginners. I'm not sure how common it is for others, this happened to me on my first big project, So then I had to learn more typescript all at once.
I'm trying to require an npm module I use, but require has to be installed? After this, the node_module doesn't even work, so what's going on? Does typescript have their own module store? Too complicated for me to learn, when I can try jsdoc comments.
If Typescript Grows React and it's entire cousins Next Js , Vue , Solidjs becomes useless Angular , Typescript ,Nestjs ,Mongodb makes a perfect Typescript Mean Stack
One of the thing that typescript scare me is that its ridiculously hard to understand syntax. I had familiar working with strongly typed languages before like Java or C# or Go but I had never seen like such below ---- interface UseFetchOptions extends AsyncDataOptions, ComputedFetchOptions ---- ☝this is from a fetch library within Nuxt 3 that I have been using recently. By the time I was debugging and try to understand it, I immediately refuse to continue digging after seeing that.
Ngl typescript makes working on projects enjoyable, especially on the FR when frameworks, build tools, ect are constantly changing. Aside, it’s worth it. Imo you won’t see the value of TS until you work with a large codebase on a team, build a real app into production and/or library. It’ll provide you discipline and the compiler will help you catch errors in DEV vs pulling your hair tryna find the simplest error which you noticed at runtime. But first learn JS before learning typescript. It’s now labeled as language but technically it’s just JS with static type checking (a superset of JS), so if you know JS TS won’t be anything crazy. Peace and much love yal. And always keep learning and keep MOVING FORWARD.
Totally not a waste of time, but a must. Modern hire companies hite web develop preferring better knowledge of TS over years you've spent developing in plain JS.
TD;DR; : No, it's not a waste. Any decent codebase that try to follows SOLID principles and have some test automation are easy to migrate. Obviously, if your codebase is filled with "hacks" and is a complete mess, then TS is going to point this out and you're not going to like it.
Not a fan of passing props to a react component and having to use Typescripts verbose syntax, when you're still deciding on exactly what you want/need to pass
Typescript might be great (ONLY) for development of libraries that have public API's, even that there are many ways to do what ts do in that case without using ts. (libraries that have public API's was present far away before the invention of ts) Other than this, typescript is, (in my opinion), a time and resource wasting . JsDoc is fantastic....The code is shorter, more clean and very clear to every one.. No need to learn new modified js syntax.. You just define what you do think it needs to be defined When using JsDoc... even the the beginners can understand the code .. and you will not find the beginners-non-sense code resulted after transpiling typescript to js... You might face the case mentioned here in where your project uses a library that does not support typescript.. then you find your self in a situation where you need to rewrite those types in order to be able to use this library in your project other wise the compiler will start complain instead of compiling .. This is a complete time wasting Also after transpiling ts code to js code .. all that ts disappears .. ts might help coders in some cases but not the final code users Thats why recent shift in the development landscape has seen some developers and teams moving away from TypeScript and towards JavaScript with JSDoc. This shift has been notably championed by the Svelte team, who have decided to migrate from TypeScript to JavaScript in the Svelte 4 codebase. Thats why Learning TypeScript is in fact A Waste Of Time And Thats why JsDoc is fantastic
Too many people get turned off from TypeScript because they get into overly complicated things, or try to make weird types like using utility types like Pick. Just basic types and string unions is enough. The most complex thing you'd need to know is discriminated unions.
next time you making something like this video make sure you code from scratch, no one will learn from something you already have bunch of code without understanding any line that is wasting beginners time
If you are coming from non typed languages like php or plain js, you first have to understand the difference between “hey it works” and “hey it will work long term”.
I have never considered something time I spent learning as a waste of time. If the alternative is some mindless activity such as doom scrolling or binge watching of some daft tv show, how could learning be wasteful? Always be learning, because, why not? It is not going to make you a worse person, I suppose
I also personally don't like typescript, but it's very easy to learn. If you're already familiar with a strictly typed language, you can learn Typescript in a day. So, we should learn it so that it might be helpful in interviews or in companies where they use it 👍
@@andTutin you are assuming they only have prior experience with javascript and ignoring they could have already been using a statically typed language for years. don't be that person
4:20 Does not look like a function that RETURNS a function to me! But it looks like a function that ACCEPTS a function as a parameter. Easier to understand when you read the code below it, and you understand this is also conform how the Promise works. The resolve function is a callback, called by the Promise after finishing an asynchronous operation.