-
-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About upcoming version 3.0.0... #511
Comments
Old, non-suspending functions will be available but marked as deprecated. |
Well yeah, I know. Should have worded it better (future versions instead of just 3.0.0). But they will be removed in the future, won't they? When that happens, that'll be the end of diversity and inclusion for not-coroutine users. |
I know I'm just another person, but just hear me out: Exclusion of other people is not how you build healthy relationships in real life. Like I said, I can work on this. It simply boils down to whether you're welcome of me. Please. |
Can you elaborate more here? Any example?
Sure, if your PR solves the actual root problem, then I am happy to keep both version. cc @wasky |
Implementation detail is basically how something works internally and not usually exposed to the outside world. Why it mattersThe current 2.x public API is fine imo. It may lack some fancy modern syntaxes, but it does the job well in ease of use. Hence, it accommodates everyone who wants to use it. What can be doneDon't get me wrong, I think the work of (don't really wanna ping them) is awesome. It's just that in the process of revamping things, they left out a big hole in terms of accessibility. I simply seek to patch it up. From what I see, there are 2 options to do it:
|
Usage of new API would be as simple as the code below:
I believe that the usage of new API is simple enough that it can be used by developers with minimal knowledge about coroutines and I think we should not introduce new, non-coroutine API. New API means it has to be maintained. Less code = less maintenance = less potential bugs. I just don't see lots of benefits of the new API. Maybe I missing something? Also I would prefer to keep old API marked as deprecated to encourage developers to use new API. We don't have to delete old API, just keep marked as deprecated. The reason for this is that old API behaves differently than new API. Old API will be using
To help developers write code with less errors I think we should encourage developers to use new API by deprecating the old one. And even if the old API will be deleted in the future, you can reintroduce it in your own app simply by adding the code below to your project:
Can you provide any real-life scenario where coroutines cannot be used? It would be easier to address any specific issue you have with the new approach. |
*Let's get this right out of the bat: My concerns are not specifically about me. I know both Kotlin and Java, and I do know and am writing Coroutines code. I simply enjoy writing in both languages and would love if they work together seamlessly in mixed codebases. Ah, this is where the discussion gets... interesting: Java compatibility. I have specifically been avoiding this since I'm afraid it would bring about some very unproductive "arguments". ProposalIf using LifecycleOwnerKt.getLifecycleScope(getViewLifecycleOwner()); //this is lifecycleScope! Again, if you don't want to listen to me, it's fine, I can do it myself. |
To call suspending function from Java code you can use this solution: https://stackoverflow.com/a/52887677/1219654 |
Oh ok, that's interesting. Still, I think things can be better documented. Speaking of, why are the Java documentations removed? Java has never been a dead language - it's constantly evolving (structured concurrency in Java is a thing now, although is in preview). Most Java 8+ language features can be used in any Android version via core library desugaring and Java language version can be set in a project like this: compileOptions {
sourceCompatibility JavaVersion.VERSION_19
targetCompatibility JavaVersion.VERSION_19
} That's it! You can use modern Java to develop Android apps! Say hello to enhanced Many, MANY people do not realize that Java is much more powerful than, say, 2019 (when Kotlin was officially announced for Android dev). (And rightfully so - Java 7 anonymous classes boilerplate still haunts many long time devs to this day) I'm joking about that last part, but it also delivers my pointA very unfortunate consequence is that everywhere, EVERYWHERE Android dev is concerned, people have extremely negative connotations about Java devs.
You may realize that I'm very defensive and steadfast about accessibility. That's because I want to - no, that's my mission to prevent those toxic absolutisms (buT jAva iS juSt baD!!!) and make absolutely sure that technology is friendly to everyone and their cats and no one is discriminated just because they have their preferences about which tools they are comfortable with. Kotlin's interoperability with Java is top-notch, why can't people's mindsets also follow that as well? |
@unbiaseduser And the whole reason to migrate to Kotlin was to leverage all new features available in Kotlin including coroutines. If you have a solution to fix this problem using the old API which uses AsyncTask then I am happy to keep both AsyncTask and Coroutine versions of the API. We'll change the name of the coroutine function to differentiate it better. Let us know with your PR or else we keeping discussing this without any progress. |
Let me clarify this: I... never said that I would like to keep the old version. The sentence at the beginning means that I am willing to make PRs to improve the new version, specifically the new API! I specifically said that the future versions are awesome and I specifically pointed out that, you know, maybe it could be more accessible. As for what I can do: Like I said before, I can fill in the gaps myself (specifically: the documentation). I just need someone to OK me so that I can safely do so (since you still have the right to straight up deny me). I never thought that everyone just... goes dead silent for days and now everyone's mad at me for not making progress! |
Oh!! I thought it was about keeping the old APIs to support the java version. My bad.
Cool than. I will review the PR and merge it if it looks good.
Cool. Can you create a new issue with the description you are planning to make for the documentation? We can move the discussion there. |
New API for Java users introduced in #512 |
Oh thank you! So, will my documentation effort be needed? I mean, I already wrote a draft of the instructions on how to call suspend functions here Also, a little nitpick: Java API has a optional parameter yet isn't annotated |
This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 4 days. |
I'll close this now, thank you |
It looks like version 3.0.0 will force the users to use Kotlin coroutines to save images. While I'm normally all for progress and such, I really don't think that alienating your userbase is a good idea. IMO, Coroutines should only be an implementation detail to keep smooth transition from old to new versions.
I understand if you don't want to support the old API anymore, but seeing as even big companies' libraries still support not-coroutines users, this seems at least a little bit icky.
If you want, I can make PRs to solve all this once 3.0.0 drops.
Regards.
The text was updated successfully, but these errors were encountered: