Is Any of This a Good Idea?

You do not see labels and labeled returns used much in Kotlin code samples. Their use may be a sign of overly-complex logic within a single function. Consider decomposing the work into separate functions, if they let you avoid labeled returns. The resulting code is likely to be more readable, particular for relative newcomers to Kotlin.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.