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 type.

💻 Examples:

'typealias UserId = String'

You can then substitute ‘UserId’ where you would otherwise use ‘String’. To the compiler, they both are treated the same.

📚 Reference:

Thoughts, questions, tips on type aliases in Kotlin? Comment below or share on social media. I’d love to continue the conversation.


I love to meet/talk/discuss and help where I can. If you want to chat or ask a question you can follow me on Twitter, YouTube, Instagram and Facebook.

Check Out My YouTube Channel

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
  • 1:26 Understand what happens without ‘const’
  • 1:44 Add ‘const’ keyword
  • 2:05 Create top-level, const val

Thoughts, questions, tips on using ‘const’ in Kotlin? Comment below or share on social media. I’d love to continue the conversation.


I love to meet/talk/discuss and help where I can. If you want to chat or ask a question you can follow me on Twitter, YouTube, Instagram and Facebook.

Check Out My YouTube Channel

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 love to continue the conversation.


I love to meet/talk/discuss and help where I can. If you want to chat or ask a question you can follow me on Twitter, YouTube, Instagram and Facebook.

Check Out My YouTube Channel

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 Forces us to think about handling null
  • 0:58 Define null variables
  • 2:40 Define null function parameter
  • 3:10 Checking for null
  • 4:20 Elvis operator
  • 5:40 Null-safe call
  • 6:01 Non-null asserted call

Thoughts, questions, tips for handling null in Kotlin? Comment below or share on social media. I’d love to continue the conversation.


I love to meet/talk/discuss and help where I can. If you want to chat or ask a question you can follow me on Twitter, YouTube, Instagram and Facebook.

Check Out My YouTube Channel

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 you want to chat or ask a question you can follow me on Twitter, YouTube, Instagram and Facebook.

Check Out My YouTube Channel