Kotlin Generics Tutorial: Getting Started | raywenderlich.com

In this tutorial, you’ll become familiar with Kotlin generics so that you can include them in your developments to make your code more concise and flexible.

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3634394-kotlin-generics-tutorial-getting-started

I think there’s an error… to try contravariance, I think it’s , not birds, otherwise it doesn’t work

Hello @devrmobileteam, thanks for your comment. Could you please elaborate a bit more your question? I cannot see what you are referring to; please point out the section and the paragraph/snippet related.


I was referring to line 75 in the PlaygroundData.kt file from your source.

Because if I try to remove the comment block in the MainKotlinPlayground.kt file, it gives errors!

Am i missing something?

Thank you for the help BTW!

Hello, Pablo

thanks for this brilliant article!
can I ask you a question? Thanks for your explanation, but i would like to know where the Contravariance can be applied to? I mean from designer point of view. Maybe are somewhere in the design patterns, or something from android world, like presenter or repository.

This is the worst article I have ever read in raywenderlich.com, spent 2 hours understand nothing.

Hello @nurseyit! Thanks for your comment.

I am very sorry to hear the article wasn’t helpful at all. In order to be a bit more constructive and keep improving this site, could you please give us a more detailed feedback? I am sure this could help us to upgrade the article.

Thanks and regards,

Give more examples like here:

Thanks again for your comment @nurseyit!

The article you referred to is very good material, but not in the scope of this article, which is meant for more advanced developers. Thus, it is assumed you already know about some related topics, such as reified types.

Thanks and regards,

I knew nothing about it before, I just read this Kotlin Covariance and Contravariance | by mvndy | Kotlin Thursdays | Medium and after watched video. But before I intuitively came to raywenderlich, because they usually publish great articles in an understandable way. Sorry for offending, but to keep the reputation of raywenderlich you need to improove it.

In any way 1000000 thanks for your effort and time, I must appreciate it.

Hi @nurseyit, thanks for your comment!

I tend to think your problem is more related to your background rather than the article approach itself. You could maybe read some basics and come to this article later.

Thanks and regards,

@devrmobileteam Do you still have issues with this?

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!