Photo by Markus Spiske on Unsplash

A CI/CD (Continuous Integration/Continuous Deployment) practice is common-place nowadays. More and more dev teams are convinced and already sold on CI benefits. In the age of multi-regional teams spread across timezones, CI practices definitely speed up the development process.

CI has been abuzz since 2007. The exact and discrete origins of the practice are hard to pin down. Many believe it’s earlier than 2007. Some say it’s 2004 when Grady Booch mentioned “micro-processes” and continuous testing in his book “Object-Oriented Analysis and Design with Applications”; during those days, there weren’t any CI software. …


Kotlin doesn’t have a switch statement, but it has the when construct. It looks a lot like the switch but it packs a lot more punch. In its simplest form, you can write it like this

val d = Date() 
val c = Calendar.getInstance()
val day = c.get(Calendar.DAY_OF_WEEK)
when (day) {
1 -> println("Sunday")
2 -> println("Monday")
3 -> println("Tuesday")
4 -> println("Wednesday")
}

The idea is to match the argument (the variable day) against the branches 1, 2, 3 or 4 . The test is carried out from top to bottom (1, then 2, then 3 then 4) and…


Kotlin’s approach to exception is similar to Java. Somewhat. It uses the try-catch-finally, just like in Java. So, your knowledge about how try-catch works commutes nicely to Kotlin. The code below should be very familiar. It shows a typical code on how to open a file

import java.io.FileNotFoundExceptionimport java.io.FileReaderimport java.io.IOExceptionfun main(args: Array<String>) {  var fileReader: FileReader  try {    fileReader = FileReader("README.txt")    var content = fileReader.read()    println(content)  }  catch (ffe: FileNotFoundException) {    println(ffe.message)  }  catch(ioe: IOException) {    println(ioe.message)  }}

So, what’s different? Well, in Kotlin, everything is an unchecked exception. Which means, the try-catch block is optional…


yenwen / E+ / Getty Images

Let’s deal with the meaning of reify first. It means to make something real, and the reason we’re using reify and generics on the same statement is because of Java’s type erasure.

Type erasure means exactly what you think it means. Java, and Kotlin as well, erases generic type information at runtime. There are good reasons for this, but unfortunately, we’re not going to discuss those reasons why the language design is like that — but we will discuss its effects. Because of type erasure, you can’t perform any reflection activity and you can’t do any runtime check on a…

Ted Hagos

coder, doodler, writer, trainer. https://workingdev.net

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