In this short and practicle article, we will talk about handling UI events, such as onClick events, by taking full advantage of the Kotlin’s Function Types and Sealed Classes.

Here’s the short version.

If you have not already learned about what a composable is, consider reading this article which explains the fundamentals. In any case, the important thing to understand is that composables are functions, not classes!

This means that we have to take a different approach than typical OOP solutions, but I will keep things simple to learn and apply.

Cat interacting with phone.

How To Model UI Events With A Sealed Class


The purpose of this article is to explain a few fundamental concepts and terms regarding the Jetpack Compose UI Library on Android. I intend to use the least amount of jargon necessary, and to connect new concepts with those which may be familiar to you when appropriate.

While this is a beginners guide to Compose, it will not be a beginners guide to Android, so readers will be expected to have built at least an application or two (though not in compose necessarily).

Before we begin, I was initially planning to write a follow up article directed towards more senior…


The title of this article is full of a bunch of words, some of which may be unclear to programmers who only write low-level code, and some of which may be unclear to programmers who only write web and mobile GUI applications.

I will try to hopefully bridge the gap for people from either background, but understand that this is not an article meant for a quick skim with divided attention. I have arranged these concepts in a logical progression, so please buckle up and set aside a few minutes of your day to possibly change the way you think…


Concurrency is widely regarded as one of the most difficult challenges among all fields of computation. I was first introduced to concurrent programming in high level languages, and the magic did not disappear until I studied it in C/C++.

If you are still wondering how it works under the hood then I suggest that as a learning goal, but we will not be going that low level today. Instead we will look at a practical way to write concurrent code which gives us more control than AsyncTask, but requires orders of magnitude less configuration (barely any at all) than a…


The technical content in this article is intended for software developers who have written at least one significant application. It does not need to be in the realm of GUI programming, but that is my own expertise and this article will reflect that.

In this article, we will:

  • Briefly summarize the difference between principles and rules
  • Discuss the principle of when it is actually better to not follow a principle (ironic, no?)
  • Refine this principle for programmers using some specific examples

Principles And Rules

  • A principle is…


A question which has been popping up repeatedly in my Q&A sessions since the Navigation Library from Android Architecture Components was released, is whether or not a Single Activity Architecture is:

  • Detrimental (bad)
  • Not Important (neutral)
  • Useful (good)
  • Mandatory (apply everywhere and in all situations)

In this short article, I will attempt to reduce the net sum of confusion which I see from junior and intermediate developers on whether or not this practice is necessary; along with how you might make this value judgement for yourself.

Generic Stock Image for SEO

Do Not Just Parrot Authority Figures


I am asked very frequently about which OS, language, platform, framework, library, IDE, and or whatever other kind of tech, is the best choice for new developers. Some more frequent questions lately have taken the form of:

  • Should I write native, web, or hybrid applications?
  • Should I pick Dart, Kotlin, or Javascript?
  • Should I write my own solution for concurrency or should I use a framework to handle that?

Ultimately, we are asking the same question regardless of what we are talking about: What is the best choice to make?

An expert in their field, or someone who simply pretends…


Most people either do not start, or quit learning to code for two reasons:

  • Learning one’s first programming language can be a very difficult task
  • It is important to have a good teacher (or at least good instructions) but they can be hard to find

In this article, I will:

  • Talk about dealing with these problems in practical terms
  • Attempt to disentangle you from some of the thoughts you may be having about your capability of learning to write code
  • Give you some road signs to watch out for if you decide to stay on this road
Generic Stock Photo for SEO

The First Programming Language


For roughly the first 24 years of my life (I am turning 27 in less than a month as of writing this), I did not know how to find a balance between taking a break versus wasting time. One of these things is a critical component of working hard, being productive, and still living a happy and blameless life (though nobody is perfect). The other at best presents a temporary distraction and at worst, sadness and depression.

First I will discuss my experience at both extremes and then we will go into finding the path towards balance. The principles I…


My name is Ryan, and I hate jargon. I hate jargon because I am ill-equipped to remember it, but the reason why I still write decent code is that I am well equipped to understand the concepts which these jargon words point to.

In this article, I will talk about three things that go together (testing, architecture, and legibility), and when you should start to care about them. While this is partly a subjective question, there actually exists a fairly concrete answer to this question and I need not use big scary words to explain it.

This article covers:

  • Why…

Ryan Michael Kay

Self-taught software developer & student of computer science.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store