Let, Also, Apply, Run, With - Kotlin Scope Functions

preview_player
Показать описание
In this video I will summarize for what you should choose which Kotlin scope function.

00:00 - Kotlin Scope Functions
00:30 - Let
05:10 - Also
07:20 - Apply
09:13 - Run
10:30 - With

⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:

💻 Let me personally review your code and provide individual feedback, so it won't backfire and cost you a fortune in future:

Рекомендации по теме
Комментарии
Автор

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.

AlaaAlbrg
Автор

11:04 sick special effects bro
.also {
respect++
}

codinginflow
Автор

also is very useful in case x = y.also { y = x } - switch values of variables without third variable

agp
Автор

You’re an amazing dev, thank you for all this effort and please keep it rocking!

benjaminmorales
Автор

Finally a practically helpful explanation of these scope functions

achalbadgujar
Автор

Awesome video!You explained very simply and concisely. Thanks a lot Philipp!

jackli
Автор

Fantastic explanation. Much clearer than most of the online resources, Thanks Mate!

ganshakumari
Автор

I really appreciate your teaching style, how you build on topics as you go. Keep up the great work.

weatherwidget
Автор

It is awesome you explains concepts so simple. Hats off

adarshdev
Автор

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.

usherg
Автор

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

mirzasohailhussain
Автор

Your tutorials are addictive I watch them repeatedly

ziakhan-tkrk
Автор

Your videos are very helpful. Your way of teaching is simply awesome.

TheMohit
Автор

Your tutorials are a big help bro. Thanks!

ianlipa
Автор

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

Aweklin
Автор

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.

larrystreehouse
Автор

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!

FatalRescue
Автор

thank you!, was so easy to understand your explanations

leosvxy
Автор

Was literally just thinking about finally studying these, and you just uploaded. Thanks!

firuzaaliyeva
Автор

One of the best explanation. Simple and Easy. Great man

rahulchandrabhan