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.

Treat life like a marathon, not like a sprint

Planted October 24, 2024

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.

I am not an experienced distance runner like some of my colleagues — I want to think I am still in some sort of early years — but I progressively internalize how many analogies there are between long-distance running and enjoying a decent life. Like probably many, I have been slowly pivoting from “life is a sprint” towards “life is a long-distance run”. With all the changes in your perception of reality that come together. And I progressively believe this helps to attain a better life.

If you have ever run a marathon, is not easy. It doesn’t matter if you have run 0, 1, or 100. It is never easy. Damn, it is not easy for Eliud Kipchoge, how can it be for John Doe? You start quick or slow, and you think you are going to have a PB, but there are always doubts and uncertainties. But in the end, you finish your run, you become a bit more experienced, wiser, and better than you were before. You have been consistently training, you didn’t pay too much attention to your inner ghosts, and it is time to celebrate. I believe this applies to your vital career, too.

Life is not a sprint

I am not talking here about professional sprinters, they also need a life of consistency and hard training. It is just a metaphor for life. I think of this as the supremacy of long-term goals, patience, consistency, and resilience over shortcuts. I think this applies to every aspect of life.

Everybody wants to speed up to the finish line. We all want to be wealthier, prettier, and better. We look for shortcuts, and life is full of them.

If you live in this world you have received many tempting emails about dubious proposals to multiply your money without any effort. Courses to become richer, tips to lose weight in an unrealistic period of time, and to be more attractive. They are appealing — why would I need to put in the effort over an extended period of time if I can just buy some cryptocurrency and avoid working hard for a number of years? Everybody else is an idiot, and nobody thought about going the quick way.

The reality is that EVERYBODY has constantly thought of the shortcut, but those shortcuts are mostly nonexistent.

Some time ago I read “The Four Pillars of Investing: Lessons for Building a Winning Portfolio”, and there was a quote that resonated with me (free translation from the Spanish book I read):

When a broker calls you suggesting that the price of a particular stock is going to skyrocket, what he is really telling you is that he does not consider you to be too smart, otherwise you would realize that if he really knew the price was going to go up, he wouldn’t tell you, not even his own mother. Instead, this individual would immediately quit his job, mortgage himself up to his neck, buy as many shares as he could, and then lie down on a beach.

I have been a retail investor for some time. I didn’t have any extravagant gains, but enough to provide certain life security to my family, and enough to understand how it worked. Somewhere on Twitter I read also about a secret:

Do you want to get rich? Keep working and investing.

Understanding how the capitalist world works, I accept that you can, of course, take the entrepreneurship path and accelerate toward wealth. It does not contradict the previous term, real entrepreneurship also takes work (unless your progenitor owns an emerald mine or you inherit wealth), but for most of the population, wealth will come from work. And this is fine. The hint to treat life as a marathon still applies.

All the gains worth pursuing in life will come from a long-term perspective. Whether they are financial, sentimental, or anything else.

The Challenge of Long-Term Thinking

It would be naive for me to lecture on long-term compounding when so much literature already exists. Yet, the magic of long-term thinking is often overshadowed today, especially in a world that favors short-term results. The real danger is not the lack of information, but rather the overwhelming abundance of it. No matter how steadfast you are in your values and life goals, it only takes a quick scroll online to sow doubt.

But once again: long-term compounding in life is real.

It is hard to not make money long-term

Let’s look at another financial analogy: staying invested in the S&P 500 makes it difficult to lose money over time.

Chances of loosing money staying invested in the S&P500

The longer you remain in the market, the lower your chances of losing money. After ten years, those chances become negligible. Sure, there will be statistical anomalies — financial crises, pandemics, wars like the ones we’re currently experiencing — but the long-term approach reveals its magic over time. In fact, it’s hard to lose money.

I firmly believe this principle applies equally to every aspect of life.

Treat business like a marathon

In business and your career, you’ll inevitably experience ups and downs. Perhaps the company you work for goes under, you find yourself stuck under a poor manager, or you’re simply in the wrong place at the wrong time for longer than you’d like. But over time, your achievements will accumulate if you approach life like a long-distance run.

You should prioritize where you want to be in ten years, not just one. Bill Gates famously quoted this. We’re biologically wired for instant gratification, but we’ve evolved enough to understand the value of delayed gratification.

In investing, you’ll soon learn about “red ocean” and “blue ocean” scenarios. The red ocean emphasizes competition and incremental improvements, where only a few can emerge victorious. Conversely, the blue ocean encourages growth and new possibilities.

You don’t want to exploit your business partners. In the blue ocean world many of us inhabit, especially in tech, we find ourselves in a privileged position. Yet, it’s undeniable how often people engage with a shallow, self-serving mentality — taking what they want while leaving others to suffer.

Reject a short-sighted life. Make a conscious effort to broaden your horizons and elevate those around you. Resist the temptation of a red ocean mindset.

Treat personal relationships like a marathon

It’s easy to slap a band-aid on relationship issues rather than addressing their root causes. It requires more effort — perhaps some introspection and vulnerability — but in the long run, you’ll want to build strong foundations that enrich your life and relationships.

Treat finances like a marathon

Don’t chase short-term financial gains.

I reject the notion of wealth for its own sake. I strive to live frugally — even if I occasionally indulge in unnecessary purchases, like bikes I probably didn’t need this year — always prioritizing living below my means. I want to avoid getting attached to depreciating objects and instead focus on what appreciates over time.

I actively choose to invest. For instance, when I buy something during Amazon Prime Days or Black Friday (which, I find myself doing less and less), I invest €1,000 in my brokerage account. This way, I win: I buy fewer things and invest more.

I view wealth as a tool to enhance my life. It allows me to secure better education for my family, reduces stress, and enables planning for a brighter, happier future.

Wealth doesn’t guarantee happiness, and we all learn that lesson eventually. But it would be disingenuous to deny that it can improve your quality of life.

Many investors chase high yields, lured by the prospect of quick gains. Why buy a stock with a 3% dividend when you could go for one offering 10%?

But this approach can lead you into traps — an emblematic reflection of life itself.

If you treat your finances like a marathon, rather than a sprint in search of shortcuts, your chances of thriving will increase dramatically.

Run more marathons

I hold no scientific evidence that running made me a better person, but I hold strong suspicions.

I accept it is not perfect. I might have not alwaysbeen nice to my partner, skipping time together to travel somewhere to run, and having an unreasonable schedule. But I think that in the big schema of things it made me better.

Running long-term distances (marathons, ultras or whatever comes next) will trigger some internal transformations. It is not easy — hell, I have run almost a 100 marathons and even now, when I run, I am aware I would be more comfortable sleeping. But it teaches you some values:

Patience: it does not matter if I run an extremely fast first half of the marathon if I have to walk the second half. I will enjoy it even less, and my time will probably be a disaster.

Consistency: it is not about training strongly for some months, and then relapse. You need to keep a level of consistency. You will not run your new PR unless you train after certain threshold.

Resilience: running a marathon sucks. You will sweat, your legs will be tired, and you might get sick the day after. You will be tired when you meet your partner and she/he is having an ice-cream. But you will learn resilience. And resilience is a good value to have. Sometimes you need to go down before going up. Sometimes you need to visit the seawers before flying to the sky. And there is no better life training than doing it in a safe environments, like a marathon.

I share my thoughts about Software Engineering and life in general on my Mastodon account. If you have liked this article or if it did help you, feel free to share, 👏 it and/or leave a comment. This is the currency that fuels amateur writers.

Disclaimer: This article didn’t use Generative AI in its elaboration.