Frankly, I'm wondering if `GlobalScope` should not...
# coroutines
l
Frankly, I'm wondering if
GlobalScope
should not be made experimental with something like
@WhyGlobalThingsAreBad
with some details on that special coroutines case of structured concurrency that should not be broken…
2
g
That will give you false negative alarm when using GlobalScope with Rx
1
i
it should not uses on Android
g
sorry, but I'd rather trust the guy who invented it and who says that using
GlobalScope
with rx types is totally fine. https://kotlinlang.slack.com/archives/C1CFAFJSK/p1548857935692300?thread_ts=1548856043.691400&cid=C1CFAFJSK
l
Then, name it
@BreakingStructuredConcurrency
or whatever, and for cases like this, just add the annotation at use site with
@UseExperimental
, or on the module.
p
But it is not an experimental feature so that would be even more confusing? Maybe there should be a lint rule in android studio?
2
l
Coroutines are not Android only, so it should be an IDE inspection rather than a lint rule if it had to go that way. Or lint should be made more lightweight so it doesn't bloat build with lint check of non Android projects/modules
p
I think it would produce a lot of false positives if it would be made as IDE inspection for every platform.
l
Lint would too. I prefer experimental annotations for this kind of thing though, because you can opt-in for a whole file, or a whole module.