Summary of Scope functions: let: Used to check nulls, also better than simple null check in multi-threading case also: same as 'let' but it doesn't return the last line as 'let', instead 'also' will return the object it was called on and 'not the last line!' apply: helpful function to modify objects, if you want to change in properties of the objects, and it uses 'this' instead of 'it' as we work inside the class of the object run: equivalent to 'apply', but it won't return the object it was called, instead it will return the last line with: same as 'run' but a different signature.
@PhilippLackner3 жыл бұрын
good!
@trungtrankim2943 жыл бұрын
Awesome. Thanks a lot man.
@rithulraj33482 жыл бұрын
*with()* is the combination of *let* and *run* because it does null check also, am I right?
@hazfrd Жыл бұрын
@@rithulraj3348 nope. In fact run is combination of with & let. Run does check nullpointer (let) and reference with this (with) , after that return the last line a.k.a lambda expression
@hazfrd Жыл бұрын
@@rithulraj3348 with() doesn't checking null, just for non-null. in case it is null then use let(), in case you want make some operation while checking null then use run()
@codinginflow3 жыл бұрын
11:04 sick special effects bro .also { respect++ }
@PhilippLackner3 жыл бұрын
pow(thanks, 10)
@johnybaby95743 жыл бұрын
Hi CiF~!
@codinginflow3 жыл бұрын
@@johnybaby9574 hi
@agp14443 жыл бұрын
also is very useful in case x = y.also { y = x } - switch values of variables without third variable
@mahdi72362 жыл бұрын
big brain time😉
@TheMohit9872 жыл бұрын
😂😂😂😂 wow
@hieuluu24952 жыл бұрын
Awsome
@phamhung2263 Жыл бұрын
why don't we just switch those variables with a third variable. It's more readable
@2chotti7 күн бұрын
This is the best video on scopes. Thanks
@damercy3 жыл бұрын
Hey man. I just learnt Kotlin. Previously I've made a few basic projects in android using Java. Fortunately,I found your channel with some really good resources to learn android dev in Kotlin. Just wanted to say a genuine thank you for putting out such great content. Please don't stop. Power to you! 🔥❤️
@PhilippLackner3 жыл бұрын
Thanks! You're totally welcome
@firuzaaliyeva53823 жыл бұрын
Was literally just thinking about finally studying these, and you just uploaded. Thanks!
@iJuce3 жыл бұрын
same wtf
@PhilippLackner3 жыл бұрын
yes, I can read your mind
@mz-coder3 жыл бұрын
@@PhilippLackner LOL!
@larrystreehouse1124 Жыл бұрын
Simple and Concise explanation. Even though I go self-learning with Kotlin for 1 year, this is great to recall my memory and consolidate my knowledge. More importantly, you show us how to teach and explain the basic concept in an interesting and concise passages with live examples.
@weather120widget8 Жыл бұрын
I really appreciate your teaching style, how you build on topics as you go. Keep up the great work.
@benjaminmorales86243 жыл бұрын
You’re an amazing dev, thank you for all this effort and please keep it rocking!
@PhilippLackner3 жыл бұрын
Thanks, will do!
@mirzasohailhussain9 ай бұрын
Thanks Philip, you are sharing so much knowledge without any charge. I have seen so many people share only basics and then member only videos
@ganshakumari51962 жыл бұрын
Fantastic explanation. Much clearer than most of the online resources, Thanks Mate!
@ziakhan-tk7rk2 жыл бұрын
Your tutorials are addictive I watch them repeatedly
@TheMohit9872 жыл бұрын
Your videos are very helpful. Your way of teaching is simply awesome.
@FatalRescue3 жыл бұрын
Wow, thank you for opening my eyes. I was just using let as shorthand for the null check and did not realize how useful it actually is!
@PhilippLackner3 жыл бұрын
yes, let > null-check
@tanishqsehgal25932 жыл бұрын
Very Well Explained
@salimmazariboufares31182 жыл бұрын
Cool, that was pretty much understandable by someone who is new to Kotlin.
@usherg41583 жыл бұрын
o man, I have been reading lots of explanation and still not get it until watching yours. Great example and explanation, thanks for making this video.
@telurasinmontasik2406 Жыл бұрын
Very clear explanation
@thearpansircar3 жыл бұрын
An absolute psychic. I was going through Kotlin's Documentation and, suffice to say, it confused the fuck outta me.
@achalbadgujar95193 жыл бұрын
Finally a practically helpful explanation of these scope functions
@jeffreyrudolph6334 Жыл бұрын
so much better than the kotlin udacity explanations
@tomaslopez99992 жыл бұрын
Thanks for creating this video.
@carloscambon540211 ай бұрын
You explain very clearly. Thank you.
@ianlipa982610 ай бұрын
Your tutorials are a big help bro. Thanks!
@yuripanov96703 жыл бұрын
You're the best! Thanks!
@rahulchandrabhan3 жыл бұрын
One of the best explanation. Simple and Easy. Great man
@PhilippLackner3 жыл бұрын
Glad you liked it
@anvarzaripboyev5730 Жыл бұрын
Thanks bro, it is very usefull tutorial. Good luck!
@FreeKnowledge2 жыл бұрын
Fantastic explanation.
@walkmn2 жыл бұрын
Good explanation for the latest one 😄
@DreckbobBratpfanne2 жыл бұрын
i liked to use with eg in viewbinding, because then i can avoid typing the binding variable name xD, also you can use multiple of them within each other what is also pretty nifty
@aunghtayoo3372 жыл бұрын
Thanks. Philipp
@adarshdev38103 жыл бұрын
It is awesome you explains concepts so simple. Hats off
@Qrzychu923 жыл бұрын
I don't even programm in Kotlin (fellow dotnet dev here!), but this videos are very cool :) I'd love to have this tuff in C#
@aweklin3 жыл бұрын
I already liked the video before watching because it is the topic I had pinned on my todo list to research this week. Thanks Philipp
@PhilippLackner3 жыл бұрын
Awesome, thank you!
@mdjahidulislam92053 жыл бұрын
I was waiting for it.you just read my mind
@PhilippLackner3 жыл бұрын
yes, I did
@jackli1924 Жыл бұрын
Awesome video!You explained very simply and concisely. Thanks a lot Philipp!
@original_anu3 жыл бұрын
Simple, crisp explanations ❤
@mehdiparsaei18673 жыл бұрын
The best in the world! I am sure!
@zareahmer59493 жыл бұрын
You are Great man . Stay blessed
@leosvxy3 жыл бұрын
thank you! , was so easy to understand your explanations
@imagetag46183 жыл бұрын
Wow. its so much clear understand. thank you. keep it up.
@bjugdbjk3 жыл бұрын
Such a fab explanation, Thanks a ton, You should really do a lot more this kind of standalone videos of advanced concepts of Kotlin, it will b super helpful.
@PhilippLackner3 жыл бұрын
Thank you!
@themichael8767 Жыл бұрын
Thank You very much, Sir!)
@alexnovikov1609 Жыл бұрын
Thank you!
@yuanyuechen21833 жыл бұрын
Thank you, I really learn a lot from you
@LittleWasteClub2 жыл бұрын
Thank you for the great explanation!
@mahetachirag83953 жыл бұрын
Your tutorial are awesome.
@marinbeslo78413 жыл бұрын
your tutorials are just awesome!
@PhilippLackner3 жыл бұрын
Thanks a ton!
@theonlyarjun3 жыл бұрын
just what i was searching for, awesome man
@PhilippLackner3 жыл бұрын
Glad to hear it!
@VeronikaDoma-f5y2 жыл бұрын
Thank you!! 🤩
@TheMaciak903 жыл бұрын
Very well explained. Thank you mate.
@lyawileh.a87412 жыл бұрын
Thanks for useful explanation. 🙏
@mohammedelamin15633 жыл бұрын
So helpful 😎
@RackaApps3 жыл бұрын
Super helpful
@abdelsttarahmed88213 жыл бұрын
you are legend man i wish seeing you doing a video on Providing offline capabilities with NetworkBoundResource
@PhilippLackner3 жыл бұрын
I do that in my ktor course on pl-coding.com
@sckly433 жыл бұрын
awesome video bru
@techmarinar3 жыл бұрын
Thanx man this was very helpful 😊
@mohamadalighezelbashyan44822 жыл бұрын
Great!! thanks ❤
@vibinjoby2 жыл бұрын
Amazing just what i wanted after reading the docs and wondering where exactly all these get used
@abuiman52513 жыл бұрын
Thanks!
@koutheirelbehi43843 жыл бұрын
This boi is on another level !
@Alvin-dg9pq3 жыл бұрын
Fantastic explanation, thanks a lot.
@indraj66693 жыл бұрын
Great explanation
@r.j.jeninjoseph49753 жыл бұрын
Really helpful thanks man
@ajaykumarvishwakarma47203 жыл бұрын
Really informative video. Thanks a lot
@aneessaleh28703 жыл бұрын
amazing video mate , keep it up please
@PhilippLackner3 жыл бұрын
Thanks a lot!
@rsobies2 жыл бұрын
in this case number is a property so it is a function. a function can return different results and that's why it is considered as mutuable. inside let block you are dealing directly with a field of the class. 'it' is a field, not a property. so it is immutable
@sudarshanh.s.5219 ай бұрын
this is awesome
@hirarkiardipratamakiki87773 жыл бұрын
i often use 'with 'to declare componen with viewbinding,such as onClickListener, and etc.
@lional48983 жыл бұрын
With is useful when using string builder. No need to create new variables. Simply call toString at the end
@himanshugoeldelhi2 жыл бұрын
Try executing that code if some people don't understand what 'let' does number?.let { number = null val num2 = it + 1 } Here 'let' actually saved the global value of number and even in case number becomes null in 'let' block , still 'it' value will remain the same which you defined before
@dreamer62287513 жыл бұрын
Thanks bro, it's excellent video !
@PhilippLackner3 жыл бұрын
You're welcome!
@ramakrishnavjoshi3 жыл бұрын
Thanks for this video, Philipp. :)
@imnithish3 жыл бұрын
great vid as usual man
@PhilippLackner3 жыл бұрын
Glad you enjoyed it
@tyrannus00 Жыл бұрын
Schönes Video, gut erklärt 👍
@Alchemist102412 жыл бұрын
This video definitely belongs to 5 percent group according to 95/5 rule (80/20 rule). Great and precise job 🚀
@brucebane74013 жыл бұрын
amazing tutorial!!!!!
@serhatcd3 жыл бұрын
Thanks for video.. Also i see use function. What is the use function? This is also scoped function
@scottbiggs8894 Жыл бұрын
I never realized before that Philipp looks like the Elvis operator ?: ;)
@riyupapa392 жыл бұрын
I usually use run like this var a:String?=null //When i want do something if only a is not null, a?.run{ //todo }
@jayeshsuthar55903 жыл бұрын
crystal clear....
@highs_and_lows46653 жыл бұрын
This was explained very well. Udemy eat your heart out!😀 Many thanks!
@shidqi1003 жыл бұрын
Great video expected man love your explanation, just asking will you make videos outside topic of android and mobile dev in general ex: Ai, web or desktop?
@PhilippLackner3 жыл бұрын
Not planned right now, but I also don't say I never will. I might do some flutter videos in the next time
@shreyashachoudhary480 Жыл бұрын
Great!
@vigneshdroid1654 Жыл бұрын
Hi Bro, Your videos are very helpful for me. You Know Tamil language Bro?.
@renaldyhiunarto43698 ай бұрын
coming from the future and seeing you with beard kinda weird lmao. Anyway, love all your vids
@andriibibik393 жыл бұрын
Very Good!
@ucPhamQuoc Жыл бұрын
the beard is impressive
@fourcade78513 жыл бұрын
Thank You Bro
@PhilippLackner3 жыл бұрын
No problem
@mandroidx14743 жыл бұрын
Appreciated Keep it up❤
@PhilippLackner3 жыл бұрын
Thank you, I will
@coffeedude2 жыл бұрын
I learnt that you can use 'also' to swap variables but I don't understand why it works. ie: var foo = "foo" var bar = "bar" foo = bar.also { bar = foo } print(foo + bar) // barfoo
@soontaek3 жыл бұрын
I left you some feedback on your previous video (Preference Datastore)
@PhilippLackner3 жыл бұрын
Thanks, I saw it! :)
@shreyashchoudhary74133 жыл бұрын
Epic!
@vikasdaily12221 күн бұрын
How squaredFunctionI = (i*i) can be a function without return type and body.
@MetehanBOLAT2 жыл бұрын
You said "run" is the same as "with", but "with" is almost the same as "apply" isn't it? Because "with" and "apply" return expected types. run does not return. also { Thank you very much, it was a very informative video by the way. } :)
@cinemovieone3 жыл бұрын
O melhor, muito bom os vídeos.
@pratikchauhan9893 жыл бұрын
Good one 👏👏
@PhilippLackner3 жыл бұрын
Thanks ✌️
@MrLukasw44 Жыл бұрын
but is that mean that apply is thread safe? so if we got an object and we would like to run 3 methods on that object and that object is a global variable so the question is if we use apply those 3 operations will be thread safe?