https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

myanmarking

06/15/2021, 10:48 AM
Is it safe to adopt them? Well, the official recommendation would say no. But the unofficial and more reasonable one would say yes, it is safe. The recommended migration will be explained if it comes to that for sure
🧵 3
t

Tijl

06/15/2021, 11:01 AM
Well, the official recommendation would say no.
Where do you get this from? The official explanation is here @diego-gomez-olvera: https://github.com/Kotlin/kotlinx.coroutines/blob/32336be8fa90818cff9f2ba3c36b3f7c89e079c4/docs/topics/compatibility.md#experimental-api It gives some pointers of what to look out for, especially if you are creating a library. it does not recommend against using it anywhere that I can see. In fact, it promises that if the API is decided to be removed, it will go through a normal deprecation cycle rather than just disappearing.
maybe you confuse it with
@FlowPreview
? but even there the wording is not that strict
m

myanmarking

06/15/2021, 11:04 AM
yes, it doesn’t clearly say yes or no
The features are Experimental. No oficial answer will openly say it is safe for production. Although everyone knows the kotlin team is great so Experimental basically means no problem
t

Tijl

06/15/2021, 11:27 AM
“experimental” does not mean “not safe for production”.
API is marked experimental when its design has potential open questions which may eventually lead to either semantics changes of the API or its deprecation.
it does not mean the implementation itself is substandard. Of course, any new feature in software project brings stability risks, whether it’s marked experimental or not. All that said, for something like a simple operator I see absolutely no reason not to use them. Even if you would heavily rely on some edge case behaviour that would change, it’s extremely easy to copy the code for the operator as temporary measure. In the end you should apply your own common sense.
m

myanmarking

06/15/2021, 12:57 PM
What do you think he meant by ‘Is it safe to adopt them’? I mean, for sure he was not talking about a personal app he is doing.
I won’t explain to you what Experimental means. Phrase it as you wish, using what sources you want. The official recommendation wont ever be ‘use as you like in production, experimental means its stable’
e

ephemient

06/15/2021, 4:09 PM
if you never upgrade, every version is 'stable' 😉
t

Tijl

06/15/2021, 7:12 PM
there is a large gap between “the official recommendation would say no” and “experimental means its stable” you can use things in production that do not have a stable API, you just have to be aware there are trade offs. Someone on the internet is probably not the right person to weigh the pros and cons for your personal situation. But one thing I can promise you, the “production” software packages used to send this message from my computer to everyone else in this thread do not exclusively use only stable APIs.
👍 1
m

myanmarking

06/16/2021, 10:05 AM
It doesn’t matter. I wasn’t arguing about any of that, idk why you keep teaching me your definition of experimental. I was explaining to someone that there is no ‘recommendation’ about Experimental Apis. If there were, it wound’t state its safe for production for sure
t

Tijl

06/16/2021, 10:29 AM
@myanmarking you started this thread by saying “Well, the official recommendation would say no”. The source I’m using is the official documentation and it doesn’t say that. so my definition of experimental has nothing to do with it, and I have intentions to school you on that subject. Clearly the official documentation about
@ExperimentalCoroutinesApi
does not recommend against production usage. It only states it may be dangerous if: • You are writing a library which depends on 
kotlinx.coroutines
 and want to use experimental coroutines API in a stable library API. • You want to build core infrastructure of the application around experimental API. Note that it still does not give a blanket recommendation not to use it in production, and it seems to me it has little to do with a simple use of
mapLatest
I am not making any of this stuff up, you can read it yourself in the link I gave you. I have no ideas where your stance that Jetbrains would refuse to endorse its usage for production come from (you know, despite putting it in one of their most popular libraries), but it seems to me this is entirely theoretical and irrelevant.
m

myanmarking

06/16/2021, 10:44 AM
“Well, the official recommendation would say no” - ‘would’ being the imperial word here. Maybe you are not a native english speaker, same as me. In that context, ‘would’ means that there is no clear and open recommendation about that, and everything after that verb implies a supposition - not a categorical reality
For obvious reasons, they won’t say its safe for production - but also won’t say you should not use it. They don’t want to discourage usage, and don’t want to imply Experimental doesn’t mean Experimental. My point exactly - there is no oficial recommendation and there will never be. If there would, it would say NO obviously - ‘would’
t

Tijl

06/16/2021, 11:51 AM
I think it’ll take more than just english to parse that. But it seems as long as you don’t attempt any mental gymnastics about how Jetbrains obviously doesn’t want you to use your their methods in production because they are experimental (duh), but (I suppose also obviously) they’re not going to tell you that because they don’t want to discourage you from using them in production, you’re fine to use your own judgement, based on what is written down. Coroutines itself, and other popular frameworks from Jetbrains use experimental APIs all over the place, so it seems they played even themselves in this way.
m

myanmarking

06/16/2021, 11:58 AM
Again with the opinionated explanation about Experimental. I was being sarcastic about the language, but after that paragraph - i rest my case. You just proved my point
t

Tijl

06/16/2021, 12:17 PM
well if you were using sarcasm, that changes everything!
e

ephemient

06/16/2021, 1:12 PM
please. no sarcasm in distributed messaging with unfamiliar people, it does not come across.
m

myanmarking

06/16/2021, 1:22 PM
read the full conversation. The argument is not sarcastic, the native english speaking argument was
t

Tijl

06/16/2021, 1:24 PM
right, the argument was a supposition.
15 Views