<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Leandro Paim on Medium]]></title>
        <description><![CDATA[Stories by Leandro Paim on Medium]]></description>
        <link>https://medium.com/@leandropaim?source=rss-df4a70b79f3b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ebvEllOnilQBBb0xwhGofQ.jpeg</url>
            <title>Stories by Leandro Paim on Medium</title>
            <link>https://medium.com/@leandropaim?source=rss-df4a70b79f3b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:23:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@leandropaim/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stop Waiting for Hilt to Compile: Koin’s Case for Smart Validation]]></title>
            <link>https://leandropaim.medium.com/stop-waiting-for-hilt-to-compile-koins-case-for-smart-validation-2f6927f21df6?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f6927f21df6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 16:04:12 GMT</pubDate>
            <atom:updated>2025-12-09T16:04:50.256Z</atom:updated>
            <content:encoded><![CDATA[<p>How Koin delivers the same reliability as Hilt, without sacrificing build speed, flexibility, or your sanity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UVOnxQz1hZ_EF-AWU4Y7IA.png" /></figure><h3>The Compile-Time Safety Myth</h3><p>If you read my previous article,<a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25"> <strong><em>The Invisible Cost of Hilt</em></strong></a>, you already know the point I raised:<br>Hilt does offer safety, but it charges for it in the form of <strong>slow builds</strong>, heavy annotation processing, and a developer experience that becomes increasingly painful as your project grows.</p><p>In that article, I focused on the productivity cost. Now I want to go deeper.</p><p>Because whenever Dependency Injection comes up in an Android conversation, there’s always one statement that appears like a reflex:</p><blockquote><strong><em>“Hilt is safer because it validates everything at compile time.”</em></strong></blockquote><p>It sounds definitive, almost unquestionable.<br>And yes, there’s truth to it.<br>Hilt/Dagger analyze the entire dependency graph during compilation.<br>If anything is wrong, the compiler fails immediately.</p><p>But there’s an important detail most people ignore:</p><h3>That kind of safety comes with a price, and it’s not small.</h3><p>And the worst part: the cost is not only technical.<br>It’s time.<br>It hits flow.<br>It hits iteration.<br>It hits your team’s energy and velocity. It drains your company <strong>money.</strong></p><p>That’s why this article exists: to show that <strong>reliability is not exclusive to compile-time</strong>, and that <strong>Koin can match, and in some cases surpass, Hilt’s safety mechanisms</strong> without turning every build into an endurance challenge.</p><h3>Reliability isn’t a compile-time privilege</h3><p>The belief that “DI is only safe if it happens at compile-time” is a legacy mindset inherited from Dagger’s architecture. <strong>Hilt</strong> follows that philosophy.<br><strong>Koin</strong> challenges it.</p><p>The wrong question is:</p><blockquote><strong>“When is the graph validated?”</strong></blockquote><p>The right question is:</p><blockquote><strong><em>“How is the graph validated?”</em></strong></blockquote><p>And Koin allows you to validate everything:</p><ul><li>locally</li><li>automatically</li><li>through unit tests</li><li>with KSP</li><li>in CI/CD</li><li>with clear runtime logs</li></ul><p>All without degrading your development loop.</p><h3>1. Module validation with checkModules()</h3><p><strong>ATTENTION: this method is DEPRECATED and it is only valid if you are using Koin under the version 4.0.</strong></p><p>Koin ships with a feature that deserves more hype than it gets: checkModules().</p><p>It forces Koin to simulate the entire graph before the app runs.<br>If anything is misconfigured, you find out instantly, not through a production crash.</p><pre>class CheckModulesTest : KoinTest {<br><br>    @Test<br>    fun verifyKoinApp() {<br>        <br>        koinApplication {<br>            modules(module1,module2)<br>            checkModules()<br>        }<br>    }<br>}</pre><p>This validation catches:</p><ul><li>missing dependencies</li><li>incorrect constructor parameters</li><li>wrong scopes</li><li>duplicated definitions</li><li>circular dependencies</li></ul><p>Exactly the kind of errors Hilt would catch, but without forcing you to recompile half your project.</p><p><strong>It’s the same safety, without the compile-time tax.</strong></p><p><a href="https://insert-koin.io/docs/reference/koin-test/checkmodules">Link of CheckModules Documentation</a></p><h3>1.1 Module Validation in Koin 4.0+</h3><p>As I told you before, checkModules() was the canonical way to validate your dependency graph until <strong>Koin 4.0</strong>. Starting with <strong>Koin 4.0</strong>, this method was deprecated, not because validation became less important, but because Koin introduced <strong>a more powerful and explicit validation model</strong>.</p><p>The new recommended approach is:</p><pre>val koin = startKoin {<br>    modules(appModule, networkModule, viewModelModule)<br>}.koin<br><br>koin.verify() </pre><p>This performs:</p><ul><li>missing dependency checks</li><li>constructor validation</li><li>scope validation</li><li>duplicate definition detection</li></ul><p>Everything checkModules() used to do — now clearer and more flexible. Add this to your CI and you will see this power.</p><p><a href="https://insert-koin.io/docs/reference/koin-test/verify/">Link of verify() Documentation</a></p><h3>And if even that’s not enough…</h3><p>Some developers want <strong>absolute certainty</strong>.<br>The “everything must be initialized before anything happens” level of certainty.</p><p>Well… technically, you <em>can</em> do that:</p><pre>// The safest (and also most irresponsible) method ever created<br>fun initEverythingNow() = lazyInitAllModulesOnSplash()</pre><p>This will turn your splash screen into a <strong>White Screen Simulator </strong>LOL.</p><p>Which is why validation belongs in CI, not on your user’s first launch.</p><h3>2. CI/CD validation: Safety where it actually matters</h3><p>The right place to validate DI is <strong>not</strong> on a developer’s machine.<br>It’s the pipeline.</p><p>Local builds are inconsistent:</p><ul><li>devs compile only their module</li><li>partial builds skip validations</li><li>machines differ</li><li>caching hides issues</li><li>it takes time <em>from</em> all developers, which means Money!</li></ul><p>Hilt validates <em>per workstation </em>while<em> </em>Koin lets you validate <em>for the entire team</em>. If the graph is broken, the pipeline fails. If you write tests to check configuration, the outcome is as same as Hilt, but with a faster build time.</p><h3>3. Koin Annotations + KSP: Compile-time, but lightweight</h3><p>Since <strong>Koin 3.5+</strong>, you can opt into compile-time verification using:</p><ul><li><strong>Koin Annotations</strong></li><li><strong>Kotlin Symbol Processing (KSP)</strong></li></ul><p>This gives you:</p><p>— code generation<br> — constructor validation<br> — graph verification<br> — incremental compilation</p><p>All of Hilt’s benefits, with <strong>none of Dagger’s heavy overhead</strong>.</p><p>Example:</p><pre>@Single<br>class Repository(<br>    private val api: ApiService<br>)</pre><p>In large projects:</p><ul><li>Hilt → recompiles multiple modules</li><li>Koin/KSP → recompiles <em>only what changed</em></li></ul><p>Compile-time safety, without the suffering.</p><p><a href="https://insert-koin.io/docs/reference/koin-annotations/start">Link of Koin KSP Documentation</a></p><h3>4. Logs you can actually understand</h3><p>Dagger is infamous for its cryptic binding errors.<br>You open the stacktrace and it feels like deciphering scripture.</p><p>Koin chooses clarity instead:</p><pre>startKoin {<br>    printLogger(Level.DEBUG)<br>    modules(appModule)<br>}</pre><p>The logs tell you:</p><ul><li>which module failed</li><li>which dependency is missing</li><li>where the error originated</li><li>how to fix it</li></ul><p>It’s readability over ritual.</p><p><a href="https://insert-koin.io/docs/support/tooling/">Link of Tooling Documentation</a></p><h3>5. Summary:</h3><p>Here is a chart to illustrate this comparison</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dexx80xMuPCExAXV5qttnw.png" /></figure><blockquote><strong><em>Hilt protects you by slowing you down.<br>Koin protects you by giving you control.</em></strong></blockquote><h3>Safety by philosophy, not by imposition</h3><p>Hilt’s philosophy:</p><blockquote><em>“The compiler decides.”</em></blockquote><p>Koin’s philosophy:</p><blockquote><em>“The engineer decides — and the tool supports.”</em></blockquote><p>One assumes developers must be constrained.<br>The other assumes developers want understanding and autonomy.</p><p>This difference matters.</p><h3>💬 Final Thoughts</h3><p>Koin is not less safe, it simply has a different model of safety:<br>a model built on <strong>testing</strong>, <strong>automation</strong>, <strong>KSP</strong>, <strong>CI</strong>, and <strong>developer clarity</strong>.</p><p>You don’t need to choose between “fast builds” and “reliable DI”. You can have both.</p><p>And if you still want to initialize everything manually, well…</p><pre>fun initEverythingNow() = lazyInitAllModulesOnSplash()</pre><p>Just be prepared to ship the <strong>White Screen Simulator, </strong>as your new splash screen.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f6927f21df6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Invisible Cost of Technology Fragmentation]]></title>
            <link>https://leandropaim.medium.com/the-invisible-cost-of-technology-fragmentation-d3dc70a29354?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3dc70a29354</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 16 Sep 2025 04:01:46 GMT</pubDate>
            <atom:updated>2025-09-16T04:01:46.866Z</atom:updated>
            <content:encoded><![CDATA[<p>Multiple stacks like native, Flutter and KMP duplicate effort and inflate costs. Explore how fragmentation creates an invisible drain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYh5u9r9eJfmE7_3Q3cp3g.png" /></figure><h3>Introduction</h3><p>Choosing the right technology stack is one of the most critical decisions for any engineering team. Yet many organizations end up in a hybrid reality: part of the team building in native platforms, part using Flutter, and another experimenting with Kotlin Multiplatform.</p><p>At first, this seems harmless — after all, shouldn’t teams use the best tool for each job? But the hidden reality is that fragmentation across multiple stacks creates invisible costs. Duplicate work, inconsistent tooling, and long-term maintenance multiply expenses in ways most leaders underestimate.</p><p>This article explores the invisible cost of technology fragmentation: why low code reuse and duplicated effort silently drain budgets, and how to quantify the impact of maintaining multiple stacks.</p><h3>1. The Multiplatform Dilemma</h3><p>Modern mobile development offers three main options:</p><ul><li><strong>Native</strong> (Swift for iOS, Kotlin/Java for Android).</li><li><strong>Cross-platform frameworks</strong> (Flutter, React Native, etc.).</li><li><strong>Kotlin Multiplatform (KMP/KMM)</strong>, bridging shared logic while preserving native UIs.</li></ul><p>When companies don’t commit to a strategy, they end up with a <strong>split team</strong>. Half the features are written in native, others in Flutter, and a third team is experimenting with KMP. While it sounds innovative, this patchwork creates overlapping work and diverging codebases.</p><h3>2. The Low Reuse Trap</h3><p>The main hidden cost of fragmentation is <strong>poor code reuse</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UY1DfrmkayCGRtK7pJ0lvA.png" /></figure><p>Example:</p><ul><li>A bank app has business logic for <strong>authentication, transfers, investments, and notifications</strong>.</li><li>If developed natively, the Android and iOS teams each implement everything separately.</li><li>If Flutter is added, yet another layer of duplicated work emerges.</li></ul><p>Instead of one unified implementation, the company pays <strong>two or three times</strong> for the same feature.</p><p>Even worse, every bug fix and compliance change must be repeated across stacks. That means:</p><ul><li><strong>3x the QA effort.</strong></li><li><strong>3x the regression risk.</strong></li><li><strong>3x the long-term maintenance cost.</strong></li></ul><h3>3. Quantifying the Cost of Two Stacks</h3><p>Let’s make this concrete. Imagine a mobile feature (say, <em>“Recurring Investments”</em>) that requires:</p><ul><li><strong>2 developers × 4 weeks</strong> on Android.</li><li><strong>2 developers × 4 weeks</strong> on iOS.</li></ul><p>That’s <strong>16 developer-weeks</strong> total.</p><p>Now add Flutter into the mix:</p><ul><li>2 Flutter devs building a parallel version: another <strong>8 developer-weeks</strong>.</li></ul><p>Suddenly, the company pays <strong>24 weeks of engineering</strong> for one feature. At $80/hour fully loaded, that’s roughly <strong>$76,800</strong> — instead of $51,200 with only two stacks, or ~$25,600 with a shared approach (like KMP).</p><p>The difference is enough to fund another entire product initiative.</p><h3>4. The Maintenance Multiplier</h3><p>The cost doesn’t stop at initial development. Every update compounds the problem:</p><ul><li><strong>OS updates</strong>: Apple or Google change APIs, requiring fixes across <em>all stacks</em>.</li><li><strong>Security patches</strong>: Must be applied multiple times.</li><li><strong>New regulations (e.g., PSD2, CVM rules)</strong>: Every compliance feature needs parallel implementations.</li></ul><p>This creates a <strong>maintenance multiplier</strong>: the more stacks you maintain, the more your costs scale linearly (or worse).</p><h3>5. Fragmentation and Talent Drain</h3><p>Beyond dollars, fragmentation also drains <strong>human capital</strong>.</p><ul><li><strong>Context switching</strong>: Engineers jump between Flutter and native, reducing focus and efficiency.</li><li><strong>Skill siloing</strong>: Specialists emerge in each stack, making staffing harder.</li><li><strong>Recruiting cost</strong>: Hiring across multiple stacks inflates demand for scarce talent.</li></ul><p>The result: teams feel slower, less cohesive, and more prone to burnout.</p><h3>6. Why Companies Fall Into This Trap</h3><p>If the costs are so high, why do organizations still fragment?</p><ul><li><strong>Shiny object syndrome</strong>: Teams adopt new frameworks without a long-term plan.</li><li><strong>Legacy inertia</strong>: Old apps in native coexist with new projects in Flutter.</li><li><strong>Poor alignment</strong>: Business leaders push deadlines, forcing teams to “just ship” instead of consolidating.</li></ul><p>The irony is that this <em>appears faster in the short term</em> but creates massive long-term drag.</p><h3>7. Best Practices to Minimize Fragmentation</h3><p>Fragmentation can’t always be avoided (some legacy code will remain). But it can be managed.</p><h3>a) Commit to a Core Strategy</h3><p>Decide whether your long-term vision is native-first, cross-platform, or KMP — and stick to it.</p><h3>b) Maximize Shared Logic</h3><p>Even with two stacks, aim for shared modules in areas like networking, authentication, and domain models.</p><h3>c) Use AI and Automation</h3><p>Tools like <strong>GitHub Copilot</strong> can accelerate boilerplate work across stacks, reducing duplicated effort.</p><h3>d) Track Duplicate Work</h3><p>Make the invisible cost visible. Track how many hours are spent on duplicated features — and present the financial cost to leadership.</p><h3>e) Gradual Migration</h3><p>If adopting KMP or another shared solution, migrate incrementally. Avoid the trap of a “big bang” rewrite.</p><h3>Conclusion</h3><p>Technology fragmentation may feel like flexibility, but in practice, it’s often inefficiency disguised as innovation. Teams split across native, Flutter, and KMP burn money on duplicate work, inflate maintenance costs, and create fragile long-term ecosystems.</p><p>By quantifying the cost and aligning on a clear strategy, companies can turn this invisible drain into a competitive advantage.</p><p>The question is simple: will you keep paying for three codebases, or invest once in a unified future?</p><h3>Continue reading the series The Invisible Cost</h3><ul><li><a href="https://medium.com/@leandropaim/how-to-measure-the-invisible-cost-of-builds-in-your-team-faa9638cfdf5"><strong>The Invisible Cost of Build Times</strong></a> — how much money your team loses every time developers wait for the build to finish.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-slow-test-in-your-team-7c8c7c57e4b0"><strong>The Invisible Cost of Testing</strong></a> — why unstable tests, flaky pipelines, and manual QA burn more hours (and dollars) than you think.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25"><strong>The invisible Cost of Hilt: Rethinking DI in Entherprise Projects</strong></a> — how much money your team loses by not thinking in Dependency Injection</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-developer-onboarding-79222dbd2a8e"><strong>The invisible Cost of Developer Onboarding</strong></a> — how much money your team loses every week while new hires struggle with manual setups, outdated documentation, and missing automation.</li><li><a href="https://leandropaim.medium.com/c0055272b0c7?source=friends_link&amp;sk=8710fde4337e504b7e0f77dba37d0864"><strong>The invisible Cost of Poorly Managed Dependencies</strong></a><strong> </strong>— Manual setups, missing docs and delays make onboarding costly. See how automation and better practices reduce the invisible cost.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3dc70a29354" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Invisible Cost of Poorly Managed Dependencies]]></title>
            <link>https://leandropaim.medium.com/the-invisible-cost-of-poorly-managed-dependencies-c0055272b0c7?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0055272b0c7</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 09 Sep 2025 04:01:39 GMT</pubDate>
            <atom:updated>2025-09-09T04:01:39.325Z</atom:updated>
            <content:encoded><![CDATA[<p>The longer you postpone the update, the more expensive it becomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4Vo3QYYX-OrMlykuLsvBg.png" /></figure><h3>Introduction</h3><p>In software development, dependencies are like oxygen. They make it possible to build faster, reuse existing solutions, and avoid reinventing the wheel. But when not managed properly, dependencies turn into silent killers of productivity.</p><p>Most teams only realize this when the build breaks after a library update, or when an unplanned migration suddenly consumes weeks of effort. These moments reveal a hidden cost: every day developers are blocked by dependency issues is a day the company is burning money without progress.</p><p>This article dives into the invisible cost of poorly managed dependencies — how outdated libraries, rushed migrations, and compatibility nightmares quietly drain both time and budget.</p><h3>1. Outdated Libraries: The Silent Build Breakers</h3><p>Keeping libraries up to date often looks like “nice to have” work. After all, if the app is compiling and shipping, why risk changing something that works? The problem is that every outdated dependency is a time bomb waiting to explode.</p><h3>Real-world scenarios:</h3><ul><li><strong>Security fixes ignored</strong>: Developers postpone updates until a vulnerability forces an urgent patch, which usually breaks other dependencies.</li><li><strong>Breaking changes pile up</strong>: Skipping small incremental updates often results in one massive and painful migration.</li><li><strong>CI failures</strong>: Outdated plugins or SDKs suddenly fail to build with newer tools (e.g., Gradle, Xcode, or Kotlin versions).</li></ul><p>A single broken build can easily block a team for hours. When multiplied by 10 or 20 engineers, this translates into thousands of dollars of wasted payroll for something that could have been avoided with consistent updates.</p><blockquote><strong><em>The longer you postpone the update, the more expensive it becomes</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeBwQe_BoJGrXqwnCloiEg.png" /></figure><h3>2. Unplanned Migrations: The Hidden Black Holes</h3><p>Every mobile developer remembers the painful AndroidX migration, or the long adoption curves for Jetpack Compose, SwiftUI, or new Kotlin versions. Migrations are not just technical exercises; they represent huge hidden costs when they’re unplanned.</p><h3>Why migrations hurt more when unplanned:</h3><ul><li><strong>No strategy</strong>: Teams dive headfirst into migration because “Google said so,” without a roadmap or risk analysis.</li><li><strong>Partial adoption</strong>: Some modules move forward, others lag behind, leading to a Frankenstein codebase.</li><li><strong>Blocked development</strong>: New features get stuck because they depend on libraries incompatible with the old stack.</li></ul><p>What looks like a “two-week adjustment” often turns into months of technical debt cleanup and double maintenance.</p><h3>3. The Real Cost of Dependency Blocks</h3><p>Let’s make this concrete. Imagine a mobile team with 8 developers, each costing around <strong>$80/hour fully loaded</strong> (salary, benefits, overhead). If a dependency conflict blocks builds for just <strong>one full day</strong>:</p><ul><li>8 developers × 8 hours × $80/hour = <strong>$5,120 lost in one day</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_wEVdKdk87m4PXYsdymYA.png" /></figure><p>Now imagine this happening multiple times across a quarter due to outdated libraries or poor migration planning. The cost quickly rivals the budget of entire infrastructure projects.</p><p>And beyond direct costs, there’s also <strong>opportunity cost</strong>: those developers could have been shipping features, improving performance, or fixing bugs that matter to users.</p><h3>4. Why This Problem Persists</h3><p>Despite the obvious cost, dependency management rarely gets the same visibility as features or performance KPIs. Some reasons why:</p><ul><li><strong>Invisible work</strong>: Updating libraries or planning migrations doesn’t show immediate value to business stakeholders.</li><li><strong>Fear of breakage</strong>: Teams adopt a “if it ain’t broke, don’t fix it” mindset, until it does break.</li><li><strong>Short-term focus</strong>: Product managers prioritize features over maintenance, pushing dependency updates to the backlog.</li></ul><p>This creates a vicious cycle: neglect leads to bigger problems, which then require emergency fixes that cost even more.</p><h3>5. Breaking the Cycle: Best Practices</h3><p>To avoid the trap of poorly managed dependencies, teams need to treat them as first-class citizens of the development process. Some proven strategies:</p><h3>a) Automate Updates</h3><p>Use tools like Renovate or Dependabot to automatically raise PRs with version bumps. Even if not merged immediately, they keep visibility on what’s outdated.</p><p><strong>AI-powered updates</strong>: GitHub Copilot now goes beyond code completion — it can automatically generate pull requests to update dependencies. This shifts dependency management from a tedious, manual chore into a semi-automated process, where developers only need to review and approve changes. It reduces human error and keeps the project consistently aligned with the latest versions.</p><h3>b) Incremental Migration</h3><p>Instead of waiting for massive overhauls, plan migrations in small, controlled steps. This reduces risk and spreads the cost over time.</p><h3>c) Define a Dependency Policy</h3><p>Make it part of the culture:</p><ul><li>No dependency should lag more than two minor versions.</li><li>Every migration must include a technical plan, timeline, and rollback strategy.</li></ul><h3>d) Allocate Maintenance Budget</h3><p>Treat dependency updates as ongoing investment, not as “when we have time.” Reserve explicit time in sprints for technical maintenance.</p><h3>e) Monitoring &amp; Dashboards</h3><p>Track dependency age, update frequency, and blocked builds as metrics. This makes the invisible cost visible to leadership.</p><h3>6. Making the Business Case</h3><p>Dependency management isn’t just a technical hygiene issue — it’s a financial one. By framing the cost in dollars instead of commits, teams can get leadership buy-in.</p><p>Example pitch:</p><blockquote><em>“If we invest two developer-weeks now to migrate, we’ll avoid an estimated $30,000 of blocked work in the next quarter.”</em></blockquote><p>Numbers like that speak the language of executives far better than “our Gradle build keeps failing.”</p><h3>Conclusion</h3><p>Dependencies are the backbone of modern software, but when neglected, they silently erode productivity and inflate costs. Outdated libraries break builds, unplanned migrations consume months, and every day of blockage translates into thousands of dollars wasted.</p><p>The good news is that with proactive policies, automation, and business-oriented framing, teams can transform dependency management from a hidden liability into a competitive advantage.</p><p>The invisible cost is real — the question is whether your team is willing to pay it in fire drills and wasted payroll, or invest upfront in doing it right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nq5sX7xUYauW5FxsFEsvSQ.png" /></figure><h3>Continue reading the series The Invisible Cost</h3><ul><li><a href="https://medium.com/@leandropaim/how-to-measure-the-invisible-cost-of-builds-in-your-team-faa9638cfdf5"><strong>The Invisible Cost of Build Times</strong></a> — how much money your team loses every time developers wait for the build to finish.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-slow-test-in-your-team-7c8c7c57e4b0"><strong>The Invisible Cost of Testing</strong></a> — why unstable tests, flaky pipelines, and manual QA burn more hours (and dollars) than you think.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25"><strong>The invisible Cost of Hilt: Rethinking DI in Entherprise Projects</strong></a> — how much money your team loses by not thinking in Dependency Injection</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-developer-onboarding-79222dbd2a8e"><strong>The invisible Cost of Developer Onboarding</strong></a>— how much money your team loses every week while new hires struggle with manual setups, outdated documentation, and missing automation.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0055272b0c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Invisible Cost of Developer Onboarding]]></title>
            <link>https://leandropaim.medium.com/the-invisible-cost-of-developer-onboarding-79222dbd2a8e?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/79222dbd2a8e</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 04:01:37 GMT</pubDate>
            <atom:updated>2025-09-02T04:01:37.472Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cW5mIPsTg8LkoVBRkjch9A.png" /></figure><h3>Introduction</h3><p>You’ve probably seen this before: a new developer joins the team, excited to start contributing, but immediately hits the first wall — <strong>setting up their local environment</strong>.</p><p>Days (sometimes weeks) are lost fighting dependency errors, downloading SDKs, managing environment variables, or trying to figure out why the build keeps failing.</p><p>And here’s the kicker: this wasted time almost never shows up in official productivity reports. But the cost is very real. In large teams, it can quickly translate into tens of thousands of dollars lost every year.</p><h3>1. The time drain of setup</h3><p>Configuring a local environment sounds trivial, but in practice, it’s a maze. Common scenarios include:</p><ul><li>Conflicts between <strong>Java, Node, or Kotlin</strong> versions.</li><li>Dependencies that only work inside the <strong>corporate network</strong>.</li><li>Mock APIs that aren’t documented (or don’t exist anymore).</li><li>Missing or outdated environment variables.</li><li>Documentation that was written once in 2019 and hasn’t been updated since.</li></ul><p>When setup takes <strong>3 to 5 days</strong>, a developer’s onboarding experience starts with frustration instead of productivity. Even worse, teammates often need to stop what they’re doing to help, multiplying the cost of the delay.</p><p><strong>Real-world example</strong>: if a dev spends 40 hours (one week) configuring their environment, that’s 40 hours of wasted cost. At $25/hour, that’s $1,000. At $100/hour (a realistic cost in many companies), that’s <strong>$4,000 burned before a single useful line of code is written</strong>.</p><h3>2. Manual vs. automated onboarding</h3><p>The biggest trap is relying on <strong>manual setup steps</strong>. A README with 30 commands is basically an invitation for things to break: a missing dependency, the wrong version, or a library that doesn’t exist anymore.</p><p>Now compare that with teams that invest in automation:</p><ul><li><strong>Setup scripts</strong> (make setup or ./gradlew bootstrap) that do the work for you.</li><li><strong>Containers</strong> using docker-compose, ensuring the environment is identical across machines.</li><li><strong>Cloud-based environments</strong> (GitHub Codespaces, Gitpod, or internal tools) where a new dev can open the project in the browser and start coding right away.</li></ul><p><strong>Time comparison:</strong></p><ul><li>Manual setup → 3 to 5 days.</li><li>Automated setup → a few hours.</li></ul><p>The difference seems small for one person, but at scale, it’s huge.</p><h3>3. The hidden financial impact</h3><p>Let’s talk numbers.</p><p>Imagine a team of <strong>10 developers</strong>, each costing around <strong>$100/hour</strong>.</p><ul><li>If each new dev loses <strong>40 hours</strong> setting up their environment, that’s <strong>$4,000 per person</strong>.</li><li>If the company hires <strong>5 new devs per year</strong>, that’s <strong>$20,000 annually</strong> wasted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5NpZecHSPk3-4WyjKPMlYQ.png" /></figure><p>And that’s a conservative estimate. In larger organizations, with dozens of hires every year, the hidden onboarding cost can easily surpass the budget of an entire infrastructure project.</p><p>And remember, the impact isn’t just financial:</p><ul><li>Developers start their journey frustrated and demotivated.</li><li>Existing team members lose time helping troubleshoot.</li><li>The company’s reputation as a “difficult place to work” grows.</li></ul><p>This makes the onboarding bottleneck not just a <strong>financial problem</strong>, but also a <strong>cultural and strategic one</strong>.</p><h3>4. How to reduce the invisible cost</h3><p>The good news: this problem is solvable. Here are practical strategies that make a difference:</p><h3>a) Keep documentation alive</h3><p>A README should be <strong>short, up-to-date, and tested regularly</strong>. If nobody has followed the setup guide in months, it’s probably broken.</p><h3>b) Automate the setup</h3><p>One command to install dependencies, configure environment variables, and bootstrap the project.<br>For example:</p><pre>make setup</pre><h3>c) Use containers or standardized environments</h3><p>Docker, docker-compose, or cloud environments. This eliminates the “works on my machine” problem and guarantees consistency.</p><h3>d) Guided onboarding with a buddy</h3><p>Pair new developers with a mentor for the first few days. This reduces friction without creating long-term dependency.</p><h3>e) Tools to accelerate test flows</h3><p>Provide <strong>shortcuts in staging environments</strong> — like logins that jump directly to a specific app screen without going through the entire customer journey. In multi-repository apps, this can mean logging directly into a module, cutting down onboarding and testing time dramatically.</p><h3>5. Why this matters</h3><p>Many managers focus on traditional metrics: time-to-market, bugs in production, app performance. Rarely does anyone ask:</p><p><strong>How much does each lost week of developer onboarding cost us?</strong></p><p>Ignoring this hidden cost is essentially accepting wasted money and talent at the very start of a developer’s journey.</p><p>On the flip side, investing in automation, containers, and better onboarding practices isn’t a luxury — it’s a productivity multiplier. It pays off in faster delivery, happier developers, and real financial savings.</p><h3>Conclusion</h3><p>Developer onboarding isn’t just a formality. It’s the first impression a company gives its new hires — and the moment where it proves whether it values people’s time or not.</p><p>Every wasted hour fighting with environment variables or outdated SDKs is <strong>burned money and drained motivation</strong>.</p><p>If you still think spending a few days “just to get the project running” is fine, do the math. Chances are, the invisible cost of onboarding in your company already equals hiring one more developer each year.</p><blockquote><strong>One-line takeaway:</strong><br><em>Slow onboarding isn’t inevitable — it’s a process bug that costs real money, and fixing it is one of the smartest investments a team can make.</em></blockquote><h3>Continue reading the series The Invisible Cost</h3><ul><li><a href="https://medium.com/@leandropaim/how-to-measure-the-invisible-cost-of-builds-in-your-team-faa9638cfdf5"><strong>The Invisible Cost of Build Times</strong></a> — how much money your team loses every time developers wait for the build to finish.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-slow-test-in-your-team-7c8c7c57e4b0"><strong>The Invisible Cost of Testing</strong></a> — why unstable tests, flaky pipelines, and manual QA burn more hours (and dollars) than you think.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25"><strong>The invisible Cost of Hilt: Rethinking DI in Entherprise Projects</strong></a> — how much money your team loses by not thinking in Dependency Injection</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79222dbd2a8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Invisible Cost of Slow Test in Your Team]]></title>
            <link>https://leandropaim.medium.com/the-invisible-cost-of-slow-test-in-your-team-7c8c7c57e4b0?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c8c7c57e4b0</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 04:03:33 GMT</pubDate>
            <atom:updated>2025-08-26T04:03:33.285Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7kNeTOe5q8LONi58fN44Xw.png" /></figure><h4>Introduction</h4><p>After exploring the <strong>invisible cost of build times</strong>, it’s time to address another hidden bottleneck draining money and productivity from mobile teams: <strong>slow tests</strong>.</p><p>Tests are essential — they bring confidence, prevent production bugs, and sustain app quality. But when poorly structured, they become a silent enemy of productivity. Every extra second a test takes to run multiplies across dozens of executions, hundreds of pipelines, and thousands of builds per month.</p><p>The result? A financial cost that rarely shows up in management reports — but weighs heavily on the company’s budget.</p><h3>1. Where is the time going?</h3><p>Not all tests are created equal, and each type comes with a different cost:</p><ul><li><strong>Unit tests</strong>: fast, usually milliseconds.</li><li><strong>Integration tests</strong>: heavier, often dependent on mocks, databases, or APIs.</li><li><strong>UI/Instrumentation tests</strong>: the real villains — they can take minutes, require emulators or physical devices, and often block entire pipelines.</li></ul><p>In many teams, the balance is wrong: dozens of UI tests for every unit test. This creates a false sense of coverage while massively inflating costs.</p><h3>2. The multiplier effect</h3><p>A test that takes 3 minutes to run doesn’t seem too bad. But let’s do the math:</p><ul><li>100 UI tests, each averaging 3 minutes.</li><li>Total time: 300 minutes (5 hours).</li><li>If the suite runs for every pull request, and the team opens 15 PRs per day, that’s <strong>75 hours/day of execution</strong> just for UI tests.</li></ul><p>Even with parallel execution in CI/CD, the bottom line is simple: more time and resources consumed → higher infra costs and slower feedback loops.</p><h3>3. Idle time is also a cost</h3><p>Slow tests don’t just affect infrastructure — they also slow down <strong>development cadence</strong>:</p><ul><li><strong>PRs pile up</strong> waiting for feedback.</li><li><strong>Developers lose context</strong> while waiting for pipelines.</li><li><strong>Rework increases</strong>, since the longer the gap between coding and test feedback, the harder it is to recall implementation details.</li></ul><p>This idle time never shows up in dashboards, but it translates directly into wasted engineering hours.</p><h3>4. Converting time into money</h3><p>Here’s a simple calculation:</p><ul><li>UI test suite takes 2h to run in CI/CD.</li><li>20 runs per day.</li><li>Cloud infra cost: <strong>$0.10/min per executor</strong>.</li><li>Developer cost: <strong>$38/hour</strong>.</li></ul><p>Over 22 business days:</p><ul><li>Infra: 2h × 20 runs × 22 days = <strong>880h/month</strong> → <strong>$5,280/month</strong>.</li><li>Idle developer time: 15 devs × 15min/day = <strong>82.5h/month</strong> → <strong>$3,135/month</strong>.</li></ul><p>Total: <strong>over $8,400/month</strong> just for maintaining a slow test suite.</p><h3>5. The human impact</h3><p>Like build times, slow tests also create a psychological toll:</p><ul><li><strong>Frustration</strong>: no one enjoys waiting 2h for PR feedback.</li><li><strong>Broken flow state</strong>: devs context-switch or get distracted.</li><li><strong>Testing culture decay</strong>: if tests take too long, devs avoid running them locally or even start skipping them in CI.</li></ul><p>Over time, this erodes trust in the test strategy and reduces overall quality.</p><h3>6. Strategies to cut the invisible cost</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1oEq_YADAy8XOhvxHl6Zw.png" /></figure><p>Some common practices help reduce the burden:</p><ul><li><strong>Well-balanced test pyramid</strong>: 70% unit, 20% integration, 10% UI.</li><li><strong>Parallel execution</strong>: break large suites into smaller, faster jobs.</li><li><strong>Lightweight or headless emulators</strong>.</li><li><strong>Contract tests and API mocks</strong> instead of full environment dependencies.</li><li><strong>Selective execution</strong>: run only tests impacted by a given change.</li><li><strong>Observability</strong>: track per-test execution times to spot bottlenecks.</li></ul><h3>7. Turning data into decisions</h3><p>Just like with build times, measurement is key. Translating test slowness into dollar values makes conversations with leadership easier:</p><ul><li>Justify shifting UI tests into faster unit/integration tests.</li><li>Argue for CI/CD infra investment.</li><li>Dedicate time to refactor slow tests.</li></ul><p>Example pitch to management:</p><blockquote><em>“If we reduce our average test suite runtime from 2h to 40min, we save ~$5,000/month in infra and productivity. That investment pays off in less than two months.”</em></blockquote><h3>8. Three practical levers to slash testing time</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KonZdxY63Di8rS5PCmnRUw.png" /></figure><h3>8.1 Mock backend (determinism &gt; instability)</h3><p>QA environments crash, data gets inconsistent, latency adds noise. A <strong>mock backend</strong> reduces flakiness and accelerates feedback:</p><ul><li>Deterministic: same responses every time → stable tests.</li><li>Parallelizable: each CI job spins up its own mock server.</li><li>Reproducible: devs run the same scenarios locally.</li></ul><p>Useful tools: <strong>MockWebServer</strong>, <strong>WireMock</strong>, or <strong>Apollo Mock Server</strong> (GraphQL).</p><h3>8.2 Hot reload and fast feedback</h3><p>Fewer rebuilds = more iteration speed.</p><ul><li><strong>Compose Live Edit</strong> / <strong>Apply Changes</strong> for UI.</li><li><strong>Dev menus</strong> for environment switching, resetting app state, navigating via deep links — all without rebuilds.</li><li><strong>Dependency hot-swap</strong> in dev flavors.</li></ul><p>Rule of thumb:</p><blockquote>Anything that currently forces you to rebuild is a candidate for an in-app dev menu feature.</blockquote><h3>8.3 QA Jumpers: skipping long journeys</h3><p>Flows like onboarding, multi-factor auth, or KYC explode test time. In staging/QA, provide shortcuts:</p><ul><li><strong>Deep links</strong> to open specific screens directly.</li><li><strong>Magic QA logins</strong> that grant a session with predefined claims.</li><li><strong>State presets</strong> in Dev Menu to skip straight to target states.</li></ul><p>In multi-repo apps, each module can expose routes + fake data, enabling isolated testing without walking the full global journey.</p><p><strong>Security</strong>: ensure these are strictly non-prod (debug/QA flavors only) and gated with BuildConfig + CI lint checks.</p><h3>9. How much does this save?</h3><p>A conservative scenario:</p><ul><li>Without jumpers: 5min per scenario × 30 scenarios/day × 15 devs = <strong>2,250min/month (37.5h)</strong>.</li><li>With jumpers/mocks/hot reload: 60% reduction → <strong>15h/month</strong>.</li><li>At $38/h: <strong>~$855/month saved</strong>, not counting infra and morale improvements.</li></ul><h3>Conclusion</h3><p>Tests are essential, but slow tests can quietly drain <strong>time, money, and team morale</strong>.</p><p>The good news: solutions like <strong>mock backends, hot reload, and QA jumpers</strong> provide immediate and measurable gains.</p><blockquote>If your tests are slow, the biggest bug in your app might not be in the code — but in the time you’re wasting waiting for it.</blockquote><h3>Continue reading the series The Invisible Cost</h3><ul><li><a href="https://medium.com/@leandropaim/how-to-measure-the-invisible-cost-of-builds-in-your-team-faa9638cfdf5"><strong>The Invisible Cost of Build Times</strong></a> — how much money your team loses every time developers wait for the build to finish.</li><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25"><strong>The invisible Cost of Hilt: Rethinking DI in Entherprise Projects</strong></a> — how much money your team loses by not thinking in Dependency Injection</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c8c7c57e4b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Times Cost: The Hidden Price for Dev Teams]]></title>
            <link>https://leandropaim.medium.com/build-times-cost-the-hidden-price-for-dev-teams-faa9638cfdf5?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/faa9638cfdf5</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 04:02:01 GMT</pubDate>
            <atom:updated>2025-08-19T04:02:01.538Z</atom:updated>
            <content:encoded><![CDATA[<p>Waiting for builds drains developer productivity and budget. Learn how to measure and reduce the hidden cost of build times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xI2moFjN80-0QTvSIMSFyA.png" /></figure><h3>Introduction</h3><p>After the debate about <a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25">Koin vs Hilt</a>, it became clear that build time can be a silent villain in mobile teams’ productivity. But how do we turn this perception into something measurable — something that can be discussed with managers and translated into financial impact?</p><p>This is where the concept of measuring the invisible cost of builds comes in.</p><p>Many companies still focus only on metrics like time-to-market, production bugs, or app performance indicators. But rarely does anyone ask the question: <strong><em>how much does every minute a developer spends waiting for a build actually cost?</em></strong></p><p>That cost, while invisible, can be massive — and in large teams, it can reach figures that rival entire infrastructure projects.</p><h3>1. Identify the most frequent build points</h3><p>Before talking about money, we need to know where the time is going. The key points to monitor are:</p><ul><li>Local builds run by developers throughout the day.</li><li>Instrumented tests that trigger rebuilds.</li><li>CI/CD pipelines, usually running multiple builds in parallel.</li><li>Hotfixes and releases, which often require additional compilations.</li></ul><blockquote>Useful tools: Gradle Enterprise, Build Analyzer (Android Studio), Jenkins metrics, GitHub Actions, GitLab CI, or internal DevOps dashboards.</blockquote><p>The first step is visibility: if no one measures it, <strong>the problem never shows up.</strong></p><h3>2. Calculate the average build time</h3><p>Take a representative sample — for example, one week. Track:</p><ul><li>How long does a full build take?</li><li>How long does an incremental build take?</li><li>How often does each type run?</li></ul><p><strong>Example (fictional):</strong></p><ul><li>Full build: 7 minutes (once a day).</li><li>Incremental build: 1m20s (10 times a day).</li><li>Average daily time per dev ≈ <strong>20 minutes.</strong></li></ul><p>It may seem small, but when multiplied across the team, it becomes significant.</p><h3>3. Multiply by team size</h3><p>Now scale it to the entire team.</p><p><strong>Example:</strong></p><ul><li>Team with 12 devs × 20 minutes/day = 240 minutes (4h) lost per day.</li><li>In 22 business days = 88h/month.</li></ul><p>These 88 hours don’t show up in any project management spreadsheet, but they represent time that could have been spent delivering features, fixing bugs, or generating value for the customer.</p><h3>4. Convert into financial cost</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vm_BCEawO8ok41s3Jx5iCg.png" /></figure><p>To give the number weight, translate hours into money. Use the average hourly cost of a developer — whether by salary + benefits, or consulting rates.</p><p><strong>Example:</strong></p><ul><li>$36/hour × 88h ≈ $3,168/month in waiting time.</li><li>In a year, that’s nearly $38k.</li></ul><p>And that’s just for a single team of 12 devs. Imagine the impact on an app with dozens of squads.</p><p>This is the invisible cost of builds: it doesn’t show up in the spreadsheets, but it’s draining the company’s budget every month.</p><h3>5. Compare technology scenarios</h3><p>The real power of the metric comes from comparison.</p><p><strong>Example:</strong></p><ul><li>Scenario A (with DI X): 20 min/day → $3,168/month.</li><li>Scenario B (with DI Y): 8 min/day → $1,267/month.</li></ul><p>Difference: more than $1,900/month saved just by choosing a different technology.</p><p>This type of analysis also applies to other decisions:</p><ul><li>Use of heavy annotation processors.</li><li>Number of Gradle modules.</li><li>Caching strategies in CI/CD.</li><li>Adoption of incremental annotation processing or KSP.</li></ul><h3>6. Consider the human impact</h3><p>Not all costs can be measured in dollars. Build time also impacts:</p><ul><li><strong>Team morale:</strong> waiting for long builds is frustrating.</li><li><strong>Focus:</strong> devs get distracted, lose their flow, and take longer to resume tasks.</li><li><strong>Context switching:</strong> constant interruptions lead to more mistakes and lower code quality.</li></ul><p>Work psychology studies show that focus loss can multiply the <em>real</em> cost of each minute of waiting. A 5-minute build can turn into 15 minutes of lost productivity.</p><h3>7. Bring the numbers to the decision table</h3><p>With concrete data, it’s much easier to advocate for change:</p><ul><li>Managers understand financial impact.</li><li>Developers understand productivity impact.</li><li>Executives see return on investment.</li></ul><p>This can justify:</p><ul><li>Adopting a different DI library.</li><li>Investing in faster CI/CD servers.</li><li>Refactoring modules or adopting distributed build caches.</li></ul><h3>8. Build a complete business case</h3><p>A well-structured business case can be simple:</p><ol><li>Current average build time × number of devs → monthly cost.</li><li>Estimated reduction with proposed improvement.</li><li>Return on investment (ROI) calculation.</li></ol><p><strong>Example:</strong></p><ul><li>Investment: $6k in CI/CD infrastructure.</li><li>Savings: $1.9k/month in build time.</li><li>ROI: less than 4 months.</li></ul><p>This kind of argument is much more persuasive than simply saying: <strong><em>“the build is slow.”</em></strong></p><h3>Conclusion</h3><p>Build time isn’t just a developer’s pain point — it’s a business strategy issue. Measuring the invisible cost is the first step toward making the problem visible and guiding smarter choices.</p><p>Companies that neglect this factor may be throwing away hundreds of thousands of dollars every year. On the other hand, those that measure, monitor, and optimize can turn an invisible bottleneck into a real competitive advantage.</p><blockquote>If you’re not measuring build costs in your team yet, chances are you’re already paying a high price for it — without even noticing.</blockquote><h3>Continue reading the series The Invisible Cost</h3><ul><li><a href="https://medium.com/@leandropaim/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25"><strong>The invisible Cost of Hilt: Rethinking DI in Entherprise Projects</strong></a> — how much money your team loses by not thinking in Dependency Injection</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faa9638cfdf5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Invisible Cost of Hilt: Rethinking DI in Enterprise Projects]]></title>
            <link>https://leandropaim.medium.com/the-invisible-cost-of-hilt-rethinking-di-in-enterprise-projects-1f24ae6cdc25?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f24ae6cdc25</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Sat, 16 Aug 2025 16:23:58 GMT</pubDate>
            <atom:updated>2025-08-16T16:23:58.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRoYMKdsQKPtgE-bLAkI2g.png" /></figure><h3>Introduction</h3><p>I recently read Mohit Dubey’s article <a href="https://medium.com/@mohit2656422/hilt-vs-koin-android-2025-ad27d3b00f85"><em>Hilt vs Koin Android 2025</em></a> (an excellent piece, by the way — I highly recommend it), which brings an interesting comparison between the two most widely used dependency injection frameworks in Android today. I agree with much of the analysis — but I’d like to discuss a point I consider mistaken or, at the very least, limited: the idea that Koin is only suitable for small or medium-sized apps.</p><p>This idea is commonly accepted in the community, based on Hilt’s runtime performance. But what if I told you that using Koin in a large-scale application could actually save your company a lot of money?</p><h3>Koin vs. Hilt</h3><p>Before diving into how the choice of a DI (Dependency Injection) library can reduce your costs, let’s revisit the main differences between Koin and Hilt. I don’t intend to go too deep into this topic since it’s widely covered in the community, including in the article mentioned above. Otherwise, this would just be another piece repeating the same points.</p><p>In short, both are excellent solutions and continue to evolve with each release. Hilt uses a build-time dependency injection approach, scanning your entire codebase and generating classes (Factories) whenever it finds annotations. Example below:</p><pre>import javax.inject.Inject<br><br>class MyAdapter @Inject constructor()</pre><p>When you write this annotation, the compiler generates classes inside your artifact at build time. In the case of Dagger, it adds the file MyAdapter_Factory, which contains the information needed to create an instance of MyAdapter:</p><pre><br>class CompositeAdapterFactory : Factory&lt;CompositeAdapter&gt; {<br><br>    override fun get(): CompositeAdapter {<br>        return newInstance()<br>    }<br><br>    companion object {<br>        fun newInstance(): CompositeAdapter {<br>            return CompositeAdapter()<br>        }<br>    }<br>}</pre><p>The upside is that when the app runs, all dependencies are already resolved — ensuring very high runtime performance and compile-time type safety. On the other hand, this scanning, code generation, and dependency graph validation process has a cost: compilation time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_P-ZPAEbbo7-4joClr4bA.png" /></figure><h3>And here’s where Hilt’s “invisible cost” begins.</h3><h3>The time you don’t see, but pay for</h3><p>In large enterprise projects, with dozens of modules and hundreds of bindings, build time can become a bottleneck. Every modification that requires a rebuild (even a partial one) goes through Hilt’s annotation processor again. If you work in a team that:</p><ul><li>Builds multiple times a day</li><li>Runs instrumentation tests frequently</li><li>Maintains CI/CD pipelines with multiple build stages</li></ul><p>… then all this accumulated compilation time turns into real cost.</p><p>Let’s take a practical example:<br>Imagine a team of 10 developers, each performing an average of 5 local builds per day. If using Hilt increases build time by just 40 seconds per build compared to Koin, this results in:</p><p>40s x 5 builds x 10 devs = 2,000 seconds/day ≈ 33 minutes/day<br>33 minutes/day x 22 workdays ≈ 12 hours/month<br>12 hours/month x developer hourly cost ≈ 💸</p><p>If a developer’s hourly cost is R$200, that’s almost R$2,400/month wasted just in build waiting time — not even counting CI/CD costs, where each extra build also consumes cloud resources.</p><h3>Koin: runtime that pays off</h3><p>Koin, since it doesn’t rely on annotation processing or code generation, has significantly faster builds. Dependency graph resolution is done at runtime, using a pure Kotlin DSL:</p><pre>val appModule = module {<br>    single&lt;ApiService&gt; { ApiServiceImpl() }<br>}</pre><p>This means:</p><ul><li>Changing dependencies or creating modules doesn’t require heavy recompilation</li><li>Structural changes in the DI graph are applied instantly</li><li>Greater agility to prototype, validate hypotheses, and respond to business changes</li></ul><p>It’s true that Koin tends to be slightly slower in runtime dependency injection (a few extra milliseconds in cold start). But in most enterprise apps, this is imperceptible to the user — while the build time difference is felt by the entire team, every single day.</p><h3>So where does the invisible cost come in?</h3><p>In corporations, team productivity equals money. An app that starts up 30ms faster might look nice in lab measurements, but if that tech choice slows down development cadence and increases delivery time, the financial impact can outweigh any perceived runtime performance gain.</p><p>Hilt’s invisible cost isn’t in execution — it’s in the development cycle.</p><p>And if your company delivers dozens of releases per month, with multiple squads working on the same app, this difference can be the line between an agile team and one always “waiting for the build to finish.”</p><h3>So is Koin always better?</h3><p>No. When runtime performance and compile-time type checking are top priorities, Hilt (Dagger) often has the edge. It generates AOT code, resolves the graph before execution, and eliminates the cost of reflection/lookup at runtime.</p><h3>When Hilt may be the better choice</h3><ul><li><strong>Critical cold start</strong>: apps where every millisecond counts (e.g., fintechs with minimal splash screens, transportation apps that must show map/location quickly).</li><li><strong>“Zero-latency” flows</strong>: camera capture/preview, image/video processing, media players and pipelines.</li><li><strong>Constrained devices</strong>: Wear OS, Android TV, Automotive/embedded systems, or entry-level hardware with limited CPU/memory.</li><li><strong>Huge graphs with many bindings</strong> where structural errors need to be caught at compile-time, not runtime (large teams with lots of parallel module work).</li><li><strong>Background workflows sensitive to latency</strong>: Jobs/Workers that wake up rarely but must execute immediately (e.g., frequent syncs, critical alarms).</li><li><strong>Strict security/stability requirements</strong> demanding fail-fast at build time (e.g., healthcare, payments, regulated enterprise apps).</li></ul><h3>Examples</h3><ul><li><strong>Hilt preferable</strong>: real-time filter camera app; banking app that opens with biometric authentication and must instantly render dashboard; TV app with fast zapping between channels; car companion app that initializes BLE/CanBus services at boot.</li><li><strong>Koin preferable</strong>: large corporate super-app with dozens of squads and weekly releases; apps with lots of feature/module experimentation where the graph changes often; B2B apps focusing on fast delivery and iteration.</li></ul><h3>Conclusion</h3><p>Hilt and Koin are both excellent tools, each with their own strengths.</p><p>But labeling Koin as “only for small apps” oversimplifies the discussion. In enterprise contexts, where development cost, agility, and maintainability matter just as much as runtime performance, Koin can be not only viable but strategically advantageous.</p><p>Maybe your company’s next “big” app doesn’t need Hilt to be fast.<br>It needs Koin to be agile.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f24ae6cdc25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[O custo invisível do Hilt: repensando DI em projetos corporativos]]></title>
            <link>https://leandropaim.medium.com/o-custo-invis%C3%ADvel-do-hilt-repensando-di-em-projetos-corporativos-8dff33a37bb9?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dff33a37bb9</guid>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 14:06:44 GMT</pubDate>
            <atom:updated>2025-08-13T14:06:44.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvbZjmbdqhRFojmqGlAOvQ.jpeg" /></figure><h3>Introdução</h3><p>Recentemente li o artigo <a href="https://medium.com/@mohit2656422/hilt-vs-koin-android-2025-ad27d3b00f85">Hilt vs Koin Android 2025</a> do Mohit Dubey (excelente artigo por sinal. Recomendo a leitura), que traz um comparativo interessante entre os dois frameworks de injeção de dependência mais usados no Android hoje. Concordo com grande parte da análise — mas gostaria de discutir um ponto que considero equivocado ou, no mínimo, limitado: <strong>a ideia de que Koin serve apenas para apps pequenos ou médios.</strong></p><p>Esta idea é comumente aceita pela comunidade, partindo do princípio da performance em runtime do Hilt. Mas e se eu te disse que ao utilizar Koin em uma aplicação de grande porte você pode economizar muito dinheiro para a sua empresa?</p><h3>Koin vs. Hilt</h3><p>Antes de aprofundar como a escolha de uma biblioteca de DI (Dependency Injection) pode reduzir o seu custo, vamos retomar as principais diferenças entre Koin e Hilt. Não pretendo aprofundar muito nesse tópico pois ele é amplamente explorado na comunidade, incluindo esse citado na introdução desse artigo. Então seria só mais um artigo demonstrando os mesmos tópicos.</p><p>Em resumo, ambas são excelente soluções e vêm evoluindo release a release. Hilt usa uma abordagem de injeção de dependência em tempo de build, varrendo todo o código de sua aplicação e criando classes (Factory) quando encontra annotation no código. Segue um exemplo abaixo:</p><pre>import javax.inject.Inject<br><br>class MyAdapter @Inject constructor()</pre><p>Ao escrever esta anotação, o compilador gerar classes dentro do seu artefato em tempo de build. No caso do Dagger, é adicionado o arquivo <em>&quot;MyAdapter_Factory&quot;, </em>que contém as informações necessárias para criar uma instância de<em> MyAdapter</em></p><pre><br>class CompositeAdapterFactory : Factory&lt;CompositeAdapter&gt; {<br><br>    override fun get(): CompositeAdapter {<br>        return newInstance()<br>    }<br><br>    companion object {<br>        fun newInstance(): CompositeAdapter {<br>            return CompositeAdapter()<br>        }<br>    }<br>}</pre><p>O ponto positivo é que, quando o aplicativo roda, todas as dependências já estão resolvidas — isso garante <strong>performance de execução muito alta</strong> e <strong>segurança de tipos</strong> em tempo de compilação. Por outro lado, esse processo de varredura, geração de código e validação do grafo de dependências tem um custo: <strong>tempo de compilação</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g1tLEl71m5ynJqCgEU_p6Q.png" /></figure><p>E é aqui que começa o “custo invisível” do Hilt.</p><h3><strong>O tempo que você não vê, mas paga</strong></h3><p>Em projetos corporativos grandes, com dezenas de módulos e centenas de bindings, o tempo de build pode se tornar um gargalo. Cada modificação que exige rebuild (mesmo que parcial) passa novamente pelo processador de anotações do Hilt. Se você trabalha em um time que:</p><ul><li>Faz builds múltiplas vezes por dia</li><li>Executa testes de instrumentação com frequência</li><li>Mantém pipelines de CI/CD com múltiplos estágios de build</li></ul><p>… o tempo gasto nessas compilações acumuladas <strong>vira custo real</strong>.</p><p>Vamos a um exemplo prático:</p><p>Imagine um time de 10 desenvolvedores, cada um fazendo em média 5 builds locais por dia. Se o uso de Hilt aumenta o tempo de build em apenas <strong>40 segundos</strong> por compilação em comparação com Koin, isso resulta em:</p><p>40s x 5 builds x 10 devs = 2.000 segundos/dia ≈ 33 minutos/dia</p><p>33 minutos/dia x 22 dias úteis ≈ 12 horas/mês</p><p>12 horas/mês x custo/hora dev ≈ 💸</p><p>Se o custo/hora de um desenvolvedor é R$ 200, estamos falando de quase <strong>R$ 2.400/mês</strong> só de tempo de espera em builds — e isso <strong>sem contar o custo do CI/CD</strong>, onde cada build extra também consome recursos da nuvem.</p><h3><strong>Koin: o runtime que compensa</strong></h3><p>O Koin, por não depender de annotation processing nem geração de código, tem builds significativamente mais rápidas. Toda a resolução do grafo de dependências é feita em <strong>runtime</strong>, usando uma DSL em Kotlin pura:</p><pre>val appModule = module {<br>    single&lt;ApiService&gt; { ApiServiceImpl() }<br>}</pre><p>Isso significa:</p><ul><li>Alterar dependências ou criar módulos <strong>não exige recompilação pesada</strong></li><li>Mudanças estruturais no grafo de DI são aplicadas instantaneamente</li><li>Maior agilidade para prototipar, validar hipóteses e responder a mudanças de negócio</li></ul><p>É verdade que o Koin tende a ser <strong>ligeiramente mais lento</strong> na injeção de dependências em runtime (milissegundos a mais no cold start). Mas, na maioria dos apps corporativos, isso é imperceptível para o usuário — enquanto a diferença de tempo de build é sentida por todos no time, todos os dias.</p><h3><strong>E onde entra o custo invisível?</strong></h3><p>Em corporações, produtividade de time é dinheiro. Um aplicativo que inicializa 30ms mais rápido pode até agradar em uma medição de laboratório, mas se essa escolha tecnológica <strong>reduz a cadência de desenvolvimento</strong> e aumenta o tempo de entrega, o impacto financeiro pode ser maior que qualquer ganho de performance percebido pelo usuário final.</p><p>O custo invisível do Hilt não está na sua execução — está no ciclo de desenvolvimento.</p><p>E, se a sua empresa entrega dezenas de versões por mês, com várias equipes mexendo no mesmo app, essa diferença pode ser a linha que separa um time ágil de um time sempre “esperando o build acabar”.</p><h3>Então o Koin será sempre melhor?</h3><p>Não. Quando performance em tempo de execução e verificação de tipos em compile-time são prioridades máximas, Hilt (Dagger) costuma levar vantagem. Ele gera código AOT, resolve o grafo antes de rodar e elimina o custo de reflexão/lookup em runtime.</p><p>Quando o Hilt pode ser a melhor escolha</p><p><strong>Cold start crítico:</strong> apps onde cada milissegundo importa na abertura (ex.: fintechs com splash mínimo, apps de transporte que precisam mostrar mapa/posição rapidamente).</p><p><strong>Cenários “latência-zero” no fluxo principal:</strong> capture/preview de câmera, processamento de imagem/vídeo, players e pipelines de mídia.</p><p><strong>Dispositivos restritos:</strong> Wear OS, Android TV, Automotive/embarcados ou hardware de entrada onde CPU e memória são limitados.</p><p><strong>Grafos enormes com muitos bindings</strong> onde erros estruturais precisam ser pegos na compilação, não na execução (times grandes com muita paralelização de módulos).</p><p><strong>Workflows em segundo plano sensíveis a latência: </strong>Jobs/Workers que acordam raramente e precisam executar imediatamente (ex.: sincronizações curtas e frequentes, alarmes críticos).</p><p>Aplicativos com requisitos severos de segurança e estabilidade que exigem fail fast em build (ex.: saúde, pagamentos, apps enterprise regulamentados).</p><h3><strong>Exemplos de recorte</strong></h3><p><strong>Hilt preferível: </strong>app de câmera com filtros em tempo real; app de banco que abre com autenticação biométrica e precisa renderizar dashboard “instantaneamente”; app de TV com zapping rápido entre canais; companion app de carro que inicializa serviços BLE/CanBus no boot.</p><p><strong>Koin preferível:</strong> super-app corporativo com dezenas de squads e releases semanais; aplicativo com muita experimentação de features/módulos, onde o grafo muda sempre; apps B2B com foco em velocidade de entrega e iteração.</p><h3><strong>Conclusão</strong></h3><p>Hilt e Koin são ferramentas excelentes, cada uma com suas forças.</p><p>Mas rotular o Koin como “apenas para apps pequenos” é simplificar demais a discussão. Em contextos corporativos, onde custo de desenvolvimento, agilidade e manutenção são tão importantes quanto a performance do runtime, o Koin pode ser não apenas viável, mas <strong>estrategicamente vantajoso</strong>.</p><p>Talvez o próximo “grande” app da sua empresa não precise de um Hilt para ser rápido. Ele precise de um Koin para ser ágil.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dff33a37bb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Como funciona o Hot Reload no KMP?]]></title>
            <link>https://leandropaim.medium.com/como-funciona-o-hot-reload-no-kmp-7f21f16f6495?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f21f16f6495</guid>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 20:17:41 GMT</pubDate>
            <atom:updated>2025-07-15T20:19:51.924Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Entendendo o Hot Reload: O que o Kotlin precisa compilar para te dar feedback instantâneo</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L0n6LfXWJxSXrxrpSHodNw.jpeg" /></figure><p><strong>1. Introdução</strong></p><p>O conceito de <em>Hot Reload</em> tem revolucionado a forma como desenvolvedores interagem com seus ambientes de desenvolvimento. Ao permitir que alterações no código sejam refletidas quase instantaneamente na interface ou comportamento da aplicação, ele reduz drasticamente o ciclo de feedback e aumenta a produtividade. No entanto, esse tipo de funcionalidade não é trivial de implementar em linguagens compiladas como Kotlin. Neste artigo, exploramos as entranhas do compilador Kotlin para entender os desafios técnicos e as abordagens em andamento para viabilizar um Hot Reload mais eficiente.</p><p><strong>2. O Compilador Kotlin em Alto Nível</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*iDrYldTiLJoZ917TAcKSxw.png" /></figure><p>O compilador Kotlin é dividido em módulos que operam em fases distintas:</p><ul><li><strong>Parsing:</strong> transforma o código-fonte em uma árvore de sintaxe abstrata (AST).</li><li><strong>Análise Semântica:</strong> resolve tipos, inferências, e verifica a validade do código.</li><li><strong>IR (Intermediate Representation):</strong> cria uma representação intermediária unificada entre os backends.</li><li><strong>Code Generation:</strong> gera bytecode JVM, código JS ou binários nativos.</li></ul><p>Com a introdução do <em>K2</em>, o novo frontend do compilador, a JetBrains visa acelerar essas fases e facilitar integrações com ferramentas modernas como Compose Multiplatform e Live Preview.</p><p><strong>3. Por que Hot Reload é Difícil</strong></p><p>Diferente de linguagens interpretadas ou com VM altamente dinâmicas (como Dart ou JavaScript), o Kotlin requer uma compilação estática que transforma o código em artefatos finais prontos para execução. Isso implica:</p><ul><li><strong>Tempo de build:</strong> mesmo com incremental compilation, o linking e a geração de artefatos pode ser lenta.</li><li><strong>Limitações do class loader:</strong> para JVM, mudar classes em tempo de execução é restrito.</li><li><strong>Linkagem estática em Native:</strong> em KMP, especialmente com Kotlin/Native, não há VM e a linkagem é estática.</li></ul><p>Esses fatores tornam mais desafiadora a substituição de código em tempo de execução.</p><p><strong>4. Estratégias para Acelerar Feedback</strong></p><p>Para contornar essas limitações, algumas abordagens foram adotadas:</p><ul><li><strong>Compilação Incremental:</strong> detecta quais arquivos foram alterados e recompila apenas o mínimo necessário.</li><li><strong>Snapshots no Jetpack Compose:</strong> em Android, o Compose usa snapshots de estado para permitir que mudanças em funções composables sejam aplicadas em tempo de execução.</li><li><strong>Live Preview (Compose Multiplatform):</strong> compila partes da UI isoladamente para renderizar sem executar a aplicação inteira.</li><li><strong>Gradle Configuration Cache e Parallel Tasks:</strong> reduzem o tempo de build.</li></ul><p>Apesar dessas técnicas, o ciclo ainda pode ser lento em projetos multiplataforma com muitos targets.</p><p><strong>5. Comparando com Flutter</strong></p><p>O Dart, utilizado pelo Flutter, roda em uma VM com introspecção poderosa e suporte nativo a injeção de código em tempo de execução. Isso permite Hot Reload quase instantâneo, pois:</p><ul><li>O estado da aplicação é preservado.</li><li>O código novo é “injetado” no runtime.</li><li>Não há necessidade de linkagem ou reboot do processo.</li></ul><p>Essa arquitetura é muito diferente da usada por Kotlin, mas inspira soluções como reloading via plugins, snapshots, ou simulação de VM no Kotlin/Native.</p><p><strong>6. Conclusão</strong></p><p>O Hot Reload é um sonho antigo em ambientes com linguagens compiladas, em especial para programadores Android e IOS. No ecossistema Kotlin, apesar das dificuldades impostas pela arquitetura estática, há avanços promissores. Entender o funcionamento interno do compilador é essencial para diagnosticar gargalos e buscar soluções criativas. Com a evolução de ferramentas como o K2, Compose Multiplatform e os recursos do Gradle, estamos cada vez mais perto de ter um ciclo de desenvolvimento fluido, mesmo em ambientes multiplataforma.</p><p>A experimentação com snapshots, compilação incremental, live previews e outras técnicas é o caminho para trazer o Hot Reload de verdade ao mundo Kotlin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f21f16f6495" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why should you consider using Kotlin Multiplatform]]></title>
            <link>https://leandropaim.medium.com/why-should-you-consider-using-kotlin-multiplatform-4d28ce71530d?source=rss-df4a70b79f3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d28ce71530d</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Leandro Paim]]></dc:creator>
            <pubDate>Sat, 28 Jun 2025 15:07:15 GMT</pubDate>
            <atom:updated>2025-08-03T22:06:10.687Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Let’s Talk About the Age-Old Mobile Debate: Native? Hybrid?</strong></p><p>We’ve all been through the never-ending discussion in the mobile community: Native or Hybrid? And the answer is always that classic developer favorite — “it depends.” But how long will it keep depending? And to what extent?</p><p>Well, Kotlin Multiplatform (KMP) is here to throw more wood on the fire — or maybe just cloud the sky a little more.</p><h3>The Challenges of Mobile Development</h3><p>Building apps for more than one platform (thankfully Windows Phone is gone, LOL) has always been a huge challenge. Duplicated effort, inconsistent bugs, differences in business logic and UI, and the complexity of maintaining two codebases only grow as the product evolves.</p><p>Now, when we’re talking about apps with heavy business logic and complex UI behavior — like banking, e-commerce, health, or delivery apps — these problems become a significant cost to companies. Cross-platform frameworks have been trying to solve this for years, but they rarely deliver on their promises without sacrificing something along the way.</p><p>Cordova, Xamarin, Ionic, React Native, Flutter… one hype after another. So, is Kotlin Multiplatform just another trend in this never-ending cycle?</p><p>To my surprise, I’d say a big NO.</p><p>Kotlin Multiplatform (KMP) enters the scene as a mature and pragmatic solution — allowing you to share only what really matters in your app: a component, a business rule, an internal framework, or even the entire app. If you haven’t considered this approach yet, you might be wasting time.</p><p>In this article, I’ll break down what KMP is, its benefits, potential use cases, when (and when not) to use it, and why it could be the ideal choice for teams aiming for efficiency without sacrificing quality, usability, or long-term maintainability.</p><h3><strong>What is Kotlin Multiplatform?</strong></h3><p>Kotlin Multiplatform (KMP) is a technology created by JetBrains (the makers of Kotlin) that lets you share code across multiple platforms — Android, iOS, desktop, web, and even backend.</p><p>Unlike solutions like Flutter or React Native, KMP doesn’t try to unify all the layers. The idea is to only share the parts of the app that can be reused safely — things like business logic, API communication, encryption, caching, formatting, components, and even some views.</p><p>A typical KMP architecture looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPkoWXMEAudt5IYB1osakg.png" /></figure><p>This means your Android and iOS teams can continue working on native UIs, while the business logic, networking, data mapping, and validation layers are unified — a huge advantage over other hybrid technologies.</p><h3>Why Does That Matter?</h3><p>Pure native development offers great performance and UX — but it’s expensive. You need two specialized teams, constant rework, and a high risk of inconsistent behavior between iOS and Android. There’s also the challenge of unbalanced seniority between teams, knowledge silos, and duplicated bugs.</p><p>KMP aims to balance this equation by giving developers freedom: you keep native performance while avoiding duplicated work by sharing logic where it makes sense.</p><h3>What Are the Possibilities?</h3><p>Flexibility is the key to KMP’s growing success. Depending on your app type, team size, project maturity, and goals, you can adopt different strategies with KMP.</p><p>Example: In a large modular project with mixed teams and a well-established design system, it may make sense to share only the logic layers.</p><p>On the other hand, for smaller teams, refactoring efforts, or brand-new modules, going all-in with 100% KMP can significantly accelerate development without compromising performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cj0CTu518gQZS2Ucs1wzvA.png" /><figcaption>Layer Architecture of a KMP project with shared logic</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20tOoHU1LJ8SJVMhtbEaBg.png" /><figcaption>Layer Architecture of a KMP project with shared logic and UI</figcaption></figure><h3>KMP Architecture Examples:</h3><p><strong>1. KMP with Shared Logic Only</strong><br>Great for larger teams who want to share the core but keep native UI flexibility.</p><p><strong>2. KMP with Shared Logic + UI</strong><br>Works well in smaller teams, MVPs, or highly aligned teams aiming for maximum reuse.</p><h3>Advantages of KMP</h3><h4>1. Real Business Logic Sharing</h4><p>With KMP, you write your business logic once — using Kotlin — and reuse it across platforms. This includes:</p><ul><li>Networking (API calls)</li><li>JSON parsing and serialization</li><li>Data and caching layers (e.g., SQLDelight, Realm)</li><li>Validations and business rules</li><li>Formatting (dates, currencies, text)</li><li>File handling and encryption</li></ul><p>The result? Fewer bugs, no inconsistencies, and no duplicated effort. Write once, test once, deploy confidently.</p><h4>2. Native Performance</h4><p>Since KMP compiles to native code (Kotlin/Native for iOS, JVM for Android), performance is nearly identical to writing directly in Swift or Kotlin. No JavaScript bridges, no heavy VMs, no third-party engines.</p><p>This means lightweight, fast, memory-efficient apps.</p><h4>3. Easy Integration with Existing Projects</h4><p>You don’t need to start from scratch to use KMP. You can integrate shared KMP modules into existing native apps — gradually. This lets teams test it in production with minimal risk.</p><p>For instance, start by sharing the HTTP layer and data mapping. Later, expand to caching, validation, and complex business logic.</p><h4>4. Growing Ecosystem and Tooling</h4><p>JetBrains has heavily invested in KMP in recent years, and it now has official support from Google (especially for Android).</p><p>The ecosystem is expanding, including tools like:</p><ul><li><strong>Ktor / Ktorfit</strong> — for networking</li><li><strong>NativeCoroutines</strong> — for async code</li><li><strong>SQLDelight / Room</strong> — for cross-platform persistence</li><li><strong>Koin / Kodein</strong> — for dependency injection</li><li><strong>Voyager / Decompose</strong> — for navigation with Compose</li></ul><p>Today, building production-ready apps with KMP is not only possible — it’s being done.</p><h4>5. Real-World Adoption</h4><p>Companies like Netflix, Cash App, Philips, McDonald’s, Duolingo, Autodesk, VMware, and Yandex are already using KMP in production.</p><p>In Brazil, fintechs, banks, and mobility companies are also jumping in — especially for critical modules where consistency is key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y49PNJdNSKD_AOhJMYRKVA.png" /></figure><h3>Comparison with Other Approaches</h3><p>Let’s stir the pot a bit more.</p><p>KMP opens a new dimension in the mobile tech discussion. Beyond just Native vs. Hybrid, we now have something in between: Multiplatform.</p><p>I’ve used Flutter as a benchmark below, but this applies to most hybrid solutions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZmTdhvGEKzwfqx9mmxacw.png" /></figure><h3>When (Not) to Use KMP?</h3><p><strong>Use KMP if:</strong></p><ul><li>Your Android and iOS apps share a lot of business logic</li><li>You need high performance and native integration</li><li>Your team already knows Kotlin</li><li>You want to reduce bugs and increase platform consistency</li><li>You plan to scale and maintain the codebase long-term</li></ul><p><strong>Avoid KMP if:</strong></p><ul><li>You’re building a quick MVP or a very simple app</li><li>Your team has zero Kotlin experience and won’t invest in learning it</li></ul><h3>Ideal Use Cases</h3><p>KMP shines in:</p><ul><li><strong>Fintechs &amp; Banking:</strong> business logic, financial simulations, validations</li><li><strong>E-commerce:</strong> cart rules, discounts, shipping logic, payment flows</li><li><strong>Health Apps:</strong> scheduling, plan rules, notifications</li><li><strong>Internal Tools:</strong> less focus on custom UI, more on consistent data and rules</li></ul><h3>And What About the Future?</h3><p>JetBrains has big plans for Kotlin to become a universal tech ecosystem. With Google pushing Jetpack Compose forward, KMP is gaining even more credibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXN2JWgdpeuQEC2RWAmgdQ.png" /></figure><p>Kotlin is already being used for:</p><ul><li><strong>Backend</strong> (Ktor, Spring)</li><li><strong>Desktop</strong> (Compose for Desktop)</li><li><strong>Web</strong> (Kotlin/JS)</li></ul><p>This “Kotlin Everywhere” vision is becoming a reality — and KMP is at the center of it.</p><p>Will this make KMP immune to becoming “just another trend”? Not necessarily. But unlike past frameworks that relied entirely on volunteer communities, KMP has a long-term business perspective — and solid backing.</p><h3>Conclusion</h3><p>Kotlin Multiplatform is a mature, modern, and highly efficient solution for cross-platform mobile development.</p><p>It gives you the best of both worlds: shared logic with native user experience. It’s ideal for scaling mobile products without multiplying teams, bugs, and rework.</p><p>If you’re already using Kotlin on Android, moving to KMP is a natural step. And even if you’re not, the investment might just pay off.</p><p>Start small: pick an isolated feature, create a KMP module, set up a mini design system, and see the benefits firsthand. You might be surprised — just like I was — by how much your codebase can evolve with less effort than you expect.</p><p>And if you’ve already tried KMP, share your experience in the comments — it might help other developers consider this powerful tool too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d28ce71530d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>