I've been programming in scala for 4 years and finally decided I better get to the bottom of these types 😂 this is awesome and so clear!! Thank you!!!!
The good news is that you don't really need to use them when writing your own Scala code, except for None when you work with Options, and maybe Unit, although that can be inferred most of the time.
I think null pretty much has to exist due to Java interop. The alternative would be Kotlin's solution: having duplicates of every single type in order to specify if the value can be null or not.
There are actually other reasons to use nulls. Because scala 3 has really cool features such as union types, it's possible to use union types of SomeType | Null, that allows significantly reduce memory usage.
I've been programming in scala for 4 years and finally decided I better get to the bottom of these types 😂 this is awesome and so clear!! Thank you!!!!
That's the goal! Enjoy!
Your scala videos are the best
you rock!
Wow, overwhelmed with 5 types of nothing haha.
The good news is that you don't really need to use them when writing your own Scala code, except for None when you work with Options, and maybe Unit, although that can be inferred most of the time.
Totally missed the opportunity to make a punny reference to Sum 41
Very nice video, I think what is missing (maybe) are uses cases, when do we need to use Null, Nothing.
Null and Nothing are almost never used by themselves, they are the type of null and error-throwing respectively, as we show in the video.
Very helpful.
Would be a great addition is you showed some usecases for them which I guess is very challenging for some :D
That's the goal!
Good lesson, thanks
Glad it helped!
Very nice..
is scala api null proof? i mean will i have to deal with it when writing my code? why they introduced it when we have Option...
Just use Options!
I think null pretty much has to exist due to Java interop. The alternative would be Kotlin's solution: having duplicates of every single type in order to specify if the value can be null or not.
There are actually other reasons to use nulls. Because scala 3 has really cool features such as union types, it's possible to use union types of SomeType | Null, that allows significantly reduce memory usage.