Homepage
Open in app
Sign in
Get started
Kotlin Stories
100 Kotlin Tips in 100 Days
YouTube
Kotlin Tip #46: Choose IntArray Over Array for Performance Efficiency — 100 Kotlin Tips in 100 Days
Kotlin Tip #46: Choose IntArray Over Array for Performance Efficiency — 100 Kotlin Tips in 100 Days
In Kotlin, choosing the right data structure is crucial for performance. When working with integer arrays, IntArray offers a significant…
Raphael De Lio
Jun 7
Kotlin Tip #45: Utilize value classes to avoid runtime overhead when wrapping values — 100 Kotlin…
Kotlin Tip #45: Utilize value classes to avoid runtime overhead when wrapping values — 100 Kotlin…
Twitter | LinkedIn | YouTube | Instagram Tip #44: Implement collection plus and minus operators for adding or removing elements
Raphael De Lio
Jun 6
Kotlin Tip #44: Implement collection plus and minus operators for adding or removing elements —…
Kotlin Tip #44: Implement collection plus and minus operators for adding or removing elements —…
Twitter | LinkedIn | YouTube | Instagram Tip #43: Use listOfNotNull for filtering null values from collections
Raphael De Lio
Jun 5
Kotlin Tip #43: Use listOfNotNull for filtering null values from collections — 100 Kotlin Tips in…
Kotlin Tip #43: Use listOfNotNull for filtering null values from collections — 100 Kotlin Tips in…
Twitter | LinkedIn | YouTube | Instagram Tip #42: Use fold and reduce for Aggregating Collection Values
Raphael De Lio
Jun 3
Kotlin Tip #42: Use fold and reduce for Aggregating Collection Values — 100 Kotlin Tips in 100 Days
Kotlin Tip #42: Use fold and reduce for Aggregating Collection Values — 100 Kotlin Tips in 100 Days
At first look, “fold” and “reduce” might look the same because both are ways to combine values in a collection. But, the difference is in…
Raphael De Lio
Mar 28
Kotlin Tip #41: Make use of the first, last, and find methods for retrieving elements — 100 Kotlin…
Kotlin Tip #41: Make use of the first, last, and find methods for retrieving elements — 100 Kotlin…
Twitter | LinkedIn | YouTube | Instagram Tip #40: Use sortBy and sortedBy for Collection Sorting
Raphael De Lio
Mar 24
Kotlin Tip #40: Explore the distinct and distinctBy for removing duplicates from collections
Kotlin Tip #40: Explore the distinct and distinctBy for removing duplicates from collections
Twitter | LinkedIn | YouTube | Instagram Tip #39: Use sortBy and sortedBy for Collection Sorting
Raphael De Lio
Mar 23
Kotlin Tip #39: Use sortBy and sortedBy for Collection Sorting — 100 Kotlin Tips in 100 Days
Kotlin Tip #39: Use sortBy and sortedBy for Collection Sorting — 100 Kotlin Tips in 100 Days
Both sortBy and sortedBy are extension functions that Kotlin offers for sorting collections. While they serve similar purposes, their…
Raphael De Lio
Mar 22
Kotlin Tip #38: Use groupBy to Organize Collections by Criteria — 100 Kotlin Tips in 100 Days
Kotlin Tip #38: Use groupBy to Organize Collections by Criteria — 100 Kotlin Tips in 100 Days
The groupBy function segregates a collection into a map, where each key represents a unique criterion, and the corresponding value is a…
Raphael De Lio
Mar 21
Kotlin Tip #37: Transforming Collections with map and flatMap — 100 Kotlin Tips in 100 Days
Kotlin Tip #37: Transforming Collections with map and flatMap — 100 Kotlin Tips in 100 Days
The map function applies a given transformation to each element in a collection, returning a list containing the results of these…
Raphael De Lio
Mar 18
Kotlin Tip #36: Use filter and filterNot to Collection filtering — 100 Kotlin Tips in 100 Days
Kotlin Tip #36: Use filter and filterNot to Collection filtering — 100 Kotlin Tips in 100 Days
The filter function allows you to specify a condition (a predicate) and returns a new collection containing only the elements that satisfy…
Raphael De Lio
Mar 17
Kotlin Tip #35: Use Tailrec for Efficient Recursion — 100 Kotlin Tips in 100 Days
Kotlin Tip #35: Use Tailrec for Efficient Recursion — 100 Kotlin Tips in 100 Days
When you mark a recursive function with the tailrec modifier, you’re giving the Kotlin compiler permission to optimize the function if…
Raphael De Lio
Mar 16
Kotlin Tip #34: Prefer Inline Classes for Wrapping Primitive Types — 100 Kotlin Tips in 100 Days
Kotlin Tip #34: Prefer Inline Classes for Wrapping Primitive Types — 100 Kotlin Tips in 100 Days
An inline class in Kotlin is defined using the inline keyword before the class declaration. Its primary purpose is to wrap another type. At
Raphael De Lio
Mar 14
Kotlin Tip #33: Using Delegation to Enhance Classes Without Inheritance — 100 Kotlin Tips in 100…
Kotlin Tip #33: Using Delegation to Enhance Classes Without Inheritance — 100 Kotlin Tips in 100…
Lazy initialization is a design pattern that delays the creation of an object, the calculation of a value, or some other expensive process…
Raphael De Lio
Mar 13
Kotlin Tip #32: Using Delegation to Enhance Classes Without Inheritance— 100 Kotlin Tips in 100…
Kotlin Tip #32: Using Delegation to Enhance Classes Without Inheritance— 100 Kotlin Tips in 100…
Delegation is a design pattern where an object hands off some responsibilities to another object. Kotlin natively supports this pattern…
Raphael De Lio
Mar 12
Kotlin Tip #31: Leverage Operator Overloading for Intuitive Code Design
Kotlin Tip #31: Leverage Operator Overloading for Intuitive Code Design
Operator overloading is achieved by implementing specific functions in your classes, each corresponding to a Kotlin operator, such as +, -,
Raphael De Lio
Mar 11
Kotlin Tip #30: Use reified type parameters to avoid type erasure — 100 Kotlin Tips in 100 Days
Kotlin Tip #30: Use reified type parameters to avoid type erasure — 100 Kotlin Tips in 100 Days
Reified type parameters allow you to access the type information at runtime by inlining the function and its type checks. Here’s how you…
Raphael De Lio
Mar 10
Kotlin Tip #29: Use Sequences to Boost Performance in Large Data Processing — 100 Kotlin Tips in…
Kotlin Tip #29: Use Sequences to Boost Performance in Large Data Processing — 100 Kotlin Tips in…
By using a sequence, no computation will happen when defining the filter operation for odd numbers or when defining the mapping operation…
Raphael De Lio
Mar 9
Kotlin Tip #28: Use assert() to assert conditions in development — 100 Kotlin…
Kotlin Tip #28: Use assert() to assert conditions in development — 100 Kotlin…
The assert() function in Kotlin evaluates a Boolean expression passed to it. If the expression evaluates to true, the program continues…
Raphael De Lio
Mar 8
Kotlin Tip #27: Use require() for argument validation in functions or constructors — 100 Kotlin…
Kotlin Tip #27: Use require() for argument validation in functions or constructors — 100 Kotlin…
The require() function in Kotlin makes sure that only correctly structured data is allowed into your constructors and functions. It checks…
Raphael De Lio
Mar 7
Kotlin Tip #26: Use error() to indicate unreachable code points — 100 Kotlin Tips in 100 Days
Kotlin Tip #26: Use error() to indicate unreachable code points — 100 Kotlin Tips in 100 Days
The error() function in Kotlin is a straightforward way to throw an IllegalStateException, signaling that a particular piece of code was…
Raphael De Lio
Mar 6
Kotlin Tip #25: Use check() for precondition validation in your code — 100 Kotlin Tips in 100 Days
Kotlin Tip #25: Use check() for precondition validation in your code — 100 Kotlin Tips in 100 Days
The check() function is designed to simplify precondition validation. It evaluates a boolean expression, and if the result is false, it…
Raphael De Lio
Mar 5
Kotlin Tip #24: Use lateinit for Late Initialization of Non-null Variables — 100 Kotlin Tips in…
Kotlin Tip #24: Use lateinit for Late Initialization of Non-null Variables — 100 Kotlin Tips in…
lateinit is a testament to Kotlin’s flexibility, offering a balance between null safety and practical usability. It simplifies handling…
Raphael De Lio
Mar 4
Kotlin Tip #23: Use type aliases to provide alternative names for existing types — 100 Kotlin Tips…
Kotlin Tip #23: Use type aliases to provide alternative names for existing types — 100 Kotlin Tips…
Type aliases in Kotlin provide a way to introduce alternative names for existing types, whether they are classes, functions, or even…
Raphael De Lio
Mar 3
Kotlin Tip #22: Use copy() to Modify Immutable Objects— 100 Kotlin Tips in 100 Days
Kotlin Tip #22: Use copy() to Modify Immutable Objects— 100 Kotlin Tips in 100 Days
The copy() function allows for the creation of a new object with some properties modified, based on an existing object…
Raphael De Lio
Mar 2
About Kotlin with Raphael De Lio
Latest Stories
Archive
About Medium
Terms
Privacy
Teams