Jan 16 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jan 16 | 4:10 PM |
Kai H. | has entered the room |
Kai H. |
Hello
|
Mark M. |
hello, Kai!
|
Mark M. |
how can I help you today?
|
Kai H. |
When using Koin, why would you have several Koin modules? What is the advantage?
|
Mark M. |
well, I haven't needed it personally, as my Koin projects tend to be small
|
Mark M. |
I think one scenario is for reloading the module
|
Jan 16 | 4:15 PM |
Mark M. |
for example, suppose you have a bunch of stuff going through DI that is tied to a user account
|
Mark M. |
and you want to support logout and login
|
Mark M. |
after a user logs out and logs in, you need to "reset" all those injected elements to reflect the new user account
|
Mark M. |
but, not everything is necessarily tied to that
|
Mark M. |
so, you could have two modules, one that gets reloaded on logout/login, and one that does not
|
Mark M. |
at least, I think this is one of the scenarios
|
Mark M. |
I have only scratched the surface of Koin in my own work
|
Kai H. |
Ok. What did you use instead?
|
Mark M. |
well, my customer projects tend to use Dagger
|
Kai H. |
Dagger2 I guess?
|
Mark M. |
yeah, sorry -- the original Dagger is long since deprecated IIRC
|
Mark M. |
I tend to drop the number
|
Mark M. |
I have to watch out for that with RxJava, though, as both 2 and 3 are still relevant
|
Kai H. |
So you guess that Koin modules are "organisational units" to be able to do something on several injected classes but not others?
|
Mark M. |
that is my gut instinct
|
Mark M. |
but, again, I have not used multiple modules yet
|
Kai H. |
I tried googling but didn't find anything
|
Kai H. |
It's just that almost every example that is not trivial uses several modules.
|
Jan 16 | 4:20 PM |
Mark M. |
¯\_(ツ)_/¯
|
Kai H. |
Another question I have is how you feel about all this "auto generation" that is going on, for example for View Binding, Views, Jetpack Navigation etc.
|
Mark M. |
I'm not sure what "Views" means in this context
|
Mark M. |
Navigation has two tiers of code generation: standard R stuff for the navigation resource type, and SafeArgs
|
Mark M. |
both are going to fade out, being replaced by Kotlin DSLs (for fragments and for Jetpack Compose)
|
Jan 16 | 4:25 PM |
Kai H. |
That was supposed to be part of view binding.
|
Mark M. |
ah, OK
|
Mark M. |
view binding is better than many alternatives (e.g., Kotlin synthetic accessors), though it too is on the chopping block long-term, as Compose starts to eliminate the use of layout resources
|
Kai H. |
The reason I ask is that it makes me a bit uncomfortable. It feels like there is no control and too much "magic".
|
Mark M. |
oh, well, *that* aspect of matters is not going away
|
Kai H. |
And sometimes classes are not there and I need to re-gradle or rebuild and be lucky.
|
Kai H. |
And Android Studio suggest the wrong classes to import and so on.
|
Mark M. |
code generation is a major element of modern development, though
|
Mark M. |
annotation processors are code generators
|
Mark M. |
R is code generated
|
Mark M. |
Compose is powered by compiler magic
|
Mark M. |
and so on
|
Kai H. |
So I just need to accept that there is magic
|
Mark M. |
to an extent, yeah
|
Mark M. |
IMHO, this stuff is great for newcomers, great for experts, and is less great for the middle tier
|
Mark M. |
newcomers have less to learn to get going
|
Mark M. |
experts can get more done with less syntactic overhead
|
Kai H. |
At least when developing Android. But I guess "magic" also applies to a lot of other areas
|
Mark M. |
yes
|
Jan 16 | 4:30 PM |
Mark M. |
in many respects, "magic" is a line that you draw
|
Mark M. |
once upon a time, compiled programming languages were magic
|
Mark M. |
then, virtual machine-based languages were magic
|
Mark M. |
each language has its own stuff that is magic compared to other popular languages at the time
|
Mark M. |
and so on
|
Mark M. |
different developers will adapt to newer forms of magic at different rates
|
Mark M. |
and that varies both by developer and by form of magic
|
Mark M. |
in other words, "it is what it is"
|
Jan 16 | 4:35 PM |
Kai H. |
So you think with time we will grow used to it?
|
Mark M. |
yes, for most developers and most forms of magic
|
Kai H. |
I hope I can do that.
|
Mark M. |
bear in mind that it may be that "do an end-around" the magic by switching to something completely different
|
Mark M. |
your thoughts on Android app development magic will be less relevant if you switch to, say, Web service development
|
Kai H. |
But isn't there a lot of magic as well?
|
Mark M. |
yes... but you might not perceive it as magic
|
Mark M. |
it will just be "this is how it works"
|
Mark M. |
where "magic" starts to be a problem is when you know what came before and are trying to figure out how the new stuff equates to what came before
|
Kai H. |
I think that "magic" becomes a problem when things stop working ;-)
|
Mark M. |
that's the "middle-tier" developer that I mentioned earlier, and they are the ones at biggest risk of stumbling over magic
|
Mark M. |
to an extent, but that is as much a question of tooling as magic
|
Kai H. |
(Or when I need to change something that happens inside this magic)
|
Mark M. |
and as a newcomer to some new environment, you will not (yet) be in position to change something that happens inside the magic
|
Jan 16 | 4:40 PM |
Kai H. |
So I am a middle-tier, as I have legacy Java and possibly want to move to modern-Kotlin.
|
Mark M. |
right, and some aspects of the changing Android development ecosystem may be magic
|
Mark M. |
and buggy tools will make that magic be aggravating, but with time, bugs get fixed
|
Kai H. |
So I just need to trust that and learn to use it.
|
Mark M. |
pretty much, yeah
|
Kai H. |
And stretch my frustration limit.
|
Mark M. |
that too
|
Mark M. |
you could try yoga, or herbal tea, or something :-)
|
Kai H. |
lulz
|
Kai H. |
What is your secret?
|
Mark M. |
View paste
|
Mark M. |
I mean, I vent a *lot*
|
Kai H. |
How?
|
Mark M. |
sometimes, that is via the issue tracker
|
Mark M. |
sometimes, that is via blog posts
|
Jan 16 | 4:45 PM |
Mark M. |
(occasionally, both)
|
Kai H. |
I relate to Doctor Banner in that and programming can make it worse. I oftentimes swear and sometimes scream.
|
Mark M. |
sometimes, I vent via snide comments that I make in books that I write
|
Mark M. |
sometimes, I vent via snide comments that I make in Stack Overflow answers
|
Mark M. |
now, most of that is not about the magic, though some of that is magic-related bugs
|
Mark M. |
and, where I can, I try to help others deal with the magic, via those books and blog posts and Stack Overflow answers and stuff
|
Kai H. |
magic-relateds Bugs :D
|
Jan 16 | 4:50 PM |
Kai H. |
Maybe I should write a blog too.
|
Kai H. |
I usually vent to ppl around me.
|
Mark M. |
and if they're willing to absorb it, there is nothing wrong with that
|
Jan 16 | 5:00 PM |
Mark M. |
well, that's a wrap for today's chat
|
Kai H. |
Have a good time
|
Mark M. |
you too!
|
Kai H. | has left the room |
Mark M. | turned off guest access |