<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Clean Architecture on miti99</title><link>https://miti99.com/en/tags/clean-architecture/</link><description>Recent content in Clean Architecture on miti99</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 16 Nov 2026 17:39:19 +0700</lastBuildDate><atom:link href="https://miti99.com/en/tags/clean-architecture/index.xml" rel="self" type="application/rss+xml"/><item><title>Newsletter #96</title><link>https://miti99.com/en/post/2026/04/16/</link><pubDate>Thu, 16 Apr 2026 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2026/04/16/</guid><description>&lt;p&gt;&lt;em&gt;Enjoy Newsletter #96.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="clean-architecture--separation-of-concerns-trong-go"&gt;&lt;a href="https://vjerci.com/writings/clean/separation-of-concerns/" rel="noopener noreferrer"&gt;Clean Architecture → Separation of Concerns trong Go&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This article explains the principle of Separation of Concerns in Go: once a responsibility is handled in one place in the system, other parts shouldn&amp;rsquo;t have to worry about it or duplicate it. The author opens with an anti-pattern where a single handler function parses an HTTP request, validates the payload, and executes SQL queries directly. When everything is tangled together like that, changing any detail requires understanding the whole stack, and the codebase quickly becomes unmaintainable as complexity grows.&lt;/p&gt;
&lt;p&gt;The fix is splitting the service into four layers: HTTP handlers only decode requests and encode responses, Services hold pure business logic decoupled from infrastructure, Repositories handle all database queries, and Models define data structures with zero dependencies on other layers. Go makes this natural through structural typing: a struct satisfies an interface implicitly without &lt;code&gt;implements&lt;/code&gt; declarations. The author recommends giving each package a single, obvious responsibility and wiring components together via constructor dependency injection so the dependency graph is visible right in &lt;code&gt;main&lt;/code&gt;. Helpful Go tips include using your IDE&amp;rsquo;s &amp;ldquo;Find Implementations&amp;rdquo; shortcut and adding a compile-time interface check like &lt;code&gt;var _ MyInterface = (*MyStruct)(nil)&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="the-garbage-collector"&gt;&lt;a href="https://internals-for-interns.com/posts/go-garbage-collector" rel="noopener noreferrer"&gt;The Garbage Collector&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This deep dive explores Go 1.26&amp;rsquo;s garbage collector, which introduces the GreenTea GC. Go&amp;rsquo;s collector is a non-moving, concurrent, tri-color mark-and-sweep collector: because objects never move in memory over their lifetime, pointers stay valid and interoperating with &lt;code&gt;unsafe&lt;/code&gt; or C code is much simpler. Each GC cycle runs through four phases: sweep termination, concurrent mark (running alongside application goroutines and capped at roughly 25% of CPU), mark termination, and lazy sweep driven by allocation demand—pausing the program (stop-the-world) only twice for very brief intervals.&lt;/p&gt;
&lt;p&gt;GreenTea&amp;rsquo;s key innovation is queuing entire memory spans (contiguous pages holding same-sized objects) rather than individual object pointers during marking, batching marked objects together before scanning to dramatically improve CPU cache locality. When a span has more than 12.5% of its objects marked, the collector uses AVX-512 SIMD instructions on x86-64 to scan it 4–8x faster. A hybrid Yuasa–Dijkstra write barrier shades both overwritten and newly written pointers during concurrent marking so live objects are never missed. If goroutines allocate faster than background workers can mark, &lt;em&gt;mark assist&lt;/em&gt; forces allocating goroutines to do marking work themselves as backpressure. Finally, the GC Pacer schedules cycles using &lt;code&gt;GOGC&lt;/code&gt; (default 100, triggering when the heap doubles) and &lt;code&gt;GOMEMLIMIT&lt;/code&gt; (a soft memory cap for the Go runtime).&lt;/p&gt;
&lt;h2 id="the-skill-of-using-ai-agents-well"&gt;&lt;a href="https://www.lesswrong.com/posts/9xAwybDhtgzGYPnbs/the-skill-of-using-ai-agents-well" rel="noopener noreferrer"&gt;The Skill of Using AI Agents Well&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This post shares practical habits for working effectively with AI coding agents, centered on one insight: the real bottleneck is human attention, not AI capability. Accordingly, the author designs his workflow to minimize personal friction: always use the strongest frontier model at its highest reasoning setting, turn on verbose debug logging so the agent can diagnose failures on its own, and give every AI session its own isolated branch via &lt;code&gt;git worktree&lt;/code&gt; so multiple agents can run in parallel without stepping on each other&amp;rsquo;s files. Tasks that parallelize naturally—like testing five hypotheses at once—get fanned out to subagents.&lt;/p&gt;
&lt;p&gt;For permissions, he recommends whitelisting obviously safe commands, using a secondary AI classifier to auto-approve routine permission prompts, and enabling audio notifications when an agent blocks waiting for human input. Spinning up a fresh agent session purely to review a diff regularly catches bugs the authoring session missed, while a central dashboard across all active sessions makes it easy to see which agents need attention. He also delegates setup chores like spinning up test databases or driving browser UI checks entirely to agents, switches providers promptly whenever a model feels degraded, and is experimenting with cross-session memory systems—though he hasn&amp;rsquo;t found a silver bullet there yet.&lt;/p&gt;
&lt;h2 id="the-unwritten-laws-of-software-engineering"&gt;&lt;a href="https://newsletter.manager.dev/p/the-unwritten-laws-of-software-engineering" rel="noopener noreferrer"&gt;The unwritten laws of software engineering&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This piece rounds up seven unwritten laws that software engineers usually learn only after painful production incidents. First, when production breaks right after a deployment, roll back first and investigate second—don&amp;rsquo;t burn hours trying to prove your commit was innocent while users are down. Second, a backup doesn&amp;rsquo;t exist until you have successfully restored from it; you also need to know your recovery point objective, who has permissions to run the restore, and how long a restore actually takes now that the database is ten times larger. Third, logging is an eternal balancing act: either too sparse to diagnose an outage, or a noisy flood missing a shared correlation/request ID across services.&lt;/p&gt;
&lt;p&gt;Fourth, every data migration needs a tested rollback plan, because an untested rollback plan will almost certainly fail when you need it most. Fifth, every external dependency &lt;em&gt;will&lt;/em&gt; eventually fail—know its rate limits, test how your app behaves when it goes down, and prepare caches, queues, or graceful degradation; chaining two independent 99.9% services in series drops combined availability to ~99.8%. Sixth, risky production operations require the &amp;ldquo;four-eyes principle&amp;rdquo;: have a teammate watch, because simply explaining what you are about to do out loud often catches the mistake. Finally, nothing is more permanent than a temporary hack—so build a small, scoped, clean solution rather than a messy kludge.&lt;/p&gt;
&lt;h2 id="big-tech-engineers-need-big-egos"&gt;&lt;a href="https://www.seangoedecke.com/big-tech-needs-big-egos/" rel="noopener noreferrer"&gt;Big tech engineers need big egos&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Sean Goedecke pushes back against the cliché that there is no room for ego in software engineering, arguing that engineers at big tech companies actually need a healthy dose of ego to succeed. Day to day, senior engineers constantly confront their own mistakes and sprawl across codebases too vast for any one person to hold in their head—requiring stubborn self-belief that they can solve problems that look impossible at first glance. Organizationally, strong self-confidence lets an engineer stake out a clear technical position amid ambiguity, make unpopular calls that affect hundreds of peers, and push back when senior leadership misunderstands a technical constraint.&lt;/p&gt;
&lt;p&gt;The paradox is that effective big-tech engineers must also be able to set their ego aside entirely before the org chart: accepting canceled projects, losing internal political battles, or executing murky top-down priorities without becoming bitter. Goedecke calls this the &amp;ldquo;chameleon&amp;rdquo; posture—assertive with peers, yet adaptable toward hierarchy. Burnout, he argues, rarely comes from working too hard; it comes from unrewarded effort, especially when a technically sound decision gets punished because it clashed with organizational politics. Mastering that delicate balance is a big reason truly effective staff-plus engineers are so rare.&lt;/p&gt;
&lt;h2 id="sorting-algorithms"&gt;&lt;a href="https://simonwillison.net/2026/Mar/11/sorting-algorithms/" rel="noopener noreferrer"&gt;Sorting algorithms&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Simon Willison shares how he used Claude Artifacts to build an animated side-by-side visualization of classic sorting algorithms—starting with bubble sort, selection sort, insertion sort, merge sort, quicksort, and heapsort. When asked to add Timsort, Claude autonomously cloned the CPython repository from GitHub and read &lt;code&gt;Objects/listobject.c&lt;/code&gt; and &lt;code&gt;Objects/listsort.txt&lt;/code&gt; to implement it. However, when Willison asked GPT-5.4 Thinking to audit the result, it pointed out that Claude had actually written a simplified adaptive mergesort inspired by Timsort rather than the full algorithm—a great illustration of using one frontier model to cross-check another.&lt;/p&gt;
&lt;p&gt;After a few rounds of UI polish, the artifact gained a &amp;ldquo;Run all&amp;rdquo; button that races all seven algorithms simultaneously in a grid, complete with live comparison and swap counters and color-coded operations: pink for comparisons, orange for swaps, red for pivots, and purple for sorted runs. In the live race, Timsort finishes first, followed closely by quicksort and merge sort, with bubble sort trailing far behind. The post showcases how quickly modern AI tools can turn a conversational prompt into a rich, interactive learning tool.&lt;/p&gt;
&lt;h3 id="bonus"&gt;Bonus&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Images:&lt;/strong&gt;
&lt;img src="https://substackcdn.com/image/fetch/w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F438c4c2f-0fa8-4748-9953-b63fd69674f4_2508x3000.png" alt="12 Claude Code Features Every Engineer Should Know"&gt;
&lt;img src="https://substackcdn.com/image/fetch/w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e97a13-b186-4f16-ab59-f9a96867f744_1899x1536.jpeg" alt="How does REST API work?"&gt;
&lt;img src="https://substackcdn.com/image/fetch/w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0169578f-af50-4b3a-b8ed-542ee7ebf80f_2250x2814.png" alt="7 Key Load Balancer Use Cases"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Newsletter #84</title><link>https://miti99.com/en/post/2026/02/26/</link><pubDate>Thu, 26 Feb 2026 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2026/02/26/</guid><description>&lt;p&gt;&lt;em&gt;Enjoy Newsletter #84.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="automatic-programming"&gt;&lt;a href="https://antirez.com/news/159" rel="noopener noreferrer"&gt;Automatic programming&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Salvatore Sanfilippo (&lt;code&gt;antirez&lt;/code&gt;), creator of Redis, coins the term &amp;ldquo;automatic programming&amp;rdquo; for writing software with AI assistance—and believes that before long, we will simply call it &amp;ldquo;programming.&amp;rdquo; He draws a sharp line between automatic programming and &amp;ldquo;vibe coding&amp;rdquo;: in vibe coding, you hand a vague prompt to an LLM and let it generate software while you stay mostly out of the loop, only nudging it when something breaks. In automatic programming, the human programmer understands everything happening under the hood, continuously steers the model according to their own vision across every level of abstraction—from high-level architecture down to how a specific function should be implemented—and decides &lt;em&gt;what&lt;/em&gt; to build in the first place. Because of that, the same model produces vastly different results depending on who is in the driver&amp;rsquo;s seat.&lt;/p&gt;
&lt;p&gt;Sanfilippo argues that code produced this way is genuinely yours and something you have every right to be proud of. Since the training data behind these models came from humanity&amp;rsquo;s collective output, he sees LLMs more as a shared gift from humanity to itself than as theft. He points to Redis as an example: technically speaking, Redis contained very little novel computer science—just basic data structures and networking code that any competent systems programmer could write; what made Redis valuable was the product vision and taste behind it. His conclusion: programming can now be automated, but vision (for now) cannot.&lt;/p&gt;
&lt;h2 id="software-performance-engineering-the-ideas-i-keep-coming-back-to"&gt;&lt;a href="https://ricomariani.medium.com/software-performance-engineering-the-ideas-i-keep-coming-back-to-6f421b6a9505" rel="noopener noreferrer"&gt;Software Performance Engineering: The Ideas I Keep Coming Back To&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Rico Mariani distills eight performance engineering ideas he keeps returning to across decades and programming languages, centered on one core theme: performance is not about clever tricks or micro-optimizations, but a way of thinking. First, performance is a systems problem: the hardest issues almost always stem from architectural choices like excessive allocations, poor data locality, hidden synchronization, or unbounded growth rather than a single slow function. Abstractions are never free—they merely hide cost, so you need to know what they expand into and how often they run. Cost models matter more than APIs: two APIs that look identical on the surface can differ by 10x because one allocates on every call or touches cold memory. And profilers only tell you &lt;em&gt;where&lt;/em&gt; time went, not &lt;em&gt;why&lt;/em&gt; it was spent.&lt;/p&gt;
&lt;p&gt;Memory is the real bottleneck, as the speed gap between CPUs and main memory continues to widen. Meanwhile, Knuth&amp;rsquo;s famous quote that &amp;ldquo;premature optimization is the root of all evil&amp;rdquo; is routinely abused: the real sin is designing systems with zero cost awareness, which leads to &amp;ldquo;premature pessimization.&amp;rdquo; Programming languages also shape how engineers think about cost—languages that make ownership and lifetimes explicit make cost much easier to reason about. Finally, performance rarely dies in a single commit; it erodes through a thousand tiny, invisible cuts, requiring regular check-ins to verify that reality still matches your architectural intent.&lt;/p&gt;
&lt;h2 id="go"&gt;&lt;a href="https://oblique.security/blog/go-synctest/" rel="noopener noreferrer"&gt;Go&amp;rsquo;s synctest is amazing&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Eric Chiang from Oblique shares his experience using Go 1.25&amp;rsquo;s &lt;code&gt;testing/synctest&lt;/code&gt; package to test a codebase full of background control loops, such as purging expired database sessions or running distributed leader election across instances. The headline feature of &lt;code&gt;synctest&lt;/code&gt; is running tests inside an isolated &amp;ldquo;bubble&amp;rdquo; with a fake clock so &lt;code&gt;time.Sleep&lt;/code&gt; completes almost instantaneously. According to Chiang, however, its even bigger superpower is letting you deterministically reason about the &lt;em&gt;ordering&lt;/em&gt; of concurrent events. &lt;code&gt;synctest&lt;/code&gt; only advances its fake clock when every goroutine inside the bubble is durably blocked—typically on channels, wait groups, or time operations—and then advances the clock just enough to wake the shortest sleep. That lets tests use time itself as a synchronization primitive, something that would be an anti-pattern in production code; for example, a background ticker loop that runs once a minute is guaranteed to execute exactly three times after sleeping for three fake minutes.&lt;/p&gt;
&lt;p&gt;In practice, simply sleeping slightly longer than the interval of &lt;code&gt;RunDeleteExpiredSessions&lt;/code&gt; guarantees the background cleanup pass has finished before the test asserts against the database, and the entire test finishes in under a second. His team even applied &lt;code&gt;synctest&lt;/code&gt; to their database-backed leader election logic spanning dozens of concurrent loops without modifying a single line of production code, pausing execution at arbitrary points in time to inspect database state. He notes two caveats to keep in mind: understanding which operations count as &amp;ldquo;durably blocked&amp;rdquo; (network and file I/O do not) and ensuring all spawned goroutines exit cleanly before the bubble closes.&lt;/p&gt;
&lt;h2 id="why-clean-architecture-confuses-everyone-and-how-i-learned-to-stop-worrying"&gt;&lt;a href="https://dev.to/rpereira15/why-clean-architecture-confuses-everyone-and-how-i-learned-to-stop-worrying-1i5k" rel="noopener noreferrer"&gt;Why Clean Architecture Confuses Everyone (And How I Learned to Stop Worrying)&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Drawing on more than 10 years of software engineering experience, Rômulo Pereira explains why Clean Architecture confuses so many developers: teams spend hours arguing over folder structures while missing the core principle. Frameworks like Spring Boot make violating boundaries effortless—a single annotation on a domain class tightly couples your business logic to JPA, Jackson, and the framework runtime. Organizing packages by technical layer (&lt;code&gt;controller&lt;/code&gt;, &lt;code&gt;service&lt;/code&gt;, &lt;code&gt;repository&lt;/code&gt;, &lt;code&gt;model&lt;/code&gt;) also pulls you into technology-first thinking, whereas organizing by feature (&lt;code&gt;order&lt;/code&gt;, &lt;code&gt;product&lt;/code&gt;, &lt;code&gt;customer&lt;/code&gt;) keeps the focus on what the system actually &lt;em&gt;does&lt;/em&gt;. From his experience building high-volume billing systems and real-time data platforms, he argues that business logic should be &amp;ldquo;boring&amp;rdquo;: completely agnostic to where data is stored, whether requests arrive over REST or a message queue, or which framework is in use. And don&amp;rsquo;t create an interface for every class just because &amp;ldquo;Clean Architecture requires ports and adapters&amp;rdquo;—an interface that will only ever have one implementation is pure ceremony.&lt;/p&gt;
&lt;p&gt;The real litmus test is replaceability: could you swap your database, move from REST to GraphQL, or upgrade your framework without touching your core domain logic? His pragmatic approach is to write plain, annotation-free use cases and push Spring wiring to the outer boundary of the system. Instead of debating package names, ask whether your business rules are easy to unit-test in milliseconds, how many files break when you upgrade a framework, and whether a new teammate can tell what the system does at a glance. Start simple, keep business rules pure, and test them without mocking the entire world.&lt;/p&gt;
&lt;h2 id="the-third-golden-age-of-software-engineering--thanks-to-ai"&gt;&lt;a href="https://newsletter.pragmaticengineer.com/p/the-third-golden-age-of-software" rel="noopener noreferrer"&gt;The third golden age of software engineering – thanks to AI&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In this episode of &lt;em&gt;The Pragmatic Engineer&lt;/em&gt; podcast, Gergely Orosz sits down with Grady Booch, co-creator of UML and Chief Scientist for Software Engineering at IBM. Booch divides the history of computing into three &amp;ldquo;golden ages&amp;rdquo;: the first revolved around algorithms (1940s to 1970s), the second around object-oriented abstractions (1970s to 2000s), and the third—which we are in today—around systems of systems. In his view, this third age began when our unit of abstraction rose to entire libraries, frameworks, and platforms, well before the current AI wave. He reminds listeners that existential dread in software is nothing new: when compilers and high-level languages first appeared, assembly programmers feared they would be replaced, yet the profession evolved and expanded. AI coding tools simply raise the level of abstraction one step further; as he puts it, &amp;ldquo;tools change, the problems remain the same.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Booch notes that today&amp;rsquo;s AI models are trained primarily on problems that have already been solved thousands of times, making them great at automating familiar patterns like web CRUD apps while the true frontier of computing remains vast. When the industry moves at breakneck speed, strong fundamentals become more important, not less. He does acknowledge that routine software delivery plumbing is the easiest target for automation, meaning engineers in purely mechanical roles will need to upskill. His closing message: this is a moment to soar, not to fear the abyss.&lt;/p&gt;
&lt;h2 id="ai-coding-workflow"&gt;&lt;a href="https://newsletter.systemdesign.one/p/ai-coding-workflow" rel="noopener noreferrer"&gt;AI coding workflow&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In this guest post for &lt;em&gt;The System Design Newsletter&lt;/em&gt;, Louis-François Bouchard shares the workflow he uses to get reliable results from AI coding tools after realizing AI is not a &amp;ldquo;vending machine&amp;rdquo; where you paste a bug and get working production code out. His core mental model: treat AI like a brilliant new teammate who joined your project five minutes ago—it types fast and knows every language, but has zero awareness of your architecture, conventions, or constraints unless you tell it. AI works best inside a tight six-step loop: Context (supplying the README, rules files like &lt;code&gt;AGENTS.md&lt;/code&gt; or &lt;code&gt;CLAUDE.md&lt;/code&gt;, relevant files, and stack traces or logs), Plan (asking for a strategy before any code is written, because fixing a plan is much cheaper than debugging code), Code (making small, incremental changes that are easy to review), Review, Test, and Iterate.&lt;/p&gt;
&lt;p&gt;He also uses a lightweight multi-agent pattern with four distinct roles: a Planner to break down tasks and spot edge cases, an Implementer to write code strictly following the approved plan, a Tester to write unit and edge-case tests, and an Explainer to summarize what changed and why. He pairs a strong reasoning model for planning with a faster model for implementation. The post also catalogs common failure modes like context drift in long chats, hallucinated or outdated APIs, debugging death spirals, gradual codebase rot, and over-reliance on AI. The overarching rule: treat AI output as a first draft, and always rely on human review and automated tests as your safety net.&lt;/p&gt;
&lt;h3 id="bonus"&gt;Bonus&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Images:&lt;/strong&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/625a6789-c32d-4a27-a5f5-c174fb920637_2360x2960.png" alt="Git pull vs. git fetch"&gt;
&lt;img src="https://substackcdn.com/image/fetch/$s_!-Lov!,w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf928dd3-de16-4605-a702-762df269c9f2_2250x2862.png" alt="Top Authentication Techniques"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>