TypeScript Makes You A Faster Developer

  Рет қаралды 70,775

Web Dev Simplified

Web Dev Simplified

Күн бұрын

TypeScript is amazing. It makes you much more confident your code is correct and will almost always result in less bugs, but there is one big downside. It is slow to write. Or at least that is what people say. In reality I find writing TypeScript code is much quicker because of a few reasons covered in this video.
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Introduction
00:50 - Why JS is slow to write
03:03 - TS autocomplete makes you faster
05:34 - TS in a large project
07:19 - Common TS complaints
#JSvsTS #WDS #TypeScript

Пікірлер: 217
@merodeadorNocturno
@merodeadorNocturno Жыл бұрын
Also, having experience with typescript's static typing helps you a lot when you go to other languages, such as Go or Rust.
@developer_hadi
@developer_hadi Жыл бұрын
That's cool, thanks
@kiranojha8811
@kiranojha8811 Жыл бұрын
yep especially kotlin
@aufarijaal
@aufarijaal Жыл бұрын
typescript helped me about understanding Generic in java and C#
@ichigoplayss376
@ichigoplayss376 Жыл бұрын
agree with you sir... I tried Go and its like I'm working with TS.
@thalibmuhammad9519
@thalibmuhammad9519 Жыл бұрын
true!
@mikemjlove4988
@mikemjlove4988 Жыл бұрын
I've forever stayed away from typescript and not because I don't love writing type safe coding but because I just never felt the need to replace the plain old JS which works perfectly fine in most cases. However last year, I'd a chance to work on a Sveltekit project where I chose to use Typescript and boy does it help. It not only speed up the development time but also helps to debug more clearly and confidently build for production ready apps. Now I'm translating my old node js project to Typescript and seriously I see no reason to ever go back to JS.
@Reaper_f30
@Reaper_f30 Жыл бұрын
companies using JS are moving to TS man, future
@ldsmike88
@ldsmike88 Жыл бұрын
I had the same feeling until I had to learn it for a job interview and now I also really enjoy it.
@RodrigoDAgostino
@RodrigoDAgostino Жыл бұрын
I’m on the same boat, and I guess most people who give TS a try end up reaching to the same conclusion :)
@thalibmuhammad9519
@thalibmuhammad9519 Жыл бұрын
hi, i work in startup close to IPO, i glad i used trypescript if solo project and just get started, you probably wont needed it yet
@Reaper_f30
@Reaper_f30 Жыл бұрын
I'm with thalib on this one. Im about to move from a well sized decades established company to a start upish company. And they build there V1 in react JS. Should deffo be using TS I will make them JS is for learning purposes POCs and fun
@ImaDoofus
@ImaDoofus Жыл бұрын
I just started learning typescript and you released this video at the perfect time, thanks!
@Ricardoromero4444
@Ricardoromero4444 Жыл бұрын
We need the new tutorials to come with typescript by default
@yourDecisi0n
@yourDecisi0n Жыл бұрын
What I also love about TypeScript and any stricter language, is that you are sure on what the function is receiving and returning. This is basically the best documentation you can get, without even writing a documentation. However, I wish they would add a throws keyword like in Java, where you can or have to declare all Errors thrown inside the function, making it much clearer how to handle errors for that specific function without the need of further documentation
@tyr_it6323
@tyr_it6323 Жыл бұрын
With TypeScript your are not 100% sure what a function is receiving amd returning in runtime
@yourDecisi0n
@yourDecisi0n Жыл бұрын
@@tyr_it6323 No, you are not sure of that, that's true, but you as a programmer are sure on what to expect when using the function. However, it is your job as a programmer to input the right type of parameters into the function and that is what TypeScript makes sure of and with that, if the function is programmed correctly, it should all work fine
@picklenickil
@picklenickil Жыл бұрын
Only if one can write better code
@tyr_it6323
@tyr_it6323 Жыл бұрын
@@yourDecisi0n Yea true thats the job of an dev. But this is a widespread false assumption thats TypeScript is "real" type safe. I'm not the biggest fan of TS but everyone should use the tools he/she likes and can build projects. I'm a big fan of JSdoc that gives me types and descriptions in the IDE and i don't need more. I think that TypeScript has no good benefits against JS. But I'm always happy to learn so if me any one will prove me wronge. I'm here to listen
@tyr_it6323
@tyr_it6323 Жыл бұрын
And JSdocs have a @throw for erros
@winken2666
@winken2666 Жыл бұрын
I in particular like that you need to specify what your objects look like with types/interfaces. After doing that, you will get autocompletion which just helps. And it also makes you avoid null pointers.
@ianwright5919
@ianwright5919 Жыл бұрын
Well put together video, and the only one I've seen from yourself, but it might be good to cover some downsides in an impartial way if you haven't already. Every technology has its pros and cons, Typescript included 🙂 I can think of a number of occasions where Typescript has cost many hours of time that works have been unnecessary in pure JS. Possibly that time has been compensated for due to reduced bugs, it's hard to know. Issues I've hit: - TypeScript compiler is really slow which costs hours of time waiting locally & in CI - Types being wrong 😢 - Conflicting type definitions - Transpiler bugs - Nested generics & error messages (common with libraries) can get really complex vs just reading docs - Some libraries omit docs thinking types are enough (often not the case)
@Xe054
@Xe054 Жыл бұрын
The TS compiler being slow is a problem I've been hearing more about lately and will be more common as TypeScript adoption increases. Full-stack type safety is gaining popularity and people are discovering that the TS server is a bottleneck in certain situations. I also think TypeScript is tricky to work with in React, especially if you're a beginner. Smart people are working on some of the type inconsistencies in React (useRef for example). I hope many of the pain points get addressed soon.
@BappyTechTips
@BappyTechTips Жыл бұрын
Great tips to start exploring typescript.
@theisoj
@theisoj Жыл бұрын
Thanks Kyle! 👍
@soniablanche5672
@soniablanche5672 Жыл бұрын
You can also get autocompletion with jsdoc, if you have a small project and don't want to use typescript but want to profit from the typescript engine you can use jsdocs instead. you can even generate type files (.d.ts) from a js file that has jsdoc with typescript
@cwinter90
@cwinter90 Жыл бұрын
Nullish coalescing is the double ?? The ?. Is optional chaining.
@buttofthejoke
@buttofthejoke Жыл бұрын
I love that I can rename a property, and it automatically updates everywhere that's referenced.. ❤ thanks to typescript.
@kkdpsudpsu
@kkdpsudpsu Жыл бұрын
yea its because of code editor but if it was for javascript we wud not need to write any interfaces or types or anything which wud in turn then not raise this. so i wud say its both
@DarrenJohn10X
@DarrenJohn10X Жыл бұрын
Kyle you just convinced me to reconsider TypeScript as beneficial. I had no idea there was that level of flexibility, I thought it had to be more rigid and universally applied.
@alexanderkomanov4151
@alexanderkomanov4151 Жыл бұрын
Thanks!
@chbrules
@chbrules Жыл бұрын
I started programming with C++ on the Half-Life SDK back in high school (yes, I'm old). I know very well the benefits of a strongly typed language, or just static typing in general. TypeScript is obvious to me, and I would go so far as to suggest ECMAScript become a statically typed language in further iterations. I'm learning to use TypeScript right now, and it's very intuitive. Of all companies, Microsoft pushed for this, and I have to give the devil his due.
@ohuela
@ohuela Жыл бұрын
Yeah I agree, but TypeScript is not a strongly typed language. Also, static typing would be kinda hard to implement since JavaScript has to remain compatible with already existing code (maybe they would solve it with something like 'use strict').
@arjix8738
@arjix8738 Жыл бұрын
Use rust, it is more strict than TS and is a compiled language
Жыл бұрын
Congrats on your new home!
@userasd360
@userasd360 Жыл бұрын
Can you make a video on how to manage concurrent requests and limit number of requests and wait until the previous request is complete then start the next request.
@Milky____
@Milky____ Жыл бұрын
I been avoiding TypeScript then seen that made this video when I decide to take it srsly, amazing timing lol!
@yuunk7
@yuunk7 Жыл бұрын
You should make a video about how to use d.ts in TypeScript
@lucaschan-uh5ji
@lucaschan-uh5ji Жыл бұрын
I think it TS helps a lot when u are new to the project, or it's been awhile since u code on that project, seriously how would I know what properties does this object has after few months of not coding, I have to dig through all the code to find out, that's slowing me down, TS also helps with refactoring code, especially renaming property names, it just give u the confidence that the app will run
@ZiaCodes
@ZiaCodes Жыл бұрын
👋 Hey Kyle, Do you know how to make some props optional in TypeScript? For Example, if I have an error prop, and I want to enable or make it required when I have another prop, it should give an error I haven't passed it else, not an error? I strongly need this mechanism... P.S. I am a newbie in Typescript, but very strong in ReactJS..
@wahoobeans
@wahoobeans Жыл бұрын
?
@ethioapps836
@ethioapps836 Жыл бұрын
thanks brother
@duchailu
@duchailu Жыл бұрын
hmmmm, i was wondering if i should give it a try, i've been on my journey to become a web dev for 1 year now, and i'm using react / next / tailwind css with firebase pretty efficiently, i think i will try typescript for my next project and make a ticket management to add to my portfolio :D
@internetexplorer7880
@internetexplorer7880 Жыл бұрын
Go for it, basic typescript logic is enough for most of what you'll create
@codewithpatrick2889
@codewithpatrick2889 Жыл бұрын
3:48 optional chaining not nullish coalescing. A good way to remember the difference is chaining always refers to objects and the dot syntax. Just like .then() chaining.
@yoanbello6891
@yoanbello6891 Жыл бұрын
Would you do a full stack app with Nextjs, Prisma and Trpc. Thanks
@TsoiIzAlive
@TsoiIzAlive Жыл бұрын
Very usefull tipps for TS
@7heMech
@7heMech Жыл бұрын
It looks awesome.
@iuritorres
@iuritorres Жыл бұрын
may i migrate for typescript so?
@Kiwionair
@Kiwionair Жыл бұрын
Hey really cool Video! im currently learning angular and typescript(im a beginner coder just finished learning js) and i question myself for what case i should use the "?" like in your button?.addEventlistener codeline. Like if i want to reference to a button i know that it exist right? In which case it should not exist? Why should i ever say that something can be null if i never want to code something that can be null? This concept is a bit confusing to me. Also why should u use queryselector instead of using id + document.getElementById since a page/application will most likely have more then 1 button( i think queryselector just pick the first element, dont know if im right)
@marzeqpog
@marzeqpog Жыл бұрын
well your website can be tampered with in devtools and the button can be deleted by a user or an extension (like an adblocker for example), so you never truly know if it's there
@EpicGamer3736
@EpicGamer3736 Жыл бұрын
Using the getElementById is better but either way using the ?. optional is important because the element id may not be in the app. You may have forgot to add it or renamed it but not updated the selector which would cause errors. His example was just something trivial to show the benefit of typescript. It encourages strict checking which is essential for covering your butt on larger projects.
@AutisticThinker
@AutisticThinker Жыл бұрын
Huge TS fan here... You should try co-pilot, it's crazy good (often).
@relaxsongwithjeff1263
@relaxsongwithjeff1263 Жыл бұрын
Can i use javascript to connect to a localhost database using Wampserver?
@Z_O_N_Y
@Z_O_N_Y Жыл бұрын
at 3:49 is that nullish coalescing or optional chaining ?
@pepperdayjackpac4521
@pepperdayjackpac4521 Жыл бұрын
I think that’s the latter
@marzeqpog
@marzeqpog Жыл бұрын
its optional chaining. nullish coalescing would be ?? so imagine we have a variable called x and it can be a number of null, and x ?? 0 would mean that if its null, change it to zero (i like to think of it as a default value)
@thedillydotcom
@thedillydotcom Жыл бұрын
My experience with typescript slowing me down has been in dealing with libraries and cumbersome verbose typescript stack traces, but i guess those simple cases bother people too. That’s not been my issues though.
@kevinandeleven
@kevinandeleven Жыл бұрын
Exactly I use TS even in the most miniscule of projects
@jasonleelawlight
@jasonleelawlight Жыл бұрын
This is a very good video, actually I use typescript almost only in scenarios you covered. My biggest problem with TS is that people tend to abuse it, i.e. they think TS is a good thing and thus try to use it everywhere, and that just causes more problems than good. Most of the times you should rely on TS’ inference feature instead of hand coding the types on every line of the code. Adding types is only helpful in scenarios like passing args to a function as there is a context switching and thus is usually more prone to type errors. In other scenarios the types should be self-evident, and thus adding types notations is just unnecessary work and creating visual noise. So in these cases if you have to rely on types it means you probably have bad code and you should try to fix the code itself.
@Ericsicons
@Ericsicons Жыл бұрын
typescript is an invaluable tool when it comes to major refactors, I just had to delete half of a code base and as soon as typescript was happy everything just worked out the box
@bass-tones
@bass-tones Жыл бұрын
Yep. As long as you keep TypeScript in strict mode and minimize usage of type assertions and null forgiving operators and explicit any and other such things that bypass the type system, you basically can fearlessly refactor anything. This is TS’s major strength. Refactors that are stupid easy in TS can be virtually impossible if your codebase is just JS.
@sjoerdvermeijden
@sjoerdvermeijden Жыл бұрын
The problem with TypeScript is the amount of errors i'm getting that i'm not understanding. With JavaScript it's fairly easy to debug an error. With TypeScript i don't have a clue what is wrong. I feel like the learning curve with TypeScript is higher than anything i've done before.
@nabinsaud4688
@nabinsaud4688 Жыл бұрын
Can you put the code where you are showing this repo i wanna read this whole code
@yoanbello6891
@yoanbello6891 Жыл бұрын
Great video. Why you dont use Nextjs. Thanks
@logicmonster6197
@logicmonster6197 Жыл бұрын
watching his folders, while i barely have public and src folders in projects. im crying
@vitaliiivanov9514
@vitaliiivanov9514 Жыл бұрын
Totally agree, always prefer to use TS over JS when possible
@PieterWigboldus
@PieterWigboldus 8 ай бұрын
I see a lot of Typescript developers do Type Driven Development I do Test Driven Development It is about to think first about the input and output. You can do it with tests but also with the types. Writing first code and then tests or types will result in bad code. It is a mindset, not specific Typescript. (Type Driven Development can also with JSDoc with type check with Eslint)
@shoyur
@shoyur Жыл бұрын
this would deserve a heroic viking song meme for the typescript galaxy
@shoyur
@shoyur Жыл бұрын
i also think that blinking only your left eye makes you save time, hahahah, love you
@japeter89
@japeter89 Жыл бұрын
I noticed this too. He doesn't normally do this so must have been bothering him. He has been sick a lot lately. Maybe related?
@robertbutcher222
@robertbutcher222 Жыл бұрын
I’m using JavaScript in a .js file. I haven’t used typescript, .ts, or .jsx file. At first I was getting null values all the time. I did read about the “?” and it worked in some possibly null places. It bothered me, and I wasn’t even seeing this problem in tutorials teaching JavaScript. I did find a setting that I turned off that fixed it for me. My question though is, why was I reviving this error if I wasn’t using typescript?
@kgaming7599
@kgaming7599 10 ай бұрын
Because according to spec, you can't call a null or undefined value. You should give us some examples of your code so we can help you more 😊
@popalopagos
@popalopagos Жыл бұрын
The main reason to learn TypeScript is that you wont get a job if you don't learn it. The more you tell everyone how much you love it the more likely you are to make money.
@EhteshamShahzad
@EhteshamShahzad Жыл бұрын
lol
@deveren
@deveren Жыл бұрын
xdd
@developer_hadi
@developer_hadi Жыл бұрын
Really? Ok but I'm working with mern stack, I should learn typescript, then learn typescript for react, then learn typescript for backend, that's a LOT
@SirXtC
@SirXtC Жыл бұрын
that's not correct.
@ldsmike88
@ldsmike88 Жыл бұрын
​@@developer_hadi node and react are both JavaScript. If you learn TypeScript you can apply it on both places simultaneously. You don't learn to tie your right shoe then start over learning how to tie your left shoe.
@rajiang5935
@rajiang5935 Жыл бұрын
That anonymous function to check input types is so related, I do it all the time coz I can't remember their name. And you shouldn't have to when using typescript, just copy and get everything from the editor, be more specific about your code.
@sathyamv
@sathyamv Жыл бұрын
Hey, Kyle. Is there any course made by you on Angular...?
@chinmayghule8272
@chinmayghule8272 Жыл бұрын
Excellent video. Please create more React in-depth videos for beginner to intermediate devs.
@Apoplexy18
@Apoplexy18 Жыл бұрын
Sorry but I'm going crazy with typescript at the moment. Trough some es lint to the mix and use the basic recommended things and suddenly you are fighting with so many errors that are coming from libs because all using different es lint implementations for their types. Some do undefined or null. What grinds my gears the most is that I now i have a value in an object but still getting errors event with checking for type safty.
@devperatetechno8151
@devperatetechno8151 Жыл бұрын
hey kyle any thoughts on posting a TS in 30 mins course? would be great, greetings crack
@emillarsson6078
@emillarsson6078 Жыл бұрын
Is there any way to contact you for a question? :)
@gosnooky
@gosnooky Жыл бұрын
Define what must be defined, infer what can be inferred, and prune bugs which could have been type-checked. 🐸
@ToddsDiscGolf
@ToddsDiscGolf Жыл бұрын
I’ve been holding out learning TS because I’ve only been studying software development for 2 years and it’s never seemed like a priority. I’ve focused on HTML CSS JavaScript Python Flask React SQL etc and I feel like I should really lock those down before I move on to something that can almost be considered “redundant”…I’ll get to it, though…someday
@warrior1151
@warrior1151 Жыл бұрын
It's time to the join the TypeScript side of the force. Declare those numbers and your journey towards the TypeScript side will be complete
@wolframzell6162
@wolframzell6162 Жыл бұрын
Complaining that you have to create your types is like complaining that you have to plan bevore coding. If you have planned your app, you already have written somewhere which variables you have, what data structures you send febe, so there is very little overhead.
@mohammedfaheem7391
@mohammedfaheem7391 Жыл бұрын
Please come with Angular
@svetoslavtrifonov6431
@svetoslavtrifonov6431 Жыл бұрын
things get slower when you are newish to typescript and you have type error... I am on my first typescript project and when on react I try to place onCLick on a div, just for example... I just gave up on that and use ignore :). But in general typescript is way better even only for autocomplete.
@ai-4850
@ai-4850 Жыл бұрын
Bro can u please post a mini portfolio project in MERN 😊
@null_spacex
@null_spacex Жыл бұрын
Every night I pray to the Gods that I will never have to work without TS again.
@gm770
@gm770 Жыл бұрын
hmmm, let me add a new language that needs to be compiled into JS (adds time), to overcome VS Code short comings. Type safety is over rated for something like JS. All you need to do is expect certain types. If it's an HTML attribute, you expect a string. If it's your own variable, you expect undefined or null. It's not that hard. I often use null or 0 to have the same meaning, so it can be useful to know when something is not as you expected. Real type safe languages provide an "actual performance boost" for using them. Take Assembly Script, which is similar to TypeScript, but designed to make WASM files. If you go this route, you get a 30%+ performance boost for using static types. Want more speed, there are other type safe languages like Rust. Plain old TypeScript is only semantic.
@StefanoV827
@StefanoV827 Жыл бұрын
The reasons I still don't use typescript are: 1. Sometimes libraries has no support for typescript (nodejs) and i can't find a clear guide where they explain how to create on my own for that library. I mean, there are... But they just explain how to place "any" everywhere or they just say "write this to make it works" ...i want to understand what i do! 2. Can't find a resource where i can learn typescript with RTK, RTKQuery, React hooks forms and redux saga. Every guide has just plain functional component with basic types ... As soon as i will learn how to do that, i will switch to typescript for sure
@valen8560
@valen8560 Жыл бұрын
1. .d.ts exists for that purpose
@StefanoV827
@StefanoV827 Жыл бұрын
@@valen8560 yes, but since i can't find a good course to follow about it, i don't know what is it 😂 i just know it's for types because i read some post on medium, but i don't know what to write inside
@StefanoV827
@StefanoV827 Жыл бұрын
@toast every programming language has its own documentation...
@yourDecisi0n
@yourDecisi0n Жыл бұрын
@@StefanoV827 You basically just describe the functions or properties of that library by using types. Say, you got a class inside a library and you would then define the class and all it's properties and methods along with their expected types. You only define the types, not the values. See it, like it is an interface, basically
@StefanoV827
@StefanoV827 Жыл бұрын
@@yourDecisi0n oh like an interface! That's more clear, thank you!
@itgiants5218
@itgiants5218 Жыл бұрын
The time you're going to spend defining types and stuff like this will take more time than Normal JavaScript, but .... the time you will spend when falling into bugs and spending hours to solve them is going to be saved by TypeScript. TypeScript wins.
@nilesh3931
@nilesh3931 Жыл бұрын
Love from India
@YouTubePL666
@YouTubePL666 Жыл бұрын
yes you need to compensate for all the boilerplate you need to write, so you need to be faster... a real hell is mixed app that you need migrate to ts - that thing has special place in hell
@monterulez6429
@monterulez6429 11 ай бұрын
I can have the same behavior while using JS and JSDoc. Plus, I do not need to compile the code. Collegue of me always try to convince me to use TypeScript, but I (personally) see no reason to „change“.
@kgaming7599
@kgaming7599 10 ай бұрын
JSDoc takes longer to write, adds more lines, and is more messy.
@itsmaxim01
@itsmaxim01 Жыл бұрын
please use semicolons tho. Either by putting them manually or using alt-shift-f.
@Unifono2012
@Unifono2012 Жыл бұрын
I can’t see any reasonable reason to use js instead of ts
@nomadshiba
@nomadshiba Жыл бұрын
even with small stuff like i m writing small browser extensions for myself typescript helps because i dont need to go check what code does what tbh at this point why would you even use js without ts in 2023
@kaas99
@kaas99 Жыл бұрын
TS is a blessing
@michaelkurzewski2937
@michaelkurzewski2937 Жыл бұрын
you know whats slower? creating app in JS and theeeen move to TS because you decide halfway that you lack type safety.
@flowerofash4439
@flowerofash4439 Жыл бұрын
the fact that you didn't mention anything about the compiler
@codesymphony
@codesymphony Жыл бұрын
what about it
@tharunrajoptimus5229
@tharunrajoptimus5229 Жыл бұрын
All fun and great until you try to compile a service worker written in TypeScript to be in the root after compilation.
@maplestoryinchinese
@maplestoryinchinese Жыл бұрын
I'm afraid to start learning typescript
@Odidi_Bee6ix
@Odidi_Bee6ix Жыл бұрын
Since most employers know typescript help detect faults in code . Most employers will want there employees to know it
@clairelist1060
@clairelist1060 Жыл бұрын
Autcomplete isn't a good feature because it allows people to write code when they do not understand the fundamentals of what they are doing. Then when things break they won't know how to fix it.
@otis3744
@otis3744 Жыл бұрын
you can either write types or spend 3 days debugging them
@itsmaxim01
@itsmaxim01 Жыл бұрын
you could just use JSDoc types.
@hackerzol
@hackerzol Жыл бұрын
I don't use auto-complete or vscode so this video is lost on me :(
@keenoogodlike
@keenoogodlike Жыл бұрын
Write More or Fix Bugs More
@Thel-foo
@Thel-foo 7 ай бұрын
Coming from Swift this is a million times more readable
@Kiev-en-3-jours
@Kiev-en-3-jours Жыл бұрын
I don't even use auto complete. Auto complete annoys me. And honestly I really don't care how fast I am typing. I don't think coding is about typing fast. Actually I think typing fast is a way to produce bad code. Typing is what? 10% of coding? 20% max. Most of the work is done in your head. Also, the fact TS is adding that "?" to check if that button exists or not is just not acceptable. If I need to check for something I can do it myself. And if it does not need to be check then I don't want it to be checked. So.. still not convinced. All I see is TS could save me from errors that almost never happens. Type errors? Once a month? Fixed in a few seconds. Variables names error? Makes me waste 2 minutes a week? I love types, in Kotlin for example, but I love simplicity a lot more. I will use types when JS will implement them natively.
@pakoottox262
@pakoottox262 Жыл бұрын
Don't be lazy, learn TS. If you are so good at coding it will be a matter of minutes. The internet needs clean code for every single programmer have to work on your projects in the future, it is called respect!
@tyr_it6323
@tyr_it6323 Жыл бұрын
@@pakoottox262 Ok Wtf what have TS to do with Clean Code? Clean code concepts are mostly overcomplicating your code. Write readable code and that can be achieved with every language, use self explaining and "good" variable, function, file and class names. Don't nest your loops and conditions to much (early return) . and don't overload your functions
@tyr_it6323
@tyr_it6323 Жыл бұрын
I'm with you TS is too over hyped. The "?" is JS optional changing xD Yea TS is saving you from errors that normally happening when the programmer doesn't know how JS works. And I think not every error should be handled . I really would like to know if my DOM hasn't that button loaded yet, that i can identify why that happens. and try/catch exists xD
@pakoottox262
@pakoottox262 Жыл бұрын
@@tyr_it6323 sometimes you have to consider that in a dev team there are not only senior developers, of course if you work in big projects, maybe it is not your case. Typescript force you to write standardized code in some aspects and help less skilled developers to read your code. That's why I am talking about respect. Just one question, why almost all other programming languages use types?
@pakoottox262
@pakoottox262 Жыл бұрын
@@tyr_it6323 I bet you have never worked in big projects!
@subramanie5399
@subramanie5399 Жыл бұрын
Web Dev Simplified: TypeScript Makes You A Faster Developer Also Web Dev Simplified: Is Learning TypeScript A Waste Of Time?
@Reaper_f30
@Reaper_f30 Жыл бұрын
when it comes to coding for work, TS faaaaar exceeds JS, do you want silly errors in prod, do you not want readable, scalable and maintainable code at work,.
@jenstornell
@jenstornell Жыл бұрын
Save time, write "any" everywhere. 😅😉
@VEOdev
@VEOdev Жыл бұрын
I've been working with C# for years, when I tried web development for the first time, JavaScript felt so weird and felt like it is a mess that leads to many bugs and mistakes that you will spend hours finding why, but anyway as experience developer it didn't cause me problems maybe because I already learned to not make mistakes with C# since it is not dynamic type language .. for people like me, TS is a good solution, but still it I would recommend it for beginners, but for advance devs for me at least I don't see the need.
@EpicGamer3736
@EpicGamer3736 Жыл бұрын
I think typescript really shines when you are workig on a team of people and just larger projects in general. Working with a team means alot of code is not written by you so you need some way to keep track of what values are being passed around or are expected etc. On larger projects you plan to maintain or release to the public it makes ease of use and mantainability easier sort of acting like a very simple docs
@princeofexcess
@princeofexcess Жыл бұрын
i dont even write my own functions i write code first then extract the function so i get types for free.
@picklenickil
@picklenickil Жыл бұрын
Finally realized?
@Mohammed-019
@Mohammed-019 Жыл бұрын
Create a video about GPT-4. I believe this bot has the potential to replace many jobs as it is claimed to be 500 times better than GPT-3. Tonight, there is a live show demonstrating the power of GPT-4. They are going to create a website on paper and send it to GPT-4, which will turn it into code. I think this is really cool😢
@tyr_it6323
@tyr_it6323 Жыл бұрын
Ok its funny he gaves Typescript the point with the faster autocomplete, for sure typescript has a nice LS/LSP and thats makes typescript usable. But the example shows that VScode is a Code editor not an IDE. With WebStorm, Phpstorm and other full IDEs this problem doesn't exist. My way to go is normally when i need typesafty and i mean runtime typesafty then i use not typescript or JavaScript but if i want a easier workflow in my js projects i use JSdocs. JSdocs can be used out of the box with the most IDEs and you can generate a Documantion out of it. TypeScript is a nice language but i think its overhyped
@tyr_it6323
@tyr_it6323 Жыл бұрын
@@maelstrom57 @template can be used for generics
@tyr_it6323
@tyr_it6323 Жыл бұрын
@@maelstrom57 with the this param i don't get it, "this" is from JS. What have that to do with "this"
@zombiefacesupreme
@zombiefacesupreme Жыл бұрын
Someone told me that the exclamation mark was a code smell, but there are situations where a null check is completely unnecessary. Edit: I'm wrong. It's a code smell. Do your null checks. Be safe. It takes two seconds.
@adambickford8720
@adambickford8720 Жыл бұрын
It can usually be avoided with a better design; do you have an example?
@zombiefacesupreme
@zombiefacesupreme Жыл бұрын
@@adambickford8720 the video's example of a querySelector defined on the same page as the mark up. How would that EVER be null?
@MrDvdxPL
@MrDvdxPL Жыл бұрын
@@zombiefacesupreme Docs: An Element object representing the first element in the document that matches the specified set of CSS selectors, or null is returned if there are no matches.
@adambickford8720
@adambickford8720 Жыл бұрын
@@zombiefacesupreme Any type-system is 'unsafe' at the edges, like interfacing w/the dom in this case. On the backend things like json/xml/etc have the same issues until they're bound/validated in the type system. This is expected and normal, often in its own layer. I think the 'code smell' comment is when you have ambiguous nullability in code besides where it touches the 'outside' world. If its code that only ever touches apis you control, coercing nullability shouldn't be a thing. That's probably *is* a code smell.
@zombiefacesupreme
@zombiefacesupreme Жыл бұрын
@@adambickford8720 I just looked through my largest code base, and every place where I use it could technically be null in an imperfect world. I work alone, so I know exactly what my code base looks like most of the time, but each place where I found myself using the exclamation mark could definitely be null after I thought about it for a moment. The main culprits for me using it were environment variables and laziness. I admit defeat. The exclamation mark is a code smell.
@whatnothin1401
@whatnothin1401 Жыл бұрын
You are a great developer and teacher but please stop putting controversial titles on videos
@haliszekeriyaozkok4851
@haliszekeriyaozkok4851 Жыл бұрын
Typescript is too slow relative to javascript. also it's a misery to find out what html tag is belong to what type many times especially when you wrote react or next.js with it. I know it's fundamentals very well but i don't like it and i never write it if i don't must it for work on a job. I understand why they want to define a type from us to strings, booleans, numbers, objects etc but in html tags or other things is very annoying to find out and also typescript docs are awful to describe that things.
@harrisonmunguambe8164
@harrisonmunguambe8164 Жыл бұрын
The first viewer 😂
@0xtz_
@0xtz_ Жыл бұрын
When u go Ts u never go back 😂
@pelumiodus5979
@pelumiodus5979 Жыл бұрын
I’m going to have to read more about adding an exclamation to remove the null because I’m sure as hell my team lead might not approve of that pattern
@ContraHacker1337
@ContraHacker1337 Жыл бұрын
Or you can just define everything as any. I tigered the entire TS community. :p
@youmee8956
@youmee8956 Жыл бұрын
The bad side of Typescript is when you know it you start to hate JavaScript 🙄
@dinoscheidt
@dinoscheidt Жыл бұрын
TypeScript & Testing makes you a faster developer. To ship a real product. Two months down the line you will be much faster compared to your crappy untyped and untested javascript code.
@brett7y7
@brett7y7 Жыл бұрын
Not using typescript is like typing English with spell check, grammar check, and auto complete disabled. That's definitely slower. Learn typescript and you'll have powerful tools at your disposal to help you make programs quicker.
React Query Makes Writing React Code 200% Better
13:54
Web Dev Simplified
Рет қаралды 178 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 457 М.
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 14 МЛН
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 8 МЛН
TypeScript - The Basics
12:01
Fireship
Рет қаралды 1,5 МЛН
Liskov: The Liskov Substitution Principle
4:23
Turing Awardee Clips
Рет қаралды 19 М.
Build an SQL Agent with Llama 3 | Langchain | Ollama
20:28
TheAILearner
Рет қаралды 2,2 М.
My Favorite TypeScript Tips and Tricks
10:21
Lachlan Miller
Рет қаралды 5 М.
How To Learn JavaScript In 2023 - From Zero To Mid-Level Developer
14:18
Web Dev Simplified
Рет қаралды 118 М.
Go in 100 Seconds
2:30
Fireship
Рет қаралды 1,5 МЛН
Learn useReducer In 20 Minutes
20:12
Web Dev Simplified
Рет қаралды 491 М.
Are You Making These CSS Height Mistakes?
8:54
Web Dev Simplified
Рет қаралды 122 М.
Learn GraphQL In 40 Minutes
39:43
Web Dev Simplified
Рет қаралды 730 М.
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 14 МЛН