Non-local breaks and continues are... whatever. I would avoid them in clean code anyways. What I find exciting are the contracts. When will they become stable?
I mean the contracts have been in there for so long, I'd wager they won't change that much anymore anyways. And you also don't need to declare them that often. At least I've just been using them for a while now.
The Wikipedia page on the goto statement lists a couple of reasons why it could be used although, generally it's discouraged. Amongst them, more readable code and less code duplication are mentioned. I'd say that these non local breaks are similar. Non local breaks look wrong, but are they really that problematic?
Like others have said, non local breaks feel wrong to me as well, but I like how Kotlin is experimenting with coloring-outside-the-lines constructs and syntax like last argument lambdas. Those are also "wrong". As long as the code doesn't become more ambiguous to the reader, let's give it a try.
9:28 that is very nice, but what if the onfailure function that executes the lambda executes it in a loop himself? Which loop would the break be executing? Would it require to know the internal working of onfailure before using break?
I always disliked how the scoping of exit statements works in Kotlin. It should exit the current block by default. It's unintuitive and breaks copy-paste.
To the people insisting on using the biological classification of fruits instead of the culinary one, feel free to also add cucumber, olives and many more to your fruit salad. And since strawberries and rhubarb are not biological fruits, we'll add them to your soup. Enjoy.
onSuccess and onFailure methods are methods that are potentially asynchronous in nature. Thats a bad naming for what you are trying to achieve. Substituting if (result.isFailure) { break } with a result.onFailure { break } is super smelly and, I'd dare to say, dangerous!
Non-local breaks and continues are... whatever. I would avoid them in clean code anyways. What I find exciting are the contracts. When will they become stable?
I mean the contracts have been in there for so long, I'd wager they won't change that much anymore anyways. And you also don't need to declare them that often. At least I've just been using them for a while now.
The Wikipedia page on the goto statement lists a couple of reasons why it could be used although, generally it's discouraged. Amongst them, more readable code and less code duplication are mentioned.
I'd say that these non local breaks are similar.
Non local breaks look wrong, but are they really that problematic?
@@ErikBongers I mean you can always enforce labels on them with something like detekt for example, if they implement that as a rule.
0:00 Bro this isn't tiktok you don't need the ADHD captions lol.
I feel like your lighting makes your face seem flatter than it really is
Thank you, Saif Ali Khan.
Like others have said, non local breaks feel wrong to me as well, but I like how Kotlin is experimenting with coloring-outside-the-lines constructs and syntax like last argument lambdas. Those are also "wrong". As long as the code doesn't become more ambiguous to the reader, let's give it a try.
9:28 that is very nice, but what if the onfailure function that executes the lambda executes it in a loop himself? Which loop would the break be executing? Would it require to know the internal working of onfailure before using break?
Awesome as always
So this makes the lambda could break or continue a loop where the lambda executed on?
TOMATO IS A FRUIT LMAO
wow, how to color the suspend method @@?
Settings->Editor->ColorScheme->Kotlin->Functions->Suspend function call
Felixble but what for extract lambda to tie it again to specific code?
I see some use in UI scenarios
thats a great feature
Awesome content (i didn't understand anything)
I always disliked how the scoping of exit statements works in Kotlin. It should exit the current block by default. It's unintuitive and breaks copy-paste.
Not sure why to write such code that needs this in the first place? Beeing "flexible" does not include writing such weired code :)
What's the name of the theme?
It looks like IntelliJ’s default “Dark”.
I like allowing this but it feels smelly
To the people insisting on using the biological classification of fruits instead of the culinary one, feel free to also add cucumber, olives and many more to your fruit salad. And since strawberries and rhubarb are not biological fruits, we'll add them to your soup. Enjoy.
onSuccess and onFailure methods are methods that are potentially asynchronous in nature. Thats a bad naming for what you are trying to achieve. Substituting if (result.isFailure) { break } with a result.onFailure { break } is super smelly and, I'd dare to say, dangerous!
Great feature..but Tomato is a real fruit lol
You are correct on not liking the number 13, it is also a bad number in Brazil.