Generics in Kotlin
I love template in C++ in the olden day. In many good languages that I had chance to come across, such as TypeScript, Java (it was added later) and Kotlin, they too also have the Generic code. Generi…
87 posts · page 4 of 11
I love template in C++ in the olden day. In many good languages that I had chance to come across, such as TypeScript, Java (it was added later) and Kotlin, they too also have the Generic code. Generi…
When I started doing Kotlin, the one that confused me the most was scope functions. However, once I understand what it is, it becomes my most favorite Kotlin feature. It makes code clear, concise and…
Using try, catch and finally blocks for resource cleanup is tedious and error-prone. In fact, Kotlin has a library functions that could help us to manage cleanup for us.
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
What is Nothing in Kotlin? Does it even exist? A Nothing return type indicates a function that never returns. This is usually a function that always throws an exception.
Check Instructions are like assert - they act like a constraints that must be met before it could proceed. Usually, they are used to validate function arguments and results. Check instructions typica…
If debugging is the process of removing software bugs, then programming must be the process of putting them in.
If you don't need to tie member functions to the object, consider for companion object. Regular class elements can access the elements of the companion object, but the companion object elements canno…