Blog Articles
-
Cancellable HTTP requests via Scala's Tapir
This sample shows an HTTP server and an HTTP client that can cleanly cancel requests. It’s using Tapir and Sttp, with Netty and AsyncHttpClient backends, all powered by Cats-Effect.
Read article → -
Trusting Open-Source
“Shrink-wrapped”, “off-the-shelf” apps, or what the young have come to know as premium apps from the app store, are destined to languish, to become expensive subscriptions, or to be sold to shady companies that will sell your data or make your computer part of a botnet. Proprietary apps are destined to either disappear, most of them taking your data with them, or to rip you off.
Read article → -
1Password vs. Bitwarden
Optimising costs and my workflow is a personal obsession of mine. I've been a 1Password user for years, and I keep trying Bitwarden. If you want to pick between the two, here are the differences between them at the time of writing.
Read article → -
Cryptographically Strong Random on the JVM
When generating random numbers for certain use-cases, such as when generating keys / IDs, it’s recommended for the random function to be “cryptographically strong”. Otherwise, attackers could predict random values, enabling serious security vulnerabilities.
Read article → -
On Advertising and Tracking
Ads are now, unfortunately, a vehicle for malware, scams, or services that are deceptive and barely legal. But, should we block ads?
Read article → -
Scala's Future
As software developers, we invest a lot in our tools. Time, energy, and feelings. We recommend tools to others; we build on top; we belong to a community; we contribute; hence we're eventually becoming stakeholders. And there's no other tool more clamored or risky in our belt than the programming language. Well, gather around, kids, let me tell you two stories from my past with the software industry…
Read article → -
Update NextDNS with a Scala CLI script
Today I was reminded how awesome Scala is for scripting, via Scala CLI. And it goes beyond having “batteries included”.
Read article → -
New Year Resolutions
A new year is upon us, and it’s customary to make resolutions. The problem with new year resolutions is that we tend to forget them in about a week. So, how to make resolutions that stick?
Read article → -
December Adventure update, thoughts on Rust
This is an update to my december adventure, in which I took it upon myself to learn the Rust programming langauge.
Read article → -
December Adventure: Learning Rust
This December I’m off to a great personal adventure in programming. Everyone can have their own fun December Adventure. You pick something you want to do, or maybe learn, and you do a little of it everyday, as long as it involves some coding.
Read article → -
In Scala 3, use 4 Spaces for Indentation
Scala’s coding style advised to use 2 spaces of indentation, but that was before Scala 3’s optional braces, which introduces significant indentation. It’s time for an upgrade of the coding style.
Read article → -
OOP classes vs Higher-order Functions (HOFs)
What’s the difference?
Read article → -
Post Once, Syndicate Everywhere (POSSE)
I’m a geek, and a software developer. I want to be close to my peers, wherever they meet online. If this means reactivating former social media accounts, so be it. Therefore, I’m implementing POSSE, again 😕
Read article → -
Java Volatiles
In Java and other JVM languages, “volatile” reads and writes are part of the concurrency toolbox. But adding
Read article →volatile
on variables can be a mistake. This is a poorly understood concept. Let’s gain a better understanding. -
Scala 3 Significant Indentation Woes: Sample
Here’s a fairly straightforward Scala 3 sample, using significant indentation. Can you spot the compilation error?
Read article → -
Scala 3 Enums
In Scala, how do we model enumerations of values? What are the possible issues? How does Scala compare with Java? What are the changes in Scala 3?
Read article → -
Managing Database Migrations in Kotlin
The database schema should be described as code, in your repository. And you should be able to semi-automatically update your database schema on new deployments. Now in Kotlin, with Gradle and Flyway.
Read article → -
Kotlin Coroutines to Cats-Effect
Kotlin Coroutines are usually integrated in Java code via Java’s CompletableFuture, but a tighter integration might be possible with Cats-Effect.
Read article → -
Integrating Akka with Cats-Effect 3
We are using a combination of Akka and Cats-Effect (ver. 3) for building payment processors. This post describes some solutions we’ve discovered.
Read article → -
Server Monitoring with Monit
I self-host my blog, other websites, Matomo, Mastodon, etc. I love self-hosting. But I need monitoring, to be alerted when things go wrong, as my setup is getting more and more complex. So, I recently asked for help online, being in need of a monitoring system for my VPS, as I need simple, common-sense health alerts. I got a recommendation for M/Monit, which seems to work well. This article shows my configuration.
Read article → -
#DeleteTwitter
Friday the 13th just passed 😳 and what a great day it was to finally leave Twitter. It’s been a fun ride, I found my programming community on it, I’ve learned a lot, but those days are over 😞
Read article → -
Personal Server Backups
Cloud hosting services like Linode or DigitalOcean offer backup services for your VPS. Save your money, you don’t need it. Here’s how to backup your data safely, and with no extra costs…
Read article → -
Custom Jackson JSON serializer/deserializer from Circe
Snippet for when you’re using Circe and want to define custom Jackson serializers/deserializers from Circe’s codec definitions.
Read article → -
I ❤️ Scala's Community
I find Scala’s community to be really nice, welcoming, warm, and productive. I am not talking just of the Typelevel sub-community, which is awesome, but of the whole Scala community. The whole thing.
Read article → -
Immutable Collections should be Your Default
Mutable collection types should only be used strategically, with purpose, otherwise for correctness/safety purposes, the default should be immutable collection types, aka persistent data structures.
Read article → -
On Scala 3's Optional Braces
I dislike Scala 3’s significant whitespace syntax. At this point it’s safe to say that I hate it, being (IMO) an unfortunate evolution of the language.
Read article → -
Building a Queue for Delayed Messages via a RDBMS (1): Design
Ever had the need to deliver messages on your queue at a certain timestamp in the future? Look no further, because your RDBMS can do it. This is part 1 of a series that builds a solution from scratch.
Read article → -
Cut the Technobabble
The marketing for Functional Programming is made of technobabble. Technobabble was used in Star Trek. Those long discussions are what Star Trek was loved for, but technobabble isn’t good for sharing knowledge or advancing our field.
Read article → -
The case against Effect Systems (e.g., the IO data type)
As Scala developers and fans of the functional programming promoted by Haskell, how do we justify the use of
Read article →IO
to newbies coming from Java? It’s been a fun ride, but the truth is that Java 19 is changing everything. -
Execute Shell Commands in Java/Scala/Kotlin
The following describes snippets for executing shell commands, in Java, Scala, and Kotlin, using standard functionality. It’s also useful to compare Java vs Scala vs Kotlin for this particular problem.
Read article → -
The Trouble with Checked Exceptions: Part 2
Java’s Checked Exceptions are problematic, and it’s not only due to their ergonomics. The bigger problem is that they are in conflict with abstraction and OOP. Also, few people care about typed exceptions (unless they are happy path results, not errors).
Read article → -
Proprietary Environments are a Trap
What to learn in order to not become obsolete as a software developer, and then being forced into early retirement from programming? What platforms to prefer for building products that last with minimal maintenance?
Read article → -
Java 19
Java 19 is now released, and it’s a big deal, as it ships with Virtual Threads (JEP 425), among other goodies, like structured concurrency (JEP 428), or improvements to pattern matching (JEPs 405, 427). I haven’t been as excited about a Java release in a long time.
Read article → -
Akka Fork FUD
Lightbend made Akka proprietary from version 2.7.x onward. This left the community wondering about the possibility of a fork, and unfortunately, I see some FUD that needs to be addressed.
Read article → -
Java's Cultural Problem
Java is good by modern standards, from a technical perspective, the platform having received a lot of improvements from Java 8 to 17. Unfortunately, it still stinks, and the problem is its “enterprise” culture.
Read article → -
Scripting with Scala
Unix has a long tradition with scripting — small programs represented as text files that can be inspected, modified, and executed. Scala can be used for scripting too.
Read article → -
#DeleteFacebook
I finally managed to delete my Facebook account. This was a long time coming. Being disconnected feels good, it feels liberating.
Read article → -
Scala isn't fun anymore
I’ve just spent over a day, going to sleep at 1:00 am, to upgrade dependencies and fix eviction warnings in the build of a Scala project.
Read article → -
Akka is moving away from Open Source
According to today’s announcement, Lightbend is changing Akka’s licensing to “Business Source License (BSL)”. This is not an Open Source, or a Free Software license. This is a proprietary license.
Read article → -
Open Source vs Free Software
You may think that Open Source is about having “access to source code”, whereas Free Software is about freedom. Kids, gather around, let me tell you why that’s wrong.
Read article → -
Limiting Toxic Technology
Toxic usage patterns of technology, begone — inspired by a self-help book 🤷♂️ I changed my philosophy and habits regarding the use of technology.
Read article → -
Tracking Side Effects in Scala
What if we’d use Scala’s type system for tracking side-effects in impure code, too? In the Scala/FP community we use and love effect systems, such as Cats Effect, with its IO data type. “Suspending side-effects” in IO is great, but in Scala it’s either
Read article →IO
or forgoing any kind of type-safety for side-effects, and that’s bad. -
OOP vs Type Classes, Part 1: Ideology
This is the 1st article of a series that explores the difference between OOP design, and parametric polymorphism with Type Classes, as both are possible in Scala.
Read article → -
Implicit vs Scala 3's Given
I don’t like
Read article →given
, as an alternative toimplicit
in Scala 3. The more I try working with it, the more it annoys me; and my understanding may be superficial, but I don’t like this direction. Here’s a comparisson betweengiven
andimplicit
, that I hope is fair… -
Scala OOFP Design Sample
Scala is considered a multi-paradigm language, for better or worse, being one of the best OOP languages, which is why it’s so versatile. Let’s do a design exercise, going from OOP to static FP, and back. Let’s understand the various techniques promoted in the community, and understand why the OOP design isn’t just “idiomatic” for Scala, but can be superior to alternatives.
Read article → -
Scala's Gitter to Discord migration mistake
The Scala community is increasingly using Discord for “real-time chat”. This was announced in December, and the community page lists several Discord “servers”, one of them belonging to Typelevel. I think this move from Gitter to Discord is probably a mistake.
Read article → -
On Typelevel and Monix
Planning the future is difficult, but can bring clarity and purpose. I’m stepping down from the Typelevel Steering Committee. I also have plans for Monix’s future.
Read article → -
A Return to Blogging
I like writing about my personal projects and about programming in general. Helping others learn programming seems to be my calling. I rarely write on this blog, however, but I’m trying to change that. You should have a blog too.
Read article → -
Finding Focus in Harsh Times
Since 2020 world events have obliterated my ability to focus, and anxiety has gone through the roof. This is a personal reflection and a plan for recovery.
Read article → -
Cleanup Scala/Java project
Snippet for cleaning up a Scala project’s directory of all compiled files.
Read article →