Great video. If your main languages are typed it's an easy choice. The languages we use affect the way we think as can be seen with the difficulty experienced structural coders have fully accepting functional languages without major effort. My gut feeling tells me the right way is to accept the code pain and bite the bullet 100% but that's not practical if you need to maintain productivity. After 35 years of C, then C++, and now I'm retired playing with Rust, I can't imagine not having the type system (and the borrow checker) holding my hand. I'm as bound by my history as everyone.
Hey Ben, in VS Code, if you hold down the Command Key on a Mac and hover over the interface, it will expand the tooltip to show the actual fields of that interface type. I'm not sure what the equivalent modifier key on Windows (it could be the option key or the alt key).
Great!, I learnt a lot here, note that I'm just discovered Typescript yesterday :) Can I ask what id the plugin that you are using for code suggestion JS/HTML?
Thanks for the kind words! Most likely what you're seeing is Copilot, but if that's not it, let me know which timestamp in the video you're referencing and I'll be happy to figure that out for you.
In terms of why people invest in it, the type definitions can help enforce standards across teams and provide better autocomplete support. That said, you definitely don't have to use TypeScript! I certainly don't think it is for everyone and the important thing is what you build rather than the tooling.
you're welcome! most likely what I think you're referring to is Github CoPilot, but if there's another timestamp in the video that looks different, let me know and I'll happily try to see if there's something else that's not coming to mind.
From TS’s docs: typeof MyArray[number] gives you the element type of an array literal (where _MyArray_ is the name of the variable and _number_ is just a keyword). If you didn’t have “as const” on the array you would get the type “string”, but because constant strings in TS have the type not “string”, but the string itself, that’s why you get the union of all the strings at 1:00:42
Ahh so sorry about that. The repo was private for some reason. It should be public now! github.com/bencodezen/toEat Let me know if you still can't access it!
It's definitely a love hate relationship for sure. On the one hand, it can be great for documentation, but on the other hand, it can be infuriating and to your point, counter-productive. I personally find that it's best for each team to determine whether the trade-off of working with TypeScript is worth their time and effort. It's definitely not for every team.
Nice video, am new too. Please what extensions do i have to install to help me when writing typescript, normally get red lines when i start writing typescript 😩
It used to be complicated, but now all you should need is the official Vue extension! Make sure it's the latest version cause there was a bug recently where it was installing an old one. marketplace.visualstudio.com/items?itemName=Vue.volar
Ok, I'm gonna preface what I'm going to say with I am not a javascript developer but I'm trying to learn typescript. That said, how is typescript more complicated than javascript? Isn't typescript just javascript but with types? I mean, I get it if you are a self taught programmer and your first language is js but for others who more than likely learned something like c++ first in school, typed variables are normal right? If there is actually something else, then I would love to learn.
That's a great question! I think you hit it on the head in terms of the fact that the primary audience of TypeScript often comes from a JavaScript first background. In my experience, the struggle people have with TypeScript often comes with the approachability of a codebase. Hard to understand / modify types can make a codebase less approachable for those who feel like they only made one change but now their IDE / compiler is yelling at them cause everything broke and they don't understand why.
would be cool if you prepared beforehand. Really hard to follow esp with statuses typing. Also if you dont provide a git code, you expect users to type along with u. Oh ups, intersting, boom deleting what i just typed! oh oops interesting boom, retype really quick, oh!!!!!! check stackoverflow, oh interesting, let me just delete this and this really quick, oh i have to guess this and that but anyhow.
Sorry for the confusion. These sessions are intended more as a "co-working session" that I host as a livestream. This means that there's a lot more improvisation and experimentation. I'll try and make this clearer in the future in case people are looking for more tutorial centric content.