<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How-To Guide on Advanced Beginner</title><link>https://advanced-beginner.github.io/en/docs/kotlin/howto/</link><description>Recent content in How-To Guide on Advanced Beginner</description><generator>Hugo</generator><language>en-US</language><managingEditor>d8lzz1gpw@mozmail.com (kimbenji)</managingEditor><webMaster>d8lzz1gpw@mozmail.com (kimbenji)</webMaster><lastBuildDate>Tue, 19 May 2026 18:30:17 +0900</lastBuildDate><atom:link href="https://advanced-beginner.github.io/en/docs/kotlin/howto/index.xml" rel="self" type="application/rss+xml"/><item><title>Coroutine Debugging</title><link>https://advanced-beginner.github.io/en/docs/kotlin/howto/coroutine-debugging/</link><pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kotlin/howto/coroutine-debugging/</guid><description>&lt;p&gt;A step-by-step procedure for tracing where exceptions originate in asynchronous coroutine code and which coroutines are stuck.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Estimated time&lt;/strong&gt;: about 15-20 minutes&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;Adding the JVM option &lt;code&gt;-Dkotlinx.coroutines.debug&lt;/code&gt; shows the coroutine name in the thread name.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;CoroutineName(&amp;quot;name&amp;quot;)&lt;/code&gt; to give a coroutine a name for easy identification in logs.&lt;/li&gt;
&lt;li&gt;The IntelliJ Coroutines tab visually shows the state of every running coroutine.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DebugProbes&lt;/code&gt; from &lt;code&gt;kotlinx-coroutines-debug&lt;/code&gt; restores stack traces.&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;hr&gt;
&lt;h2 id="what-this-guide-solves"&gt;What This Guide Solves&lt;a class="anchor" href="#what-this-guide-solves"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Use this guide in the following situations:&lt;/p&gt;</description></item><item><title>Null Safety Migration</title><link>https://advanced-beginner.github.io/en/docs/kotlin/howto/null-safety-migration/</link><pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kotlin/howto/null-safety-migration/</guid><description>&lt;p&gt;Step-by-step instructions for safely handling null-related issues when porting Java code to Kotlin.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Estimated time&lt;/strong&gt;: about 15-20 minutes&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;Types coming from Java are inferred in Kotlin as &lt;strong&gt;platform types&lt;/strong&gt; (e.g., &lt;code&gt;String!&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Adding &lt;code&gt;@Nullable&lt;/code&gt;/&lt;code&gt;@NotNull&lt;/code&gt; annotations on Java code lets Kotlin infer the correct type.&lt;/li&gt;
&lt;li&gt;Handle platform types defensively with &lt;code&gt;?.&lt;/code&gt; or &lt;code&gt;?: default&lt;/code&gt; instead of &lt;code&gt;!!&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Migrate incrementally per class and verify with tests at each step.&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;hr&gt;
&lt;h2 id="what-this-guide-solves"&gt;What This Guide Solves&lt;a class="anchor" href="#what-this-guide-solves"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Use this guide in the following situations:&lt;/p&gt;</description></item><item><title>Gradle Kotlin DSL Tips</title><link>https://advanced-beginner.github.io/en/docs/kotlin/howto/gradle-kotlin-dsl-tips/</link><pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kotlin/howto/gradle-kotlin-dsl-tips/</guid><description>&lt;p&gt;Practical know-how and frequently used patterns for using Gradle Kotlin DSL effectively.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Estimated time&lt;/strong&gt;: about 10-15 minutes&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;Manage all dependency versions in one place with &lt;code&gt;libs.versions.toml&lt;/code&gt; (Version Catalog).&lt;/li&gt;
&lt;li&gt;Reuse build logic via &lt;code&gt;buildSrc&lt;/code&gt; or composite builds.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;plugins { }&lt;/code&gt; block is the modern alternative to &lt;code&gt;apply(plugin = &amp;quot;...&amp;quot;)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Keep multi-module configuration DRY with convention plugins.&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;hr&gt;
&lt;h2 id="what-this-guide-solves"&gt;What This Guide Solves&lt;a class="anchor" href="#what-this-guide-solves"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Use this guide in the following situations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When you keep copy-pasting the same Gradle configuration across modules&lt;/li&gt;
&lt;li&gt;When dependency versions are scattered across files and updates are tedious&lt;/li&gt;
&lt;li&gt;When you&amp;rsquo;re migrating from Groovy DSL to Kotlin DSL and the syntax is confusing&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="step-1-set-up-version-catalog-libsversionstoml"&gt;Step 1: Set Up Version Catalog (libs.versions.toml)&lt;a class="anchor" href="#step-1-set-up-version-catalog-libsversionstoml"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;gradle/libs.versions.toml&lt;/code&gt; is the centralized dependency-version file supported since Gradle 7.4.&lt;/p&gt;</description></item><item><title>Kotest vs JUnit</title><link>https://advanced-beginner.github.io/en/docs/kotlin/howto/kotest-vs-junit/</link><pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kotlin/howto/kotest-vs-junit/</guid><description>&lt;p&gt;Compare the Kotest and JUnit 5 stacks and walk through choosing the right one for your project and migrating between them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Estimated time&lt;/strong&gt;: about 15-20 minutes&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;JUnit 5 + AssertJ + MockK: easier for teams migrating from Java, mature Spring Boot integration&lt;/li&gt;
&lt;li&gt;Kotest: Kotlin-native style, BDD specs, built-in property-based testing&lt;/li&gt;
&lt;li&gt;Both work with Spring Boot and can even be mixed in the same project.&lt;/li&gt;
&lt;li&gt;For new pure-Kotlin projects, Kotest is recommended. For Java mix or teams in transition, JUnit 5.&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;hr&gt;
&lt;h2 id="what-this-guide-solves"&gt;What This Guide Solves&lt;a class="anchor" href="#what-this-guide-solves"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Use this guide in the following situations:&lt;/p&gt;</description></item><item><title>Performance Profiling</title><link>https://advanced-beginner.github.io/en/docs/kotlin/howto/performance-profiling/</link><pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kotlin/howto/performance-profiling/</guid><description>&lt;p&gt;Step-by-step instructions for finding and optimizing performance bottlenecks in Kotlin/JVM applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Estimated time&lt;/strong&gt;: about 20-25 minutes&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;Don&amp;rsquo;t guess — &lt;strong&gt;measure first&lt;/strong&gt;. Find real hotspots with Async Profiler or JFR.&lt;/li&gt;
&lt;li&gt;Coroutine dispatcher choice has the biggest impact. Use &lt;code&gt;Dispatchers.IO&lt;/code&gt; for I/O and &lt;code&gt;Dispatchers.Default&lt;/code&gt; for CPU.&lt;/li&gt;
&lt;li&gt;Reduce lambda capture and boxing costs with &lt;code&gt;inline&lt;/code&gt; functions and primitive types.&lt;/li&gt;
&lt;li&gt;Measurements taken before JIT warm-up don&amp;rsquo;t reflect real production performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;hr&gt;
&lt;h2 id="what-this-guide-solves"&gt;What This Guide Solves&lt;a class="anchor" href="#what-this-guide-solves"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Use this guide in the following situations:&lt;/p&gt;</description></item></channel></rss>