Posts

Showing posts from March, 2024

How does concurrency play a role in coroutines?

Image
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!

Legislativas 2024 - Portugal - Uma opinião

Image
  Uma boa lição para aprender para quem não entende uma das grandes fragilidades de uma democracia: o voto em branco. A gente normalmente não vota pelo partido que gosta. Se isso acontecer então estamos com sorte porque isso significa que esse partido existe. Normalmente, o partido que a gente gosta não existe e por isso o correcto é sempre votar, mesmo que isso signifique no mínimo votar pelo menos-mal. Quando a gente não vota em protesto o que estamos a fazer é, sem ter consciência disso, estar a abrir as portas para os radicais ganharem as eleições. Sejam eles de esquerda ou direita. Apoiantes dos partidos radicais nunca votam em branco e vão sempre votar. Os 48% (de acordo com as notícias) que decidiram não votar em Portugal nunca serão considerados e os seus protestos nunca serão ouvidos. O não votar é na práctica e de uma forma puramente funcional uma forma de danificar o sistema democrático. Ver partidos como Chega ganharem poder em Portugal deveria de servir como aviso para...

Tailrec Through The Ages Until Kotlin

Image
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...