Brilliant! ☘️ But also - you might need to fire the Script Supervisor on your film set - where did your Fila jumper disappear to at the end of the video? 😜 Thanks Bas 👍
@basarat2 жыл бұрын
Sometimes I even end up with a completely different haircut - and sometimes - shaved head 😂 PS: always great hearing from you
@noccer2 жыл бұрын
@@basarat legend! I see it as a feature, not a bug. Next time swap out your glasses or something, see if we spot it 😄 Cheers ☘️
@akhiltheloquacioussoul2 жыл бұрын
Quite informative. Well explained too. Thanks a lot.
@basarat2 жыл бұрын
Thanks ! Also thanks for being a public subscriber
@ftnsco Жыл бұрын
This is gold :)
@sisiradhikari9577 Жыл бұрын
Learning a lot! Thank you for your informative videos!
@tusharkhairnar9142 Жыл бұрын
Great solution to daily programming problems. Thanks! :)
@basarat Жыл бұрын
Thank _you_ for leaving a comment :)
@dennisgonzales95212 жыл бұрын
thanks!
@basarat2 жыл бұрын
Thanks for leaving a comment
@cyrusgracias45562 жыл бұрын
Amazing, I thought the issue was that now we can pass negative number, NaN, Infinity to those number types
@basarat2 жыл бұрын
Good point . Sadly NaN is always a valid number in TypeScript 🥲 For the curious its because in JavaScript: console.log(typeof NaN); // 'number'
@avi36812 жыл бұрын
@Cyrus Since the opaque type makes you produce the value in a special constructor function, you can add extra runtime validation inside that function and return an optional result. Then if the return is non-empty you are guaranteed that is is non-negative, non-NaN, etc.
@benjidaniel55952 жыл бұрын
I really wish TS would make opaque types a 1st class feature (like Flow does). Workarounds like this are okay, but not the prettiest.
@basarat2 жыл бұрын
I agree 👍🏻
@benjidaniel55952 жыл бұрын
I feel like I’ve been watching one particular thread on GH about it for years, and each release I think “will this be the one they implement it”, but alas it seems be forever stuck in the “todo next” part of the roadmap.
@basarat2 жыл бұрын
@@benjidaniel5595 I know the feeling it took 6 years to get `override` into TypeScript kzbin.info/www/bejne/l6PNo4KaiZxmmJY 😂
@boian-inavov Жыл бұрын
Or you can pass in an object with both entries as part of it and then destructure it accordingly to use in your function. This way you don’t need to have such a hacks approach of additional methods, nor strange types. Interesting video though
@dimitargetsov96904 ай бұрын
@boian-inavov . The only (edinstveniat) comment (komentar) that matter (koito e ot znachenie) . Congrats (pozdravi) .
@c0mpuipf2 жыл бұрын
who needs opaque types in a normal app? just asking cause i have no idea how this is useful other than it being food for thought;
@basarat2 жыл бұрын
I personally don't over use them. Only use them with DB objects when `ids` are being passed around (instead of full record objects). Help provide context on what a particular "id" string is a reference to. Hope that helps
@ViktorKarpov-o8h6 ай бұрын
If u do this, u will produce more 'indian code'. Do not ever do this in real codebase
@basarat6 ай бұрын
I’ve seen some pretty bad code independent of race and color, but okay, sure 😂 This is me assuming you can’t spell Indian 🤦🏻♂️
@yegorzakharov8514 Жыл бұрын
Ugh, that's disgusting. Whyyy do duck typing. Good fix though, thanks.
@basarat Жыл бұрын
Thanks! When TypeScript is too strict => Traditional Dynamic JS People hate. When TypeScript is too loose => Traditional TypeSafe Language People hate. Its a fine balance to achieve maximal People Love But yeah, I'm in the prefer nominal Typing Camp, with perhaps some special syntax to explicitly specify type structural compatability 🤷🏻♂️ Or perhaps some special syntax to offer optional strict nominal typing for some types 🌹
@yegorzakharov8514 Жыл бұрын
@basarat that's true. Especially when you consider how ubiquitous JS is. But I just want TS to be strict. There are people who are scared of TS because of the strictness, therefore making it stricter wouldn't change much. Plus you could make TS super strict with flags. You want nominal types, opt in! I'm sure it has its own issues, but at least it's good for both camps.
@Luxcium2 жыл бұрын
😅 He is talented and he is smart but with this hoodie he is just making me melt 🫠🥰 ✨
@Luxcium2 жыл бұрын
Sorry I should probably behave like I am not a _primitive type_ … and trying not to treat people like they are _object_ …