Learning Kotlin: Type Aliases

Type aliases in Kotlin allow you to provide alternative names for existing types. This is particularly useful for shortening long type names, or for providing more semantic meaning to existing types. For example, instead of using ‘String’ you could create a type alias called ‘UserId’ that provides more information about the expected usage of that Continue reading Learning Kotlin: Type Aliases

Learning Kotlin: ‘Const’ Modifier

Kotlin’s ‘const’ modifier allows you to mark a variable as a true, JVM compile-time constant. To do this, the variable must meet several requirements. 1. Must be a top-level variable or a variable on an Object 2. Must be a String or primitive type 3. No custom getter 0:30 Example case study 1:18 Examine bytecode Continue reading Learning Kotlin: ‘Const’ Modifier

Learning Kotlin: View Kotlin Bytecode

You can easily view the bytecode for the Kotlin you write, and then decompile that bytecode into more readable Java code. This is useful for understanding what the Kotlin compiler is doing behind the scenes. Thoughts, questions, tips on examining Kotlin bytecode and the decompiled Java equivalent? Comment below or share on social media. I’d Continue reading Learning Kotlin: View Kotlin Bytecode

Learning Kotlin: nullability

Wondering how to handle null in Kotlin? Kotlin strictly differentiates between null and non-null types. This is great because it forces developers to consider when & where to use null. In this video, you’ll learn the basics of defining null variables, defining null parameters, and checking for null values. 0:08 How Kotlin handles null 0:30 Continue reading Learning Kotlin: nullability

Learning Kotlin: String Interpolation

Kotlin provides a lot of useful functionality for working with String data types. In this video, you’ll learn about string interpolation and how it makes working with strings much more convenient. Kotlin Documentation 1:14 Single substitution 1:41 Basic formatting 1:57 Multiple Substitutions 2:29 Complex Substitutions I love to meet/talk/discuss and help where I can. If Continue reading Learning Kotlin: String Interpolation