https://kotlinlang.org logo
#getting-started
Title
# getting-started
p

polendina

10/14/2023, 12:14 AM
Does using scope functions to evade working with private/local variables is considered a bad practice? I think my code starts getting heavily nested.
w

Wout Werkman

10/15/2023, 10:58 AM
Does using scope functions to evade working with private/local variables is considered a bad practice?
That's is completely up to you and the people who will have to read your code 🙂
I think my code starts getting heavily nested.
The most effective method of reducing scope (and thus, also nesting) is to extract logic into smaller functions.
💯 1
p

polendina

10/15/2023, 8:34 PM
That's is completely up to you and the people who will have to read your code
Fair enough. I thought Jetbrains could've had coding practice for such cases.
1