3

Kotlin Refactoring - When Is A Class Not A Class?

 1 year ago
source link: https://www.youtube.com/watch?v=MXl7pW3DUJE
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

When Is A Class Not A Class?

Do you have a rule of thumb for when to use a class vs a function?
all these videos are great! I've found myself in the last year or so leaning much more towards just using functions. The only downside IMO is as with functional programming, looking at where something happens becomes a little trickier, as the application starts to become a description of what is happening instead of the effect itself (which I prefer but not for everyone). It takes a few more clicks, especially when passed in as a dependency, to get to the function which does the effect. Also namespacing becomes a bit more of an issue, as what would normally be contained within a parent object now is just at the top level and anyone could import it. Though you can use objects to wrap similar stuff up to help with that

Read more


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK