Articles

Vibe Coding, Kotlin, Finance, and Data Visualization

Recently, I came across a paper discussing an experiment and tried to reproduce it. Here’s a brief summary: - Portfolio A: In a bull market, grows by 20%; in a bear market, drops by 20%. - Portfolio B: In a bull market, grows by 25%; in a bear market, drops by 35%. - Bull market probability: 75%. According to the paper, both portfolios should have a one-year expected return of 10%.

Treat life like a marathon, not like a sprint

Like most of us, I am daily flooded with thoughts about life, my objective position in it, whether I am missing anything, or whether I need to do better. Am I providing enough for my family? Is my career on track? Am I being healthy enough? Am I just passing through life instead of aiming to strive? Those thoughts have been slowly mitigated, but they never got away. Over time, I have been slowly accepting this reality, and I came to realise that all the marathon training and long-distance running have helped me come to terms with these facts.

Uploading SARIF Reports to GitHub

Recently I wanted to add Lint reports to a repository on GitHub. The goal is to report potential Lint violations when new code is committed, to make sure that all the committed code is lint-warning-free and pretty. My first idea was to look for a GitHub action that could run ./gradlew lint and report it as a PR comment. After asking about ideas in the Android Study Group, Carter Jernigan and Justin Brooks suggested me to upload directly the SARIF files into GitHub.

KotlinConf 2024 announcements

The first day of the KotlinConf 2024 is over, and there has been a significant amount. After 5 years the conference happened again at The Bella Center in Copenhagen, a fantastic venue close to the historical center of the Danish capital. The last two weeks have been intense, with the Google I/O announcing another set of relevant features for Android and Kotlin developers. Most notably, Google is now supporting KMP for Android development.

HTTP chunk requests with Android and ktor

In this very short article, I will explain briefly what is a chunk or streamed HTTP request, what are the benefits of using it, and how it works in Android. Android apps use HTTP requests to download data from a backend. This information is stored and processed on the app to make it functional. HTTP requests are executed using different frameworks on Android. The most common ones are Retrofit or OkHttp.

My Investing Summary of 2022

Another solar rotation passed, and the world experienced a plethora of unexpected events. In the aftermath of the Corona epidemic that altered the course of the last couple of years, we had the unfortunate invasion of Ukraine by Russian forces, the tightening of Corona measures in China (and toward the end of the year, their withdrawal and gradual reopening of the economy), an ongoing economic recession, the rate hike by the FED and the general uncertainty of the most immediate future.

KMP, iOS Developers and Production

Kotlin Multiplatform (or KMP, KMM Mobile, etc) has been widely used for a number of years in applications that are currently in production. JetBrains compiled a website listing some of the companies that are currently using KMP. Since the advent of the mobile platforms we enjoy today, there has always been a certain market interest to push multiplatform technologies, such as Cordova, Xamarin, and others. With more or less success, those technologies aimed to provide a unified framework to develop multiple codebases, mostly focusing on the aspect of pricing (create code once, deploy multiple times).

A recapitulation of investing in pandemic times

It has been around 14 months since the pandemic started. We have all been affected by it to a greater or lesser degree, and the investing world has not been an exception (although surprisingly, the stock market is one of the winners of the pandemic). In this post I will share how the pandemic changed my investment thesis, the things I learned, and the mistakes I did. 14 months into the crisis of our generation (and with a few months to recover whatever the new normal will be), we now know that things will never be the way they used to be.

A short story of randomness (I)

I have always been fascinated by the above comic strip. A discussion on randomness and determinism becomes as much a philosophical issue as it is a practical one. They are used in a variety of applications: from the obvious cryptography, gaming or gambling to the less evident politics or arts. How can we be sure that a number is random? Will observing the process mine our efforts on generating the random number, similar to the observation of a cat inside a box with a decaying radioactive atom?

From Java to Kotlin and back (III): Calling Java from Kotlin

This article is part of a series. You can find the remaining article of the series here: From Java to Kotlin and back (I) — Calling Kotlin from Java From Java to Kotlin and back (II): Calling Kotlin from Java In this last chapter of the series, we will evaluate consideration when calling Java code from Kotlin. One could argue that even in this situation happens often, keeping considerations in mind for some code that might legacy is not that practical.

KotlinConf 2024 announcements

Planted May 24, 2024

The first day of the KotlinConf 2024 is over, and there has been a significant amount. After 5 years the conference happened again at The Bella Center in Copenhagen, a fantastic venue close to the historical center of the Danish capital.

The last two weeks have been intense, with the Google I/O announcing another set of relevant features for Android and Kotlin developers. Most notably, Google is now supporting KMP for Android development. This is not a surprise move, since Google has been slowly pushing KMP for many of their libraries and products. Having official support is, however, a confirmation of a direction that makes Android developers happy. We are no longer relying on uncertainty. Quite the opposite, we know that putting our time and effort on Kotlin Multiplatform is likely to pay dividends over the upcoming years.

Despite the sometimes errant strategy of Google supporting technology stacks, everything related to Kotlin and JetBrains has been fairly stable. Google announced support for Kotlin as a first citizen in the Google I/O 2017, and nowadays it is hard to understand Android development without Kotlin in the picture. Similarly, since the advent of Android Studio, Eclipse and other alternatives have quickly dissipated. We anticipate that Kotlin Multiplatform is going to follow a similar path, given previous trajectories, the investment Google is taking on, and the inherent advantages of Kotlin Multiplatform over other multiplatform frameworks.

Arguing why Kotlin Multiplatform is a better alternative for the foreseeable future deserves an entire article, so we will not delve too much into it (note: the usage of delve here has not been suggested by AI).

Without expanding ourselves too much, here is a sneak peek of some of the most relevant announcements today.

The advent of Kotlin 2.0.0

This is the worst-kept secret by JetBrains, Kotlin 2.0.0 is now stable and released. The final artifact was uploaded this week to GitHub, and we had our fair share of beta announcements for a few months. Kotlin 2.0.0 comes with a bunch of goodies, and our attention is directed to the following:

New Compose and Gradle plugin

The Jetpack Compose compiler has now been merged into the Kotlin repository. There has been some speculation about the final reasons, but the most direct implication is that we do no longer need to juggle anymore to get the right version applied. The Compose Gradle plugin will be equal to the Kotlin version.

Visibility changes in Gradle

The new @KotlinGradlePluginDsl annotation will prevent the exposure of the Kotlin Gradle plugin DSL functions and properties to places where they should not be available.

Bumped minimum supported AGP version

Time to update your minimum AGP version to 7.1.3.

New JSON output format for build reports

Build reports now support a JSON format to analyze better compiler performance and other metrics. Easier to integrate it with other tools and in CI/CD environments.

Changes in the standard library

Like with other previous Kotlin versions, the standard library now is more stable and brings improved functionality.

For full information on the release, check out the official page for announcements and the GitHub release page with all the commits included.

K2 compiler

Faster, shinier, more beautiful and more performant. A small step for humankind, a big step for us. If you haven’t tried yet K2 on your application it is time to use it now.

View Gist on Medium

Internal adoption of Kotlin at Google, Amazon, Meta and others

Google internal adoption of Kotlin is growing exponentially. Meta is moving relentlessly in its adoption after 5 years. Amazon keeps increasing the traffic from Kotlin SDKs. At this point you do not need formal proof of Kotlin being a relevant actor, but it is good to get a reminder that this is still the right choice in such a volatile world like the tech world.

Compose Multiplatform gets more stable

Compose Multiplatform for iOS is now in Beta, whereas Compose Multiplatform for Web is now in Alpha. It has not yet hit the stable breaking point, but it is progressing towards it. Adopting a new technology is a long-term strategy from a planning standpoint: you do not want to start today with a framework or technology that it is going to be deprecated in a number of years. Despite Kotlin Multiplatform being officially a technology that supports the business layer, given JetBrains track I feel more confident using Compose Multiplatform than most of the other UI multiplatform frameworks in the market for a variety of reasons that we could well cover in another article.

Fleet

Fleet is looking great, and we believe it might not be getting all the attention that it probably deserves. It is now incorporating cross-platform features, like debugging through multiple stacks (namely, combined Swift+Kotlin codebases), previews for Composables, etc. JetBrains is the company behind AppCode, an IDE that was able to refactor Swift Code while Xcode was unable to do it. Probably an IDE to keep an eye on.

New Kotlin LLM

If you live in this world, you might have observed the rise of the AI. There are reasons to believe that there is part of a hype that might not live up to expectations. Especially clear was the case of the Google I/O, which should have been renamed to Google A/I. Most of the announcements were related to AI.

We specially like that JetBrains is moving in the AI space, but not falling into the all-AI trend. JetBrains has been training a new Kotlin LLM that will be integrated into a Power AI assistant and the demo we saw at the KotlinConf was great: code explanation, documentation, code improvement, bug fixing… It really seemed like a powerful tool. And again, it seemed also to fit perfectly well in the midst of other non-AI-related announcements.

This is our handpicked selection of topics for the KotlinConf 2024. We are looking forward to the second day.

Disclaimer: this article did not use AI and was written by humans