/ Home / Blog /

Joyful Kotlin- The Class You Never Knew You Needed

Davis Keene·June 3, 2020

“Software is like entropy: It is difficult to grasp, weighs nothing, and obeys the Second Law of Thermodynamics; i.e., it always increases.” - Norman Augustine

Back when I was stuck between the middle of winter and the beginning of my second semester of college, I had an internal conflict to settle when it came to my class schedule. I was registered for my core computer science classes, my statistics requirements, and my gen ed's. The last spot to fill were my electives. I had signed up for Linear Algebra of all classes, a math requirement for CS majors, when I remembered my Intro to Computer Science professor mentioning he was teaching a class called Joyful Kotlin, an introduction to Kotlin as a programming language after learning Java. As all things do, everything fell into place as I dropped Linear Algebra for Kotlin in my pursuit of programming knowledge. And needless to say, it's one of the best decisions I've made in my entire first year of school.

My Experience in Joyful Kotlin

Before the coronavirus ended on-campus classes for the rest of the Spring semester, I enjoyed going to Joyful Kotlin every Wednesday and Friday, ready to learn. The official website contained lots of really useful examples and a Kotlin playground for you to explore and test your own Kotlin programs in your browser. The lectures were informative and, more importantly, super interactive. It was a small enough class where questions that people asked could be quickly answered. I remember one class we were learning about functions and return types, and I asked if it was possible to write a function that would take in two functions, and return the one that took less time to run. Rather than give me a one-off answer, we were able to go over that exact example in class, which was a really great experience to have in a computer science class at a school where class sizes are usually 50+.

Unsurprisingly, however, this course was a secondary concern for many of the course developers, as they had the larger CS-125 (Intro to CS) class to worry about. When coronavirus made all classes remote, most of their collective effort was put into 125 instead of 199. What this ultimately meant was that we weren't to be given a homework assignment in Kotlin for the entirety of the semester. Our final project was to be the entirely of our grade, and even though the grading scale was Satisfactory / Unsatisfactory, it was still a little nerve-wracking. I decided that for my project I would take the initiative to create a site where the professor could upload Kotlin homework assignments, and where students could run and test their solutions.

KTeach is still up and running (you can register here), and working on KTeach allowed me to learn so much more about Kotlin through experience, rather than just doing homeworks each day. Not to say that I think daily homework isn't important: if I thought that, then I wouldn't have made KTeach. But in smaller, more experiential classes such as Joyful Kotlin, it's a pleasant surprise to work with the course resources to build something that you're passionate about rather than just doing the daily homework to retain Kotlin syntax.

Why Joyful Kotlin is the Logical Next Step for CS Majors

Something that I've learned throughout the years is that knowledge is not transferred, it is constructed. Knowledge is not just the passing of an oral tradition from one set of hands to another; it is analogous to experience. And because knowledge is a construct, you must follow a logical and intuitive progression of concepts in order to paint a mental model for yourself, no matter what you're studying.

In computer science, you wouldn't start learning Java by dissecting all of the keywords in public static void main(String[] args). Otherwise, you would have to first understand public access modifiers, then static methods, then return types of methods, then the main() method's significance, and finally command line arguments. It is often much simpler to learn programming language concepts after you've learned the basics. Once you learn how to print and what variables are, you can then see that things can be printed only if a condition is met, which leads into passing these variables into methods, which then segways into encapsulating data in other ways besides variables (classes), and before you know it you're writing your own algorithms in Java.

In the same way, Kotlin is the logical next language to learn after one has been introduced to Java. Primarily, this is because Kotlin is 100% interoperable with Java. This means that Kotlin compiles into Java bytecode, can use Java libraries, etc. It is this interoperability, combined with Kotlin's easy and intuitive python-esque syntax, that makes it a wonderful language to continue studying programming languages. At first, some things in Kotlin are inexplicably different than Java. Why do I need to declare whether or not a variable has to be nullable? How are variables in Java either mutable or immutable upon declaration? But the more that you use Kotlin, and the more familiar you become with writing good Kotlin code, the answers to these questions don't just become visible, but are astonishingly obvious. This isn't to say that Kotlin is the perfect language (I'm looking at you, missing data class inheritance support!), but it's an amazing next step that will guide beginner CS majors through asynchronous programming and enforcing null-safety in a way that no other language could. It doesn't hurt that Kotlin is the preferred language for Android app development, is the fastest growing language of the decade, and can compile into javascript, making it highly versatile for web and app development.

What makes this class... Joyful?

Rarely do we see schoolwork be framed in a way that's supposed to spark curiosity and enjoyment. For most students, pleasure that's derived from learning is fundamentally dependent on the student. Some people really love it when they learn about asynchronous programming methods, and others will learn just enough to pass the class and then move on to the next forgettable piece of information. What stood out to me about Joyful Kotlin was that the lessons were deliberate in getting you to see the joy of Kotlin, rather than just the semantics. Instead of saying "here's what we can do with Kotlin", it was much more exciting. It left the class wondering, "What else can we do with Kotlin?"

Closing Remarks

Joyful Kotlin is a class that I only have good things to say about. The professor was amazing and knowledgeable beyond the scope of the class, the learning environment was positive both in-person and online, and I learned a lot about Kotlin, Dockerizing API's and concurrency in programming. If I could go back in time to my January self, I would have let him know that he made the right choice in choosing this class over Linear Algebra.

Although Joyful Kotlin was 1 credit hour, met twice a week, and was put on the backburner by the course staff when classes all went remote, I enjoyed coming to class each day and using the course resources to make software that was meaningful to me. Kotlin isn't a language you need someone to hold your hand while learning it, which was greatly appreciated as I struggled to make time for this class with all my other classes overwhelming me toward the latter half of my second semester.

There aren't many classes that I've taken so far at UIUC that I would outright recommend; I mean, I've only taken two semesters worth of classes! But between CS-125 (even you already know Java, take this class!) and Math 241 with Chris Leininger (one of the best math professors I have ever had), CS-199 IKP is probably the best learning experience you could sign up for, in as little credits as possible.

Learning to program doesn't have to be stressful. Hopefully after this class, you'll see that it can be wonderful, meaningful, insightful, and most of all, joyful.