Hi there! In this following video I am telling the story of one of the most debated keyword debated in Kotlin these days... At least it should and to be honest, I'm not sure if everyone understands what it really is. Therefore I wanted to investigate more about this enigmatic keyword and how it came to appear in Kotlin. Long story very very short, tailrec means tail recursive and it means that the compiler will potentially be able to transform this function into a known better algorithm allowing use to make functions in Kotlin that remain "pure". "Pure" is a bizarre word created in the Kotlin community to define Kotlin a language that doesn't have any side effects at all and doesn't use any mutability. But tailrec in Kotlin does transform seemingly immutable and side-effects free code into something else in the bytecode. I try in the video to have a philosophical discussion about the topic and not to get into any conclusion. And the question remains if i...
I'm also contributing now to DEV.TO. When I first started to use DEV.TO I had no idea how blogs worked and so I explored a lot! But I think DEV.TO is a great place actually to share code and ideas in a very easy way and so I am including that now in my repertoire of different contributions. On this example I am giving a real example from my GitHub repo about how coroutines work. In it I explain how they are concurrent and why they are said to use non-preemptive multitasking or otherwise known as cooperative multitasking. This is the to the article on DEV.TO: How does concurrency play a role in coroutines? And this is the video I made about coroutines, not specifically related to Kotlin in Vienna, Austria last year in 2023: Have a good on everyone!
Kotlin can be very handy and easy to use. Kotlin offers the possibility to develop code that is easy to understand, safe, immutable, and thus predictable and follows standards that avoid side effects. I realized that very quickly after I started my Kotlin journey that already amounts to more than 4 years. Having said that, some concepts can be difficult to visualize which can generate some confusion. While there are several advantages to using Kotlin, those advantages can only be put into practice if we can understand what the JVM is doing to our code. There are situations that may seem to question of non-nullable mark offered by Kotlin, others where you'll find functionalities that may seem to serve no purpose at first glance and if you are coming from the Java world you may find confronting the concept of specifically tail-recursive fuctions and its usages. All of these situations have created some confusing situations professionally, generating delays in development, that could ...
Comments
Post a Comment