<?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 Korbinian Schleifer on Medium]]></title>
        <description><![CDATA[Stories by Korbinian Schleifer on Medium]]></description>
        <link>https://medium.com/@korbinian.schleifer.cs?source=rss-f05e8c6e8324------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yEtMWWTM_rGV2YBR45ixpA.jpeg</url>
            <title>Stories by Korbinian Schleifer on Medium</title>
            <link>https://medium.com/@korbinian.schleifer.cs?source=rss-f05e8c6e8324------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:35:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@korbinian.schleifer.cs/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[Developer Skills in the Age of AI]]></title>
            <link>https://medium.com/comsystoreply/developer-skills-in-the-age-of-ai-bfa451c16743?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfa451c16743</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 12:26:01 GMT</pubDate>
            <atom:updated>2026-10-05T12:26:01.515Z</atom:updated>
            <content:encoded><![CDATA[<p>How can we stay relevant with the rise of AI? Which skills will still matter in the future?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_P2K7QKRcNxq0xpG" /><figcaption>Photo by <a href="https://unsplash.com/@cherrydeck?utm_source=medium&amp;utm_medium=referral">Cherrydeck</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>AI coding tools are changing software delivery. As software developers, most of us are now writing less code. But still, software development does not collapse into clicking “accept” on generated changes.</p><p>Instead, it shifts toward understanding problems, shaping direction, making trade-offs, and building the conditions in which generated code can become reliable software.</p><p>So the interesting question is what stays difficult when code generation gets cheaper?</p><p>That matters for developers, teams, and hiring. If the daily work changes, the valuable skills change with it. Not completely, and not overnight. But enough that we should carefully assess and investigate the current direction.</p><blockquote><strong>In an AI-assisted environment, implementation does not disappear, but the differentiating work moves upstream into discovery and downstream into operational ownership.</strong></blockquote><p>Developers still build. They also need to ask better questions, define the right constraints, evaluate outcomes, and understand the delivery system deeply enough to make generated output deployable.</p><h3>Thinking in Extremes</h3><p>The future is probably not a “dark software factory” where humans vanish from the loop completely. It is also probably not a world where nothing meaningful changes and developers keep working exactly as before. The likely reality is in the middle.</p><p>That middle ground is important because it changes how we prepare people. <strong>If we assume AI will do everything, we underinvest in human judgment. If we assume AI changes nothing, we underinvest in new working modes and new operating skills.</strong></p><p>So what will developers do in two years? Will they still be needed? Yes, but probably they will spend significantly less time on manual implementation, a.k.a. Coding.</p><p>This is a better framing than the usual replacement debate. <strong>It focuses on task distribution, not job extinction.</strong> It asks where the hard parts move. And that is usually <strong>where real engineering work begins.</strong></p><h3><strong>The First Skill: Problem Understanding</strong></h3><p><strong>Finding and understanding the real problem is non-trivial.</strong> If implementation becomes faster, weak problem framing becomes more expensive, not less.</p><p>We like to call this step “understand and discover”. This is useful for us because it separates problem work from production work. Before anything is generated, built, or deployed, someone still needs to figure out where the actual problem is, what constraints matter, and what the outcome should look like.</p><p><strong>This is where experienced developers already create disproportionate value. They can tell the difference between a feature request and a user problem. They know when requirements are incomplete. They notice when a request hides an architectural decision, an organisational issue, or a product ambiguity.</strong> AI may help explore options, but it does not remove the need for someone to own the diagnosis.</p><p><strong>Many stakeholders do not fully know what they want in advance and often need to discover it through the process. This is the reason why Agile was invented. In practice, it means developers need stronger discovery skills, not just faster hands on the keyboard</strong>.</p><h3><strong>From Builder to Enabler</strong></h3><p>Another useful distinction is between people who work close to requirements and domain questions, and “enablers” who create the platform, infrastructure, governance, and operational conditions that let teams move safely.</p><p>That distinction is not entirely new. Teams have always had people with stronger architecture, platform, or DevOps focus. AI amplifies the need for this enabling layer. If more code can be produced more quickly, the surrounding system matters even more. Someone has to define guardrails, workflows, access patterns, review structures, and runtime expectations.</p><p>In other words, speed at generation increases the value of systems that prevent chaos.</p><p>One possible direction might be “DevOps for AI”. The label may still be fuzzy, but the concern behind it is concrete: ownership, process, access, workflows, and the operational side of AI-assisted development need people who understand both software delivery and the enabling platform around it.</p><p>This does not reduce engineering depth. It raises the bar for where depth is needed. We still need people who understand architecture, deployment, infrastructure, and development lifecycle mechanics. If you do not understand how infrastructure works, you cannot reliably make the output deployable.</p><h3>Stick to the Fundamentals</h3><p>One of the risks in AI-assisted development is the temptation to mistake generated output for understanding. Tooling may help with transfer, speed, or task support, but developers still need to understand basic concepts and fundamentals. This applies at multiple levels:</p><h4><strong>Framework and platform knowledge</strong></h4><p>Useful depth may become more specific, not more generic. Developers need to understand the framework, the stack, and the software delivery lifecycle in their actual team context. Remembering the exact syntax might be less relevant.</p><h4><strong>Delivery system knowledge</strong></h4><p>Generated code is not valuable until it fits into a real path to production. That includes testing, packaging, deployment, operational constraints, and maintainability. Understand the process that turns changes into something deployable.</p><h4><strong>Evaluation skills</strong></h4><p>Evaluation is a critical ability. Developers need to inspect outputs, spot errors, interpret whether a solution matches the actual need, and learn from mistakes to further deepen their evaluation skills.</p><p>This is the part that often gets lost in productivity discussions. Faster output is only useful if someone can judge quality. Otherwise teams just accelerate rework.</p><h3>Healthy Team Dynamics</h3><p>The role landscape may polarise more clearly, but the essential ingredients of a healthy engineering team remain familiar (cross-functional team). There are still people with DevOps strengths, still people with architecture understanding, and still people who can work deeply with requirements and domain complexity. Agentic engineering is not going to replace these capabilities.</p><p>Also, assembling these teams will get a bigger focus. Which skills do we need? What are the right people for the team? How do we make sure everyone is aligned and working towards the same goal?</p><p>So the fundamentals for creating the right environment for a team to work effectively will stay. Team Topologies and Agile methodologies will stay relevant. But in the end it is still all about the value that is created. After all as software developers, someone still has to pay for our salary.</p><h3><strong>What This Means for Upskilling and Interviews</strong></h3><p>If we believe the work is shifting, we should change how we assess people. And applicants should change how they prepare.</p><p>A reasonable takeaway is that upskilling should cover more than tool usage. Knowing how to prompt a coding assistant is useful, but it is not enough. Teams also need to train:</p><ul><li>problem framing and discovery</li><li>architecture and trade-off reasoning</li><li>delivery lifecycle and deployability</li><li>evaluation of generated output</li><li>ownership of workflows, permissions, and operational boundaries</li></ul><p><strong>For individual developers, this has a practical implication. Career growth is less about staying near raw code output alone and more about becoming strong in at least one of these leverage areas while keeping enough implementation skill to stay grounded.</strong></p><p>Interviews may need a similar shift. If real engineering value moves toward problem understanding and responsible delivery, then interviews should not overfocus on isolated implementation exercises. They should also test how candidates clarify ambiguity, reason about system constraints, evaluate incomplete solutions, and connect code to operations.</p><h3>Ownership and Risk</h3><p>I recently started reading “Extreme Programming Explained” by Kent Beck. And it came with this great quote:</p><blockquote>The basic problem of software development is risk.</blockquote><p>To manage risk you need someone to take ownership of the outcome and the potential of failure. This becomes even more relevant with the rise of AI. Someone needs to be held accountable for all the new code and all the new features. Ultimately that needs to be us as Software Developers.</p><p>But I don’t see doing this as a risk in itself. It’s a chance to grow and expand your current reach and to learn new skills in the process.</p><p>So go out there and take ownership for bigger tasks, bigger projects and bigger challenges!</p><h3><strong>Conclusion</strong></h3><p>If AI assistance keeps improving, developers will probably spend less time on some forms of manual implementation and more time on higher-leverage engineering work. Coding will still matter. However, coding alone will become a weaker proxy for value. (It probably never was a good proxy to begin with).</p><p>The skills that stay are not revolutionary. Understand the problem. Ask better questions. Know the system you are changing. Evaluate output critically. Own what reaches production. Help create the team environment in which speed is useful instead of dangerous.</p><h3><strong>What’s next</strong></h3><p>If your organisation is currently experimenting with AI-assisted development, this is a good moment to review <strong>how work is actually changing</strong>. Look at your delivery flow, your interview loops, and your upskilling plans. If they still optimise mainly for manual implementation speed, they may already be lagging behind the way engineering value is shifting.</p><p>A practical next step is to run an internal workshop around three questions:</p><ol><li><strong>Which tasks are getting cheaper?</strong></li><li><strong>Which responsibilities are becoming more important?</strong></li><li><strong>Which skills do we need to train deliberately?</strong></li></ol><p>The answers will probably tell you more than any abstract debate about whether AI replaces developers.</p><p><a href="https://www.comsystoreply.de/en">If you are planning to do such a workshop, then feel free to reach out. We’re here to help.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfa451c16743" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/developer-skills-in-the-age-of-ai-bfa451c16743">Developer Skills in the Age of AI</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic Engineering Best Practices: Results of our 2-day summit]]></title>
            <link>https://medium.com/comsystoreply/agentic-engineering-best-practices-results-of-our-2-day-summit-2e62a44f545c?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e62a44f545c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 12:07:53 GMT</pubDate>
            <atom:updated>2026-08-19T12:07:53.887Z</atom:updated>
            <content:encoded><![CDATA[<h3>Agentic Engineering Best Practices: Results of our 2-day Summit</h3><figure><img alt="Post-it notes on a board" src="https://cdn-images-1.medium.com/max/1024/1*vmp2hYfjzm6C61VnIIW8KQ.png" /></figure><h3>Introduction</h3><p>Agentic engineering is evolving faster than a single person can track. Therefore, we ran a 2-day agentic engineering summit. The goal: collect good practices from our customer projects.</p><p>Some of the strongest opinions had nothing to do with prompting tricks or model selection. They were about team dynamics, documentation discipline, and knowing when to step back from automation.</p><p>If you’re a senior developer building agentic workflows, a tech lead aligning your team’s setup, or a CTO deciding whether to invest in AI, this blog post is for you. It covers the practices that emerged from hard-earned experience with real customer projects.</p><h3>1. Context Engineering Beats Prompt Engineering</h3><p>The biggest theme wasn’t about writing better prompts. It was about deliberately managing context windows.</p><p><strong>Avoid auto-compaction.</strong> Most agent tools offer automatic context compaction. Our experience is that it silently drops important information. You lose architectural decisions, constraints, and prior reasoning without realizing it. (However, intentional compaction has its benefits if used deliberately).</p><p>We recommend to:</p><ul><li><strong>Keep context small by design.</strong> Scope tasks tightly. Don’t dump your entire codebase into a conversation and hope the agent figures out what matters.</li><li><strong>Use subagents for context management.</strong> Break complex work into smaller agent sessions, each with focused context. Dedicated agents handle feature refinement, architecture, frontend, backend, and testing. A coordinator stitches results together.</li><li><strong>Treat your agent’s context like a carry-on bag.</strong> Every item needs to justify its weight. If you can’t explain why something is in there, it’s not helping.</li></ul><h3>2. Review: Treat Agent Output like a Junior Developer’s PR</h3><p>Code review is where trust gets built or broken. If you can’t review agent-generated code effectively, nothing else matters.</p><p>Read the code. Question the decisions. Don’t assume correctness because the code compiles or tests pass. Agents produce plausible code. Plausible is not the same as correct. Plausible doesn’t include efficiency.</p><p>Common team practices:</p><ul><li><strong>Multi-model review.</strong> Use a different model to review what another model wrote. The failure modes differ between models, so cross-checking catches things a single model might miss.</li><li><strong>Use review skills before human review.</strong> Build an automated review step that runs before a human ever looks at the PR. This catches the obvious stuff and lets humans focus on architecture and intent.</li><li><strong>Define a GitHub workflow for agentic PRs.</strong> Label them. Route them differently. Make it visible that code came from an agent, so reviewers adjust their attention level.</li></ul><p>One anti-pattern came through clearly: <strong>don’t skip team communication.</strong> If agents are writing code that lands in shared repos, the team needs to know what’s happening and why. Silent PRs from agents erode trust fast.</p><h3>3. Write Documentation for Humans and Agents</h3><p>Your docs now serve two audiences: humans reading for understanding and agents reading for instructions and context.</p><p><strong>What works:</strong></p><ul><li><strong>Architecture docs belong where your agent can reach them.</strong> That means markdown in the repo with an index file or connecting your agent to Confluence via MCP. Both work in practice. The point is discoverability: if the agent can’t find it, it doesn’t exist.</li><li><strong>Architecture Decision Records (ADRs).</strong> When you make a design decision, write it down. Two paragraphs. What was decided, why, and what alternatives were rejected. These prevent agents from resurfacing settled questions in every session and can help with onboarding new team members.</li><li><strong>Include documentation in the workflow.</strong> Don’t treat docs as an afterthought. Agent sessions should read relevant docs at the start and update them when decisions change.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QX87u2KIAWz7OGgq.png" /></figure><p><strong>What doesn’t work:</strong></p><ul><li><strong>Pushing all generated content as documentation without review.</strong> Agents produce verbose, repetitive text. Curate ruthlessly. Documentation slop degrades the signal for both humans and future agent sessions.</li></ul><p>The principle: documentation should be lean, current, and machine accessible. If your architecture is only in someone’s head or a Miro board, agents can’t use it.</p><h3>4. Build Custom Skills, But Know When to Stop</h3><p>“From the shelf vs. DIY” generated strong opinions. The consensus landed here:</p><ul><li><strong>Don’t build custom skills for generic tasks.</strong> If there’s already a well-maintained tool or an established agent capability that handles it, use that. Your DIY version will be worse, and you’ll maintain it forever.</li><li><strong>Build custom skills for project-specific recurring tasks.</strong> If your team does the same complex operation repeatedly and it involves your specific codebase conventions, build a custom agent skill for it. This is a high-value automation.</li><li><strong>Prefer deterministic tooling where possible.</strong> Not everything needs to be non-deterministic AI. Linters, formatters, type checkers, schema validators: these should stay deterministic. Layer agent intelligence on top of solid tooling.</li></ul><p>If it’s a clear rule, hard-code it. If it’s a principle that needs thought and context to apply correctly, let an agent handle it. If it involves uncertainty, trade-offs, or business impact, keep a human in the loop.</p><h3>5. Follow a Software Development Lifecycle Process</h3><p>There are a dozen acronyms for agent-driven development workflows: <a href="https://martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html">SDD</a>, PDD, RDD, and more. Most of them are variations of the same underlying idea. Break the work into explicit, sequential phases. The consensus from the workshop was clear: it matters less which process you pick, but that you pick one at all. And they all agree on one thing: requirements come first, before any code is generated.</p><p>Two frameworks we’ve had good experiences with:</p><ul><li><strong>SAPI (Specify, Analyse, Plan, Implement).</strong> Four skill files that walk the agent through requirements, codebase analysis, implementation planning, and only then code generation. Lightweight, modular, and easy to adapt per project.</li><li><strong>OpenSpec. </strong>An open-source framework where each change gets a dedicated folder with proposal, specs, design doc, and task list as persistent artifacts. Tool-agnostic and works with 20+ AI coding assistants. (<a href="https://openspec.dev/">openspec.dev</a>)</li></ul><p>The underlying principle stays the same: force a structured sequence, and don’t let the agent skip ahead. The teams that skipped the planning phase consistently reported more rework and larger diffs to review. The ones that enforced even a lightweight spec-first flow found their code reviews shorter, and their context windows less polluted.</p><h3>6. Team Dynamics and Shared Ownership</h3><p>The most underrated theme: how agent workflows affect your team.</p><ul><li><strong>Align on personal vs. team setup.</strong> Some customization is individual preference. Some needs to be shared. Draw that line explicitly.</li><li><strong>Shared, team-owned skills.</strong> Build a marketplace or shared repo of agent skills the team maintains together. Skills that only one person knows about create bus-factor risks.</li><li><strong>No “secret” skills.</strong> If you’ve built something that makes you more effective, share it. Hoarding agent configurations fragments the team.</li><li><strong>Curate agent self-improvement.</strong> Agents that update their own instructions or build new skills need oversight. Log what changes. Review skill quality. Maintain observability into what your agents are actually doing.</li></ul><p>And one anti-pattern that generated immediate agreement: <strong>don’t give away responsibility for agent-written code.</strong> Your name is on the commit. You own it. “The agent wrote it” is not a valid excuse in a postmortem incident review.</p><h3>7. Don’t Believe the Hype</h3><p>Two final notes from our discussions around “trust issues” with AI agents:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*RuZKaGGWFLWAsKvtLZyljw.jpeg" /></figure><ul><li><strong>RTFM (Read the f*ing manual).</strong> The tools are evolving fast. Read the actual documentation for your agent tooling. Many frustrations come from using six-month-old mental models of how a tool works.</li><li><strong>Stay skeptical of inflated claims.</strong> Agents are powerful and genuinely useful. They also fail in ways that are hard to detect. Calibrate your trust based on your own experience. Remain skeptical of the tech CEOs (they might have a hidden agenda).</li></ul><h3>Conclusion</h3><p>The pattern across all discussions was consistent: AI coding agents amplify your existing engineering discipline. Good practices get better. Bad practices get worse, faster.</p><p>Start with code review. Get context management right. Document for human and agentic audiences. Build custom tooling only where it earns its maintenance cost. Use structured processes. Share what works for you with your team.</p><p>None of these are revolutionary. That’s the point. The teams getting real value from agents aren’t doing anything exotic. They’re applying solid engineering fundamentals to a new kind of collaboration mode.</p><h3>What’s Next</h3><p>If your team is also navigating this agentic transition with constantly changing recommendations, what kind of sessions or summits have you run? For us, it was genuinely useful to <a href="https://www.comsystoreply.de/en/contact">surface current assumptions, build alignment, challenge habits, and produce actionable practices</a> that can be adopted in each team incrementally.</p><p>We’ll be running more of these sessions and refining our practices as tooling evolves. If you want to compare notes or run something similar with your team, <a href="https://www.comsystoreply.de/en/contact">reach out</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e62a44f545c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/agentic-engineering-best-practices-results-of-our-2-day-summit-2e62a44f545c">Agentic Engineering Best Practices: Results of our 2-day summit</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Will AI Replace Software Developers?” Is The Wrong Question To Ask]]></title>
            <link>https://medium.com/comsystoreply/will-ai-replace-software-developers-is-the-wrong-question-to-ask-49589f83561b?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/49589f83561b</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 07:01:01 GMT</pubDate>
            <atom:updated>2026-06-01T07:01:01.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Developer standing at a whiteboard sketching programming foundations" src="https://cdn-images-1.medium.com/max/1024/0*OuelM7PpYVJ_zjAO" /><figcaption>Photo by <a href="https://unsplash.com/@jeswinthomas?utm_source=medium&amp;utm_medium=referral">Jeswin Thomas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The LinkedIn hype gods are loud. AI writes code, so Software Developers are now obsolete.</p><p>But this claim doesn’t hold with the current reality.</p><p>Software development was never “just coding”. Architecture discussions, decisions with trade-offs, stakeholder communication, operations, and yes, sometimes useless meetings.</p><p>Coding is a vehicle to get you to your desired destination. It’s not about the code itself, but what it does for you, your users, or your stakeholders. <strong>Coding was never the problem.</strong></p><p>The real value a developer brings is the judgment built from designing systems, shipping them, watching them break, understanding why they broke, and learning how to fix them.</p><p>The actual risk that comes with AI isn’t replacement. It’s <strong>the loss of skill</strong>.</p><p>The feedback loop that builds good engineers is at risk. Write code, trace nitty-gritty bugs, fix them, and as a result <strong>build understanding of the system and the problems it should solve</strong>.</p><p><strong>AI is like a shortcut</strong>. It creates an incentive to skip the understanding of the system. After all, I don’t need to understand what is going on, “if AI wrote the code, it can probably fix it by itself”. Which is true until something actually breaks and the AI can’t fix it anymore.</p><p><strong>The foundational skills haven’t changed</strong>: understanding what the code does and thinking through tradeoffs under real constraints. What has changed is how easy it is to skip them.</p><p>AI is like a painkiller. Immediate relief, but long-term damage with overusage. The solution isn’t rejecting AI, and only writing code by hand like a purist. The solution is to be deliberate. Ensure that juniors still get coding practice, read and trace unfamiliar code, and most importantly, understand and own the system end-to-end.</p><p>The question worth asking isn’t <em>whether AI will replace developers?</em> It is: <strong>who is responsible for making sure you and the next generation don’t skip the foundations?</strong></p><p>That one is still open.</p><h4>Dive Deeper With These Resources</h4><p><a href="https://martinfowler.com/articles/what-is-code.html">What Is Code?</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCZs8J1ZD0CE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCZs8J1ZD0CE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCZs8J1ZD0CE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a041224c1150367cc5453601ebcea722/href">https://medium.com/media/a041224c1150367cc5453601ebcea722/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49589f83561b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/will-ai-replace-software-developers-is-the-wrong-question-to-ask-49589f83561b">“Will AI Replace Software Developers?” Is The Wrong Question To Ask</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jakarta Validation in Spring Boot with Kotlin: Stop Making These Common Mistakes]]></title>
            <link>https://medium.com/comsystoreply/jakarta-validation-in-spring-boot-with-kotlin-stop-making-these-common-mistakes-10098c154943?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/10098c154943</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jakarta]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 09:11:38 GMT</pubDate>
            <atom:updated>2025-12-15T09:11:38.771Z</atom:updated>
            <content:encoded><![CDATA[<p>Most developers screw up Jakarta Validation in Kotlin. They think non-nullable types protect them from validation issues. They’re wrong.</p><p>Here’s what actually works, based on real problems I see teams hit repeatedly.</p><figure><img alt="Jakarta Kota train station sign" src="https://cdn-images-1.medium.com/max/1024/0*uD88j_X0_UkzwWjx" /><figcaption>Photo by <a href="https://unsplash.com/@mahardika_amadeus?utm_source=medium&amp;utm_medium=referral">Raditya Putra Mahardika</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Core Problem</h3><p>Jakarta Validation and Kotlin’s type system solve different problems. Mixing them incorrectly creates runtime failures that should have been caught earlier.</p><p><strong>Jakarta Validation</strong>: Runtime validation of object constraints</p><p><strong>Kotlin non-nullable types</strong>: Compile-time null safety</p><p>You need both. Here’s why.</p><h3>The Non-Nullable Type Trap</h3><pre>data class User(val name: String) // Non-nullable, right?<br><br>// These all compile fine:<br>User(&quot;&quot;) // Empty string<br>User(&quot;   &quot;) // Whitespace only<br>// JSON: {&quot;name&quot;: &quot;&quot;} also deserializes successfully</pre><p>Non-nullable Kotlin types don’t prevent empty strings, whitespace-only strings, or invalid formats. They only prevent null assignment at compile time.</p><p>When deserializing JSON, you can still get empty strings even with non-nullable types. This breaks the assumption that “non-nullable means valid.”</p><h3>Essential Annotations You Actually Need</h3><p><strong>String validation</strong>:</p><ul><li>@NotBlank: Rejects null, empty, and whitespace-only strings</li><li>@NotEmpty: Rejects null and empty (but allows whitespace)</li><li>@Email: Format validation</li><li>@Pattern(regex): Custom format rules</li></ul><p><strong>Numeric validation</strong>:</p><ul><li>@Min(value) / @Max(value): Integer bounds</li><li>@DecimalMin(value) / @DecimalMax(value): Decimal bounds</li><li>@Digits(integer, fraction): Precision control</li><li>@Positive / @Negative: Sign validation</li></ul><p><strong>Date/time validation</strong>:</p><ul><li>@Past / @Future: Temporal constraints</li><li>@PastOrPresent / @FutureOrPresent: Include current time</li></ul><h3>The Kotlin Annotation Trap</h3><p>This doesn’t work:</p><pre>data class User(<br>    @NotBlank // Wrong target<br>    val name: String<br>)</pre><p>This does work:</p><pre>data class User(<br>    @field:NotBlank // Correct target<br>    val name: String<br>)</pre><p>Why?<strong> </strong>Jakarta Validation needs to access the backing field. Without @field:, the annotation targets the constructor parameter instead. Spring’s validation framework looks for field annotations, not parameter annotations.</p><p>IntelliJ won’t catch this. Your validation will silently fail.</p><h3>@Valid vs @Validated: Choose Based on Complexity</h3><p><strong>Use @Valid for simple cases</strong>:</p><pre>@PostMapping(&quot;/users&quot;)<br>fun createUser(@Valid @RequestBody user: User): User</pre><p><strong>Use @Validated for validation groups</strong>:</p><pre>@Validated<br>@Service<br>class UserService {<br>    fun create(@Validated(CreateGroup::class) user: User): User<br>    fun update(@Validated(UpdateGroup::class) user: User): User<br>}</pre><p>Most teams start with @Valid and migrate to @Validated when they need conditional validation rules.</p><h3>Real-World Example That Works</h3><pre>data class CreateVoucherRequest(<br>    @field:NotBlank(message = &quot;Name is required&quot;)<br>    val name: String,<br>    <br>    @field:DecimalMin(value = &quot;0.1&quot;)<br>    @field:DecimalMax(value = &quot;100.0&quot;) <br>    @field:Digits(integer = 3, fraction = 1)<br>    val discountPercentage: Double,<br>    <br>    @field:Min(1)<br>    val totalUsages: Int,<br>    <br>    @field:Future<br>    val validFrom: LocalDate,<br>    <br>    @field:Future<br>    val validUntil: LocalDate<br>)<br><br>@RestController<br>@Validated<br>class VoucherController {<br>    @PostMapping(&quot;/vouchers&quot;)<br>    fun create(@Valid @RequestBody request: CreateVoucherRequest): ResponseEntity&lt;String&gt; {<br>        return ResponseEntity.ok(&quot;Created&quot;)<br>    }<br>}</pre><h3>Business Logic Validation Belongs in Services</h3><p>Don’t put complex business rules in annotations. Put them in service methods:</p><pre>@Service<br>class VoucherService {<br>    fun createVoucher(request: CreateVoucherRequest): Voucher {<br>        validateDateRange(request.validFrom, request.validUntil)<br>        // Business logic here<br>    }<br>    <br>    private fun validateDateRange(validFrom: LocalDate, validUntil: LocalDate) {<br>        if (!validUntil.isAfter(validFrom)) {<br>            throw IllegalArgumentException(&quot;End date must be after start date&quot;)<br>        }<br>    }<br>}</pre><p>This separates technical validation (format, bounds) from business validation (rules, relationships).</p><h3>What to Do Next</h3><ol><li><strong>Audit your existing validation</strong>: Look for missing @field: prefixes</li><li><strong>Add </strong><strong>@NotBlank to string fields</strong> even if they’re non-nullable</li><li><strong>Use numeric validation annotations</strong> for boundary checking</li><li><strong>Put business logic validation in services</strong>, not annotations</li><li><strong>Test edge cases</strong>: Empty strings, boundary values, invalid dates</li></ol><p>The goal isn’t perfect validation. It’s catching problems before they reach production with minimal code complexity.</p><p>Most validation bugs come from assumptions about what “non-nullable” means. Fix your annotations first, then worry about advanced patterns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10098c154943" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/jakarta-validation-in-spring-boot-with-kotlin-stop-making-these-common-mistakes-10098c154943">Jakarta Validation in Spring Boot with Kotlin: Stop Making These Common Mistakes</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning Go and Vue with Claude AI as my Pair Programmer]]></title>
            <link>https://medium.com/comsystoreply/learning-go-and-vue-with-claude-ai-as-my-pair-programmer-b2d634e291eb?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2d634e291eb</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Sat, 04 Oct 2025 18:39:10 GMT</pubDate>
            <atom:updated>2025-11-10T07:54:53.034Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2459r2xtQjg5i3AzZmA2Lg.png" /></figure><h3>Introduction</h3><p>Last week I built a supplier management application using Go and Vue. Two technologies I had barely touched before. My secret tactic? Using Claude AI as my pair programming buddy.</p><p>I’ve been eyeing Go for years, starting tutorials but never finishing them. A prime example of tutorial hell. What finally pushed me to build something was hitting a wall with Next.js on a client project. After four days of struggling with our logging setup that ultimately didn’t work with our tools, I was fed up. I needed a fresh start with a simpler stack.</p><p>So I gave myself one week with a clear goal: <strong>ship something real.</strong></p><p>Here’s what I learned about Go, Vue, and where Claude helped in speeding up the process (and where it didn’t).</p><h3>Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6tCzeigQbl8Re_79R6QDaw.png" /><figcaption>Screenshot of the supply stack application</figcaption></figure><p>I built a supplier management application with full CRUD functionality: search, pagination, detail views, and the usual create/edit/delete operations. Nothing fancy, but realistic enough to learn Go’s backend patterns and Vue’s reactivity model. With Claude Sonnet 4.5 as my pair programmer, I built a working app within a couple of days.</p><h3>Architecture</h3><p>Standard three-tier setup: Frontend talking to backend talking to a Postgres database. Again nothing revolutionary, but it forced me to learn how Go and Vue actually work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZsZExlse5jhvV9QCEV4Row.png" /><figcaption>Architecture diagram</figcaption></figure><h4>Why This Tech Stack?</h4><ul><li><strong>Go + Gin:</strong> I asked Claude what Go framework to start with. It suggested Gin for its simplicity. I was surprised how minimal the setup and config was and how fast I was able to define my first route.</li><li><strong>Vue3 + TypeScript:</strong> After wrestling with Next.js server-side rendering and its annoying and expanding backend responsibilities, I wanted to get back to basics (I still think it’s weird to run React in the backend). Vue feels closer to actual HTML. Just templates, components, and reactivity. No magic, no surprises.</li><li><strong>Docker:</strong> Because I wanted something that could actually be deployed.</li><li><strong>Postgres:</strong> Because I already knew it and didn’t want to learn a new database too.</li></ul><h3>Learnings with GoLang</h3><h4><strong>Go’s Weird If-Statement Assignments</strong></h4><p>This syntax confused me from the start:</p><pre>if err := godotenv.Load(); err != nil {<br>    fmt.Println(&quot;No .env file found, using environment variables&quot;)<br>}</pre><p>Why is the assignment happening inside the if statement? And why would you even want that?</p><p>Turns out, it’s Go’s pragmatism. Claude explained that there are two benefits: <strong>less boilerplate, and the variable only exists within the scope.</strong> Once the if statement ends, err is gone and the memory is freed. No variable pollution, and no accidental reusing of err somewhere else by mistake.</p><h4><strong>No Classes, No Constructors</strong></h4><p>Coming from Kotlin with its clean and simple data classes, this felt like a step backward. Where are my constructors? How do I initialise things properly?</p><p>Instead of constructors, you just write factory functions in Go. NewSupplier is a convention, not a language feature. No ceremony. No forced patterns. Just a function that returns a pointer to your struct.</p><pre>type Supplier struct {<br>    ID      uint<br>    Name    string<br>    Code    string<br>    Email   string<br>}<br><br>func NewSupplier(name, code, email string) *Supplier {<br>    return &amp;Supplier{<br>        Name:  name,<br>        Code:  code,<br>        Email: email,<br>    }<br>}</pre><h4><strong>No Inheritance (and Minimal Generics)</strong></h4><p>I’ve been coding for years and honestly never understood the obsession with inheritance. Every time I’ve seen it in a codebase, it’s created more problems than it solved. Deep Hierarchies, brittle parent-child relationships, and the fun game of figuring out <em>“which class actually has the method that I need?”</em></p><p>Go forces you to use composition over inheritance. Build small pieces. And then combine them. It’s cleaner, more flexible, and way easier to reason about. And honestly: I love it! ❤️</p><p>Generics are a different story. Go resisted them for years, then finally added basic support. I rarely use generics, but they are useful sometimes. But they also come with a complexity overhead.</p><p>Go’s version is minimal. It removes these features and focuses on simplicity.</p><h4><strong>Pointers and References</strong></h4><p>Coming from Kotlin where pointers are completely hidden, using pointers feels like a step backward. In the past I only touched pointers briefly in Rust. Kotlin’s approach of just handling it for you feels easier.</p><pre>// &amp; gets the memory address (pointer to the value)<br>supplier := Supplier{Name: &quot;Tech Supplies GmbH&quot;}<br>updateSupplier(&amp;supplier)  // pass pointer<br><br>// * dereferences (gets the value from the pointer)<br>func updateSupplier(s *Supplier) {<br>    s.Name = &quot;Tech Supplies AG&quot;  // changes original<br>}</pre><p>I asked Claude why Go uses them. Turns out it’s about control and performance. When you pass a pointer, you’re not copying the entire struct. You’re just passing the memory address. For large structs or when you need to modify the original, pointers matter.</p><p>I’m still wrapping my head around when and how to use them, but I understand the reasoning. Go gives you tools when you need them. Not sure if I love it yet, but at least it’s explicit.</p><h4>Understanding Go’s Error Handling</h4><p>In Kotlin, you just throw exceptions and let something upstream catch them. Go doesn’t work that way. Every function that can fail returns an error as a second value, and you deal with it right there. No exceptions, no try-catch blocks.</p><pre>func (r *SupplierRepository) GetByID(id uint) (*models.Supplier, error) {<br>    var supplier models.Supplier<br>    err := r.db.First(&amp;supplier, id).Error<br>    if err != nil {<br>        return nil, err<br>    }<br>    return &amp;supplier, nil<br>}</pre><p>This function returns tow things:</p><ul><li>the supplier (or nil if it fails)</li><li>an error (or nil if it succeeds)</li></ul><p>You can’t ignore the error. The language forces you to explicitly handle it or pass it up. Go’s philosophy is to make errors visible and not hidden in stack traces. You know exactly where things can go wrong. Sure, it’s more code, but also fewer surprises.</p><h4>Capital Letters = Public (Like Why?)</h4><p>Go doesn’t have public or private keywords. If something starts with a capital letter it’s exported. Lowercase? It’s private.</p><pre>type Supplier struct {  // Public - exported<br>    ID    uint          // Public field<br>    name  string        // Private field<br>}<br><br>type supplier struct {} // Private - package only</pre><p>I think Go went too far here. Being explicit is usually the better option. The tiny overhead of typing public or private is nothing compared to the clarity you get. When I read code, I want to see the access level, not translate capital letters to access modifiers in my head every time.</p><p>Readability matters more. Sometimes verbosity is good.</p><h3>Learnings with Vue</h3><h4>Vue is Close to HTML</h4><p>This is what sold me on Vue: it’s actual HTML with superpowers, not JavaScript pretending to be HTML.</p><pre>&lt;template&gt;           <br>  &lt;button @click=&quot;viewSupplier(supplier.id!)&quot;&gt;View&lt;/button&gt;<br>&lt;/template&gt;<br><br>function viewSupplier(id: number) {<br>  router.push(`/suppliers/${id}`)<br>}</pre><p>React forces you into JSX, then Next.js adds server-side rendering as a workaround to get performance back.</p><p>Vue just starts with HTML and sprinkles in reactivity where you need it. It’s faster, cleaner and honestly what I always wanted. The page is HTML first, JavaScript only where necessary. Not the other way around. (Similar to htmx, which I really would like to try out in the future.)</p><h4>Composition vs Options API</h4><p>Vue gives you two ways to write components: Composition API and Options API. I went with Composition.</p><p>Options API felt too class-based. It reminded me a bit of old React class components. Composition API is more like React hooks: you import what you need, compose your logic, and it just flows naturally.</p><p>The docs explain both, but Composition felt right immediately.</p><pre>&lt;script setup&gt;<br>import { ref } from &#39;vue&#39;<br><br>const supplier = ref({ name: &#39;&#39;, code: &#39;&#39; })<br><br>function saveSupplier() {<br>  // logic here<br>}<br>&lt;/script&gt;</pre><h4>State Management Feels Straightforward</h4><p>I used Pinia for global state, and it’s basically Vue’s version of Zustand. And Zustand is great.</p><p>Coming from React, I missed the simplicity of useState for local state. But compared to getting lost in Redux hell, Pinia was straightforward and simple. Define a store, use it in components, done.</p><pre>export const useSupplierStore = defineStore(&#39;suppliers&#39;, {<br>  state: () =&gt; ({ suppliers: [] }),<br>  actions: {<br>    async fetchSuppliers() { /* ... */ }<br>  }<br>})</pre><h4>Routing Feels Straightforward</h4><p>Vue Router felt similar to React Router, but with more options out of the box.</p><p>Defining routes or nested routes, worked how you would expect. Vue Router felt slightly more feature complete on first impression. But in the end both get the job done. This wasn’t a steep learning curve, just a different syntax for the same concepts.</p><h4>Otherwise, Not Many Surprises</h4><p>After a couple of days with Vue, my main takeaway is this: it’s refreshingly boring.</p><p>No weird stuff, no fighting a framework, no <em>“why doesn’t it work out of the box?”</em> moments.</p><p>Is that exciting? No. Is that productive? Yes. Sometimes boring is exactly what you want.</p><h3>Learnings with Claude AI &amp; Prompting</h3><h4>Context is King</h4><p>Give Claude everything, even if it feels unnecessary. Tech stack, file structure, what you’ve already tried. Dump it all in. The more context, the better the suggestions.</p><h4>Close the Feedback Loop</h4><p>When Claude offers multiple approaches, tell it which one you chose. <em>“I went with Option 2”</em> keeps the conversation focused on your problem. Otherwise, it doesn’t know your decisions and suggests things you’ve already decided against.</p><h4>Know When to Stop</h4><p>If you’re five messages deep in a hole, stop. Take a break, then open a new chat and reframe the problem with fresh eyes.</p><h4>Diagrams Are Still Hard</h4><p>Claude can describe architecture well, but generating actual diagrams? Hit or miss. What works great is letting it generate the diagram code. Remember the architecture diagram from the beginning? I created that by telling Claude to generate the JSON code for <a href="http://excalidraw.com/">excalidraw.com</a> which I then imported.</p><h4>Long Chats can Get Slow</h4><p>After long chats, Claude noticeably slows down. My guess is that it tries to put the whole chat history into context. If responses start lagging, open a new chat, with a summary of what you have done so far.</p><h3>Key Takeaways</h3><ol><li><strong>Go strips away the noise:</strong> No classes, no constructors, no inheritance, explicit error handling, syntax is from time to time a bit weird, but overall a nice language with an opinionated style that I like.</li><li><strong>Vue feels like HTML again:</strong> After React’s decision to recommend Next.js as the default, Vue’s template-first approach feels refreshingly simple. I like simplicity.</li><li><strong>Claude works best with context: </strong>Dump everything in, close feedback loops, and start a new chat when you’re stuck.</li><li><strong>Build something real:</strong> More fun, more hands-on, and the learning actually sticks. Better than getting lost in tutorial hell.</li></ol><h3>Want to See the Code?</h3><p>It’s all on GitHub. You just need Docker to run it.</p><p><a href="https://github.com/Korbisch/supply-stack">GitHub - Korbisch/supply-stack</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2d634e291eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/learning-go-and-vue-with-claude-ai-as-my-pair-programmer-b2d634e291eb">Learning Go and Vue with Claude AI as my Pair Programmer</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started With Domain-Driven Design (DDD)]]></title>
            <link>https://medium.com/comsystoreply/introduction-to-domain-driven-design-ddd-d1d7fd2fb096?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1d7fd2fb096</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 08:31:30 GMT</pubDate>
            <atom:updated>2024-09-22T14:03:32.919Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JkoexMMFJ-gExhZE" /><figcaption>Photo by <a href="https://unsplash.com/@maartendeckers?utm_source=medium&amp;utm_medium=referral">Maarten Deckers</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I recently visited the Domain Driven Design Europe conference in Amsterdam with some colleagues. One of them struggled with understanding what DDD actually is. This reminded me of my own learning journey since DDD introduces many new terms, methodologies and patterns, which makes it hard to learn domain-driven design.</p><p>This blog post provides an easy introduction to the main concepts presented in Eric Evans’ influential book: <a href="https://amzn.eu/d/f5hO4G1"><em>Domain-Driven Design: Tackling Complexity in the Heart of Software</em></a>.</p><blockquote>Domain-driven design offers an approach to building better software by closely aligning business requirements with code.</blockquote><h3>Domain and Model</h3><p>To build great software, you have to understand what the software is all about. What problem is the software solving? In which business? What is the intended user base?</p><blockquote>The domain is the problem space and business area your software operates in.</blockquote><p>You can’t write a logistics program without any knowledge about logistics. In fact you can, but it is very likely that your program won’t be correct and will contain a lot of bugs.</p><p>To understand the domain and build that knowledge you create a model. What is a model? The model is an abstraction of the real world you build your software on. The model leaves out unnecessary details so you can focus on the important stuff (whatever that is). Your model can take many different forms. It can be documentation, requirements, diagrams, user stories, stickies, knowledge in your head etc.</p><blockquote>The model includes all the knowledge that is relevant for solving the business problem.</blockquote><p>How do you build this model? The model is what you build together with business experts. Who are these business experts? The people that know most about the domain (that’s why we also call them domain experts). It’s the supply chain manager, the medical director or the financial analyst. Domain experts are the people who want the software to be built.</p><p>Most importantly, you should create a common understanding together with the domain experts. You need to agree on what to build and you should also speak the same language while doing so.</p><h3>Ubiquitous Language</h3><p>To understand what should be built you need to speak the same language as the domain experts. Since domain experts oftentimes don’t know anything about software you should leave out technical terms from these discussions. You ask the domain expert what should be built and they answer.</p><p>The language of the domain experts is made up of words that form the main concepts of the software. For a logistics application these might be <strong>routes, ships, trucks</strong> and <strong>vehicles</strong>.</p><p>A <strong>vehicle</strong> might be different from a <strong>truck</strong>. <strong>Vehicle</strong> might be the term that actually includes <strong>ships</strong> and <strong>trucks</strong>. So when you talk about a <strong>vehicle</strong> make sure that everyone understands that this can include <strong>ships</strong>, <strong>trucks</strong> or any other future mode of transportation.</p><p>So the language that you use should be clear and concise. Everyone in your team and the domain experts should have the same understanding of the language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oBMueHgoY3ermkRxtNMfLA.png" /></figure><p>You should also use this language everywhere. In your model, in your requirements, in your documentation, and in your code. Since this language should be universal for your project and you use it everywhere it is called ubiquitous.</p><blockquote>The ubiquitous language is the universal language of the project.</blockquote><p>Or simply, the language that you use to communicate and understand what should be built that you use everywhere.</p><p>However, your understanding and agreement on the different words and terms might change throughout your project. Either the world changed or you learned something new that you didn’t know before. What should you do in this case? You should update your model to reflect the new insights. This also means updating the code whenever there is a change of language.</p><p>This sounds all good and nice, but you might be thinking: <em>“Why should I care?”. </em>A shared language limits the likeliness of miscommunication. Why is miscommunication bad? Domain expert says <strong>X</strong> and developer understands <strong>Y</strong>. <strong>Y</strong> is what gets implemented into the code. Domain expert is unhappy since they asked for <strong>X</strong> but actually got <strong>Y</strong>. Domain expert goes on to blame the developer for not implementing <strong>X</strong>.</p><h3>Bounded Contexts</h3><p>After talking to the domain experts for some time you notice that the logistics domain is quite complex. So just putting everything into code would make the code hard to work with in the long term, so you decide to split things up into areas. Tada 🎉, you now have bounded contexts.</p><blockquote>Bounded Contexts are all about splitting large models into parts that are easier to deal with.</blockquote><p>Consider the following diagram. You might decide to split up your program into three bounded contexts. One context for order management, another one for managing shipping operations, and another one for managing trucking operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZUVHxaiRGIWeQ6KmJmnNw.png" /></figure><p>The vehicle inside the order management is quite generic. So in the context of order management we might not care if the actual shipping will happen by truck, ship or both. Also notice that in the order context we refer to a shipment. Likewise in the shipping and trucking context we use a different term which is cargo. Shipment and cargo might refer to the same <em>“thing”</em> in the real world, however we use different terms that are appropriate within the context. So each context defines its own model and language.</p><p>Contexts should be independent from each other, so changes can be made without affecting other areas of the system. That’s the reason why we need to define clear boundaries. This makes the whole system more maintainable and easier to work with.</p><h3>Entities, Value Objects &amp; Services</h3><p>Now we have talked a lot about what DDD is, but how would you actually implement all this in code? This is where Entities, Value Objects and Services become relevant.</p><p><strong>Entities</strong> have an identity, which in simple terms means that they can be distinguished from each other. Code-wise that means that entities have an id property. Entities also have functions that operate on the data of the entity. In our logistics domain we might model a customer as an entity, since we need to be able to distinguish customers from each other.</p><p><strong>Value Objects</strong> are just a summary of related data fields. Think about just passing some data around in your application. Naturally, these kinds of objects don’t need to have an id. Cargo might be a good fit for this, since we don’t really care about distinguishing one cargo from another (saying this even sounds a bit weird). We care way more about the contents of cargo, the actual data that is inside a cargo value object.</p><p><strong>Services</strong> are how you wire everything up together. I usually think of use cases. Most times these use cases are too complicated to be put inside of an entity or they require multiple entities to work together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jf1bR6fZgGoGu8trlCRleQ.png" /></figure><p>A problem that I often see in codebases is that people start to move all functionality to Services. You end up with lifeless Entities that only contain data and a bunch of services that are called EntityService. Strictly speaking you shouldn’t do that because the best place to put that functionality is the Entity itself. This also makes your codebase easier to manage and reduces complexity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LrgyjhdAUOqQKVmmwYH46w.png" /></figure><h3>Aggregates</h3><p>Aggregates encapsulate multiple objects to create more complex structures. Aggregates are used to keep invariants, which is a fancy way of saying “things that shouldn’t change”. Those are rules that your application should always enforce no matter what.</p><blockquote>An Aggregate is a cluster of associated objects that we treat as a unit for the purpose of data changes.</blockquote><p>Let’s make this clear with an example. In our logistics application we might want to create an order aggregate to manage our orders. Admins will be able to create orders and create order items. However order items can only be created over an order since order items that don’t belong to any order don’t make any sense. So our order items won’t be accessible by anything that is not inside the order aggregate boundary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8p_CNLzFMN4iiDScyGELg.png" /></figure><p>We also want to enforce that the maximum weight of any order is 40.000kg, since that is the maximum a single truck can transport. This is the invariant. Once an Admin tries to add an order item that would break the invariant rule we will reject the request to keep our order data consistent.</p><p>From the example, we learned a couple of more things:</p><ul><li>Aggregates have a root object (Order) and a boundary</li><li>The aggregate root is a single entity that is part of the aggregate</li><li>The root is the only object that outside objects are allowed to access and interact with</li></ul><h3>Conclusion</h3><p>Domain-driven Design (DDD) is a method to build software systems that are closely aligned with their domain. This makes these systems less complex and improves the maintainability.</p><p>DDD also offers many methodologies to enhance the communication between domain experts and developers to limit the likelihood of miscommunication. If you want to learn more, I recommend you check out the Domain-Driven Design Starter Modeling Process:</p><p><a href="https://github.com/ddd-crew/ddd-starter-modelling-process">GitHub - ddd-crew/ddd-starter-modelling-process: If you&#39;re new to DDD and not sure where to start, this process will guide you step-by-step</a></p><p>Do you want to find out what other tools we at <a href="https://www.comsystoreply.de/en">Comsysto Reply</a> apply and what services we offer? Visit our website: <a href="https://www.comsystoreply.de/en/services">https://www.comsystoreply.de/en/services</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1d7fd2fb096" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/introduction-to-domain-driven-design-ddd-d1d7fd2fb096">Getting Started With Domain-Driven Design (DDD)</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building High-Performance Teams: Strategies for Modern Software Engineers]]></title>
            <link>https://medium.com/comsystoreply/building-high-performance-teams-strategies-for-modern-software-engineers-1a72c31e2238?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a72c31e2238</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Tue, 27 Feb 2024 12:01:53 GMT</pubDate>
            <atom:updated>2024-02-27T12:01:53.516Z</atom:updated>
            <content:encoded><![CDATA[<p>Your first thought coming here might be something like:</p><blockquote>“What? How can I improve the performance of my team? I am just a member of the team. It is my manager&#39;s job to improve the overall performance…”</blockquote><p>But it turns out that as a software engineer, you’re more than just a code monkey. The efficiency, effectiveness, and performance of your team don’t just depend on how well each person on the team writes code. It also depends on how well you all work together. In this guide, we will explore strategies for what you, as a software engineer, can do to enhance your team’s performance.</p><figure><img alt="A team sitting in a circle together, discussing an important topic." src="https://cdn-images-1.medium.com/max/1024/1*u475bNbG9ctVSBInWzzi5g.jpeg" /></figure><p>This article is the first of a two-part series. In the second series, my colleague Jakob Mayr is exploring strategies for how you can improve team performance as an Engineering Manager and Leader. (It is still in writing, but I will link it, once it’s finished)</p><blockquote>When it comes to measuring performance, teams matter more than individuals — Manuel Pais &amp; Matthew Skelton</blockquote><h3>Embrace Agile Methodologies</h3><p>Agile methodologies, such as Scrum or Kanban, are not just management trends. They are frameworks designed to enhance team productivity and adaptability. As an engineer, embracing these methodologies means more than just attending daily stand-ups. It involves:</p><ul><li><strong>Active Participation in Planning</strong>: Voice your opinions on what’s feasible within a sprint. Your insights are crucial for setting realistic goals.</li><li><strong>Taking Ownership</strong>: In Agile, not every task needs the <em>OK</em> of a Manager. Take ownership of your tasks and be proactive in updating their status.</li><li><strong>Being Flexible</strong>: A big part of Agile is adaptability. Be open to changes as projects evolve. (This is also at the heart of our company philosophy at Comsysto Reply, where we formulated this as <em>“Sense &amp; Respond”</em>)</li></ul><p>A lot of this also ties into basic things such as having a team-first mindset as described in the book <em>Team Topologies</em> by Matthew Skelton and Manuel Pais. They suggest that you should:</p><h4><strong>Arrive for stand-ups and meetings on time</strong></h4><p>It sounds so simple, right? But I think that arriving at meetings on time goes a long way. It shows that you value other people’s time and respect them.</p><h4><strong>Keep discussions and investigations on track</strong></h4><p>At Comsysto Reply, we advocate for active participation where every team member has the responsibility to steer the conversation back to the main points if it starts to deviate. Having a dedicated moderator also helps, reminding the team of time boxes and ensuring that each topic receives the attention it needs without compromising productivity.</p><h4><strong>Encourage a focus on team goals</strong></h4><p>A high-performance team aligns its efforts with shared goals and objectives. To build this alignment, we regularly define and revisit our team’s goals ensuring that they are understood and embraced by all members.</p><h4><strong>Help unblock other team members instead of starting on new work</strong></h4><p>You should always consider offering your assistance to colleagues who are stuck before jumping into a new task. By helping to unblock others, you reinforce a culture of support and ensure that the team’s momentum is maintained. Be proactive and ask your team members how you can help them. This will make your team deliver value faster, and a nice side-effect is that this also strengthens the bonds with your colleagues.</p><h4><strong>Mentor new or less experienced team members</strong></h4><p>You should take the time to mentor new or less experienced team members. This action is a cornerstone of our collective learning environment at Comsysto Reply. Initiating pair programming sessions, scheduling regular check-ins, or just being available to answer questions can make a significant difference. Mentorship is a powerful tool that benefits everyone involved — mentees gain confidence and skills, while mentors reinforce their expertise and develop leadership qualities.</p><h4><strong>Avoid winning arguments and, instead, agree to explore options</strong></h4><p>After all, you don’t want to win an argument if it means putting everyone down. Also most likely you don’t have the full picture of the system or product, so your team members can offer valuable insights. More often than not, the best solution emerges when we embrace our diverse backgrounds and find a middle ground among all ideas.</p><p>As you embrace agile methodologies in your software engineering journey, you’ll discover the potent impact of eliminating obstacles. You should actively engage in identifying and removing impediments, whether it’s through the Scrum Master’s role or by direct team collaboration.</p><p><strong>Trust as a foundational element:</strong> You should know that trust is the bedrock of any high-performing team. When team members do not feel trusted, their desire to collaborate diminishes. Strive to build trust within your team by being open, transparent, and supportive.</p><h3>Cultivate a Culture of Continuous Learning</h3><p>As software engineers, we must constantly learn new stuff. The world is changing fast and the tech world is changing even faster. To stay relevant you need to continuously evolve your skills. The wave of change that GenAI is bringing is just getting started. (<em>Proud that I managed to mention GenAI in this post </em>💪)</p><p>Yet, dedicating time to learning sounds great in theory, but how about in practice? It can sometimes be difficult to make time for learning. One of the strategies I use is to incorporate learning into my daily routine. Carve out a slot in your day — whether it’s a deep dive into a new programming paradigm, a quick round on a coding challenge, exploring the latest tech trends, reading some blog post on medium, or reading a page in a book. It doesn’t have to be time-consuming: consistent, bite-sized learning sessions can lead to substantial expertise over time.</p><figure><img alt="Four boxes stacked on each other to show the growth of microlearning with books, medium blog posts, coding challenges, and programming paradigms" src="https://cdn-images-1.medium.com/max/1024/1*aKQYHYt_dPa9ChBb9Dht7g.png" /><figcaption>Bite-sized learning chunks can accumulate over time</figcaption></figure><p>“But how do I know what to learn?”, you might ask now. That’s where the invaluable habit of questioning comes into play. Pose questions to your peers and don’t shy away from asking again for clarity or a deeper understanding — each question is a stepping stone towards broader knowledge. Challenging assumptions and seeking answers from experienced colleagues and seniors also helps. Engaging in dialogue about architecture decisions or best practices doesn’t just answer your immediate questions, it also strengthens team cohesion and leads to a shared understanding.</p><blockquote>Ask questions. Lot’s of them.</blockquote><p>An effective way to learn within the team is through Pair or Mob Programming. These practices aren’t just about writing code together, they’re methods for knowledge exchange, mentorship, and collaborative problem-solving. As you navigate a tough problem with your teammates, you’ll find that the shared experience is perfect for growing new skills. (Also you get to know people way better on a personal level during these sessions.)</p><p>Learning isn’t only a personal endeavor, it’s a team sport. At Comsysto Reply, we noticed that the performance of our teams increases rapidly when each team member dedicates time to learning. So we embedded it into our culture. With our 20 Lab Days each year, every colleague gets the space to grow. These Lab Days are our canvas for creativity and learning, fully supported and encouraged by the company. This is also what enables us to stay at the forefront of innovation and what might play into new strategic offerings or help with winning new clients.</p><h3>Encourage Clear and Open Communication</h3><p>Transparency is what makes collaboration work inside a team. When we, as team members, pull back the curtains on our personal experiences — sharing anecdotes from our weekends or stories from our private lives — we create stronger, more trusting bonds for our professional interactions.</p><p>Aristotle once said, “The whole is greater than the sum of its parts,” and nowhere is this truer than within a well-functioning team. This synergistic effect, where 1 + 1 equals 3, arises when individuals openly communicate, share ideas, and collectively work towards a unified purpose.</p><p>To reach this level of synergy, all team members must be aligned on a common goal. Clarity of purpose is the compass that guides each decision, conversation, and code commit. It ensures that every task undertaken is a step toward that shared objective. If you find yourself confused with unclear goals, be proactive. Challenge the status quo by asking for direction, and if you have the freedom, set the course for your team. After all, clear goals and open communication are not just the responsibility of the team leader, they are what every software engineer should be ready to take up.</p><figure><img alt="A diagram showing three overlapping circles with Transparency, Purpose and Communication. In the middle is the word Goals." src="https://cdn-images-1.medium.com/max/1024/1*V3A5RZPGJwLA0K4Qrm0hvw.png" /><figcaption>Transparency, Purpose, and clear Communication lead to better Team Goals</figcaption></figure><p>By embracing transparency, purpose, and open communication, we set the stage for a team that’s more than just a group of individuals. It becomes a community that thrives on mutual respect, and understanding, and collectively achieves success based on common goals.</p><h3>Collaborate, Don’t Just Coexist</h3><blockquote>Who is on the team matters less than team dynamics — Manuel Pais &amp; Matthew Skelton</blockquote><p>Collaboration in our digital world has changed the way software engineering teams operate. Especially in remote settings, there’s a fine line between just coexisting and truly collaborating. In the virtual workspace of instant messaging, and video calls, we may easily fall into the trap of independent silos inside a team.</p><figure><img alt="Multiple circles on a blank canvas. On the left side without interaction, and on the right side with a lot of interaction." src="https://cdn-images-1.medium.com/max/1024/1*wVG04G9WK-R3rM5h69_51A.png" /><figcaption>Coexistence vs Collaboration</figcaption></figure><p>Once again the practices of Pair and Mob Programming take on an even greater significance when team members are not sitting in the same office. They enable knowledge-sharing and collective problem-solving. But they also create a sense of unity and team spirit that is usually weaker in remote settings.</p><p>Indeed, I share the opinion that nothing beats the energy of co-located teams. The unexpected exchanges by the coffee machine, and the spontaneous “desk drive-bys” provide the perfect ground for creativity and innovation that’s hard to replicate online. However, the reality of our global and flexible work environment often requires us to adapt and find new ways to maintain this closeness even when we are apart. Here are the insights from Christian, our Managing Partner at Comsysto Reply, on balancing office presence with remote work:</p><p><a href="https://www.linkedin.com/feed/update/urn:li:activity:7150743065702387712?updateEntityUrn=urn%3Ali%3Afs_feedUpdate%3A%28V2%2Curn%3Ali%3Aactivity%3A7150743065702387712%29">Christian Kolbe on LinkedIn: #culture #hybridwork #travel</a></p><p>For these remote settings, using the right tools is of great importance. Tools that enable us to share our screens, manage our source code, track our tasks, and communicate asynchronously are indispensable. At Comsysto Reply we don’t use anything revolutionary. Microsoft Teams, Zoom, Slack, and Trello do the trick most of the time. One cool tool that I want to mention however is <a href="https://www.gather.town/">Gather</a>. It tries to replicate a real-life office environment in a pixel art game mode. So in this virtual environment, you can just walk over to your colleague and a video call is automatically started.</p><p><a href="https://www.gather.town/">Gather | Virtual HQ for Remote Teams</a></p><p>Collaboration in a remote setting should be as intentional and robust as it is in a physical office. Remember, technology is the enabler, but the heartbeat of collaboration is the team’s commitment to each other’s success.</p><h3>Optimize the Developer Experience</h3><p>Improving the developer experience is about making things easier for your team, and clearing obstacles that slow down the creative process. Think about the manual tasks that everyone finds annoying. These are prime candidates for automation. By taking the time to automate these tasks, you free up valuable time for yourself and your colleagues and also reduce the risk of human error.</p><blockquote>Automate the boring stuff</blockquote><p>Ask yourself if there are ways to speed up the pipeline runs to deliver faster feedback. Are there strategies you can employ to accelerate the tests or the build process? Faster feedback loops mean issues are addressed promptly, ensuring the team can move forward without unnecessary delays.</p><p>Refactoring code is another area where you can significantly improve the daily life of your team members. Diving into the codebase and cleaning it up makes it more enjoyable to work with and also more accessible for new developers joining your team. Consider breaking down large functions, renaming variables &amp; functions to make their purpose clearer, and simplifying complex expressions.</p><p>Lastly, think about the last time you wished the documentation was better. Good documentation makes solving common challenges much easier when working with complex systems. By dedicating time to either author or refine documentation, you provide clarity for your team — making it easier for everyone to understand how to use systems and why certain decisions were made.</p><p>When you take these steps to optimize the developer experience, you’re showing that you care about your team’s time and well-being. This makes for a more engaged and satisfied team, and that is priceless.</p><h3>Focus on Quality, Not Just Quantity</h3><p>It’s essential to remember that the quality of your work profoundly impacts the value you provide. You should aim to create a cult around quality, ensuring that excellence becomes a core aspect of your team&#39;s identity. You should always prioritize producing high-caliber code over churning out features hastily, as the latter can lead to technical debt and hinder the product’s long-term success.</p><p>At Comsysto Reply, we advocate for incorporating quality assurance practices throughout the development process. You should write clean, maintainable code and embrace test-driven development (TDD) to catch issues early on. Pair programming can also be a valuable technique, allowing you to collaborate with peers for immediate feedback and a shared understanding of the codebase.</p><p>Invest time in code reviews with your team to ensure every line of code adheres to agreed standards and best practices. You should view code reviews not as a hurdle but as an opportunity to learn from each other and improve the overall quality of your work.</p><p>Additionally, resist the temptation to equate long hours with productivity. It’s about smart work, not hard work. You should strive to stay fresh and avoid burnout, as mental exhaustion can compromise your work’s quality. Remember, the goal is to build software that meets the client’s needs and also stands the test of time by staying flexible enough to evolve with future requirements.</p><p>Another important point is taking pride in your work. Sounds simple. But this leads to improved quality. Feeling pride in quality makes you work harder to maintain and improve it. Besides, you will also develop a profound sense of accomplishment and satisfaction in your team. Which is in itself positive to have and can be achieved by celebrating even small wins. Quality should be the signature of your work as a software engineer and craftsman.</p><figure><img alt="A circular flow of Code Reviews, Clean Code, Smart Work, Proud Craftsmanship and Cult of Quality" src="https://cdn-images-1.medium.com/max/1024/1*u_2kfLZajF9eZCgZDIn_yw.png" /><figcaption>In this way, you can create a cycle that is reinforcing itself and growing stronger iteration by iteration</figcaption></figure><h3>Work-Life Balance</h3><p>In my team during my very first project, we did something called <em>Fika</em> — a Swedish tradition of pausing during the day to enjoy a cup of coffee and a bite of something sweet to eat while socializing.</p><blockquote>The major problems of our work are not so much technological as sociological in nature. — Tom DeMarco &amp; Timothy Lister</blockquote><p>We did this every Wednesday afternoon, setting aside time specifically to relax and engage in activities completely unrelated to work. Most times that meant sharing stories over coffee, challenging each other to a game of foosball, or teaming up for online games like <a href="https://exploder.io/">Exploder</a>. It always cleared our minds and allowed us to restart fresh.</p><p>Beyond these weekly pauses, going out for a beer and having dinner together improved our team dynamic. It’s during these moments that you get to know the people you are working with daily— their interests, their families, and where they are coming from. Understanding each other beyond professional life creates a supportive and friendly atmosphere.</p><p>But also remember, that you have a life outside of work. It’s important to set boundaries and ensure that your job does not consume all of your time. Balance is not about perfect division but rather about ensuring that work enhances your life without overpowering it. By maintaining this balance, you improve your own life and also bring new energy and fresh perspectives to your team.</p><h3>Conclusion</h3><blockquote>The best success is the one in which there is no evident management, in which the team works as a genial aggregation of peers. The best boss is the one who can manage this over and over again without the team members knowing they’ve been “managed”. — Tom DeMarco &amp; Timothy Lister</blockquote><p>Remember that while all the technicalities we just explored are important, it’s the value delivered — the outcome — that ultimately defines the success of a high-performing team. Keep the spotlight on what truly matters: the results. In the end, this is also what propels your career forward.</p><figure><img alt="A summary of the blog post in colorful boxes. The middle box contains Balance. The other boxes give a summary on Agile, Learning, Communication, Collaboration, Developer Experience and Quality" src="https://cdn-images-1.medium.com/max/1024/1*5IYp3vKu15SEMS8v24uiSQ.png" /></figure><p>Comsysto Reply develops sophisticated and innovative software solutions with great passion. We manage projects holistically with full transparency: You get everything from one source. When developing solutions we focus on <a href="https://www.comsystoreply.de/en/services">two phases</a>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a72c31e2238" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/building-high-performance-teams-strategies-for-modern-software-engineers-1a72c31e2238">Building High-Performance Teams: Strategies for Modern Software Engineers</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Half a Year of Rust ]]></title>
            <link>https://medium.com/comsystoreply/half-a-year-of-rust-9b5d1d7ede?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b5d1d7ede</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 09:31:23 GMT</pubDate>
            <atom:updated>2023-12-24T10:39:06.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="The Rust logo: a crab called crustacean on a blue background" src="https://cdn-images-1.medium.com/max/1024/1*HBsGmwvT5E8867sZizGHrA.png" /></figure><p>Rust is a fairly new programming language. For the last half year, I have explored the language and all its unique features. In this blog post, we’ll look into five reasons that contribute to making Rust a — in my opinion — cool programming language. You will get a high-level introduction to the most important features including the concept of ownership and borrowing. By the end, you will have a better understanding of why Rust is worth exploring and how you can get started with your journey to learn Rust.</p><pre>fn main() {<br>  println!(&quot;Hello, Rust!&quot;);<br>}</pre><h3>Outline</h3><ol><li>🔐 Static Typing</li><li>📎 Concise &amp; Expressive Syntax</li><li>🚀 Performance</li><li>💾 Concept of Ownership &amp; Memory Safety</li><li>🐛 Detailed Error Messages</li></ol><h3>🔐 Static Typing</h3><p>In my opinion, static typing can offer great benefits. Here is an interesting talk on the topic: “<a href="https://www.youtube.com/watch?v=Tml94je2edk">Why Static Typing Came Back — Richard Feldman</a>”.</p><p>In the past, I was a big fan of Python. I just had the feeling that the short syntax and not needing to specify types enabled me to write code fast. But that was only one side of the story. I probably spent way more time debugging my code, but of course, back then I didn’t count that in.</p><p>The main benefit of a static-typed language is that it helps you to spot bugs during development. This means that a lot of bugs won’t reach production, where your users might see them. Overall you are faster as you spend less time debugging, especially if your project or code base grows in size.</p><p>Rust is a statically typed language, which means that you have to specify types for your variables and functions. The Rust compiler will then check if the types and the concrete values match. Based on the concrete values and how you use them, the Rust compiler can also infer types. This is no unique feature of Rust. Static typing has been around for quite some time in a lot of high-level languages like Java, Kotlin, or TypeScript.</p><h4>Integer Types</h4><pre>let age: u8 = 28;<br>let degrees_celsius: i32 = -10;<br>// underscores can be used as visual separators that Rust does not care about<br>let population = 1_472_000; // same as 1472000</pre><p>Integers can be signed i or unsigned u. Signed integers can be negative. Unsigned integers are always positive. Additionally, the number 8-128 specifies the memory space in bits. So u8 is an unsigned integer that takes up 8 bits of space. There are also theusize and isize types that depend on your computer architecture. <a href="https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-types">If you are unsure what type to use, then use the</a><a href="https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-types">i32 type as the default.</a></p><h4>Floating-Point Types</h4><pre>let gpa = 3.9; // type is inferred as f64<br>let pi: f64 = 3.14;</pre><p>Rust has f32 and f64 as floating-point types. <a href="https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types">Use </a><a href="https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types">f64 as the default type, since it is roughly the same speed as </a><a href="https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types">f32 but more precise</a>.</p><h4>Boolean Type</h4><pre>let rust_is_awesome: bool = true; // true or false?</pre><h4>Character Type</h4><pre>let c: char = &#39;a&#39;;<br>let rustacean = &#39;🦀&#39;;</pre><h4>Tuple Type</h4><pre>let mut tuple: (i32, u32, bool) = (-10, 25, true);<br>tuple.0 = 10; // works</pre><p>Tuples can be used to group values of different types. Tuples have a fixed length, so once you have defined them, you can’t append or remove values. But you can still change existing values if they are of the same type.</p><h4>Array Type</h4><pre>let password: [i32; 5] = [1, 2, 3, 4, 5];<br>let same_numbers = [1; 5]; // same as [1, 1, 1, 1, 1]</pre><p>Every element of an array must have the same type. Similar to tuples, arrays have a fixed length in Rust. Arrays are saved on the stack in Rust.</p><h4>Vector Type</h4><pre>let vector: Vec&lt;i32&gt; = vec![1, 2, 3];<br>let empty_vector: Vec&lt;i32&gt; = Vec::new();</pre><p>Similar to arrays, vectors can only store values of the same type. Vectors are more flexible and don’t have a fixed length, so you can remove or add values. Vectors live on the heap.</p><h4>String Types</h4><pre>// String literals<br>let message = &quot;Hello, Rust!&quot;;<br><br>// String Collections<br>let name: String = String::from(&quot;Alice&quot;);<br></pre><p><strong>String Literals</strong> are surrounded by double quotes and have a fixed size determined at compile time. String Literals are of the type &amp;str which is called <em>String Slice. </em>String Slices are immutable and often used as string references.</p><p><strong>String Collections</strong> are dynamically sized and mutable, meaning that they can change during runtime.</p><p>Warning: Strings are not simple in Rust! (<a href="https://doc.rust-lang.org/book/ch08-02-strings.html#storing-utf-8-encoded-text-with-strings">You can find out more here</a>)</p><h4>Option Type</h4><blockquote>There is no null in Rust</blockquote><p>Yes, you’ve read that correctly. Oftentimes stated as <a href="https://www.youtube.com/watch?v=ybrQvs4x0Ps">the billion-dollar mistake of programming</a>, Rust just removed it. Here is what Rust offers instead.</p><pre>enum Option&lt;T&gt; {<br>  Some(T),<br>  None,<br>}</pre><p>Some(T): Represents the presence of a value of type T. The Some variant contains the actual value.</p><p>None: Represents the absence of a value. The None variant indicates that there is no value present.</p><p><em>Why is this good? What is the benefit?</em></p><ul><li>The Option type encodes the common scenario in which a value could be something or nothing</li><li>So why is it better? =&gt; Because the compiler will prevent us from using variables when there is no value and we have to explicitly handle the option type</li></ul><p>To handle an Option type you can use the match expression that we will explore in the section on <em>Concise &amp; Expressive Syntax</em>.</p><h4>Result Type</h4><pre>enum Result&lt;T, E&gt; {<br>  Ok(T),<br>  Err(E),<br>}</pre><p>The result type is a built-in construct to handle exceptions or error cases in Rust.</p><p>Ok(T): Represents a successful operation and contains the value of the operation.</p><p>Err(E): Represents a failed operation and contains information about the error.</p><h4>Additional Types</h4><p>There are multiple additional types in Rust like Structs, Slices, and Closures. We won’t cover these here as this blog post would have gotten too long otherwise.</p><h3>📎 Concise &amp; Expressive Syntax</h3><p>Rust achieves a nice balance between readability and expressiveness.</p><h4>Functions</h4><pre>fn add_numbers(a: i32, b: i32) -&gt; i32 {<br>    a + b // same as: return a + b;<br>}</pre><p>Rust’s function syntax is clear and concise. fn defines a new function. -&gt; is followed by the return type. Function parameters and return types need to be explicitly declared. Rust allows the omission of the return keyword and the ; symbol to return the last expression in a function implicitly, making the code easier to read.</p><h4>Making variables explicitly mutable</h4><p>Rust promotes a safer approach to mutability by requiring an explicit declaration with mut. With mutability, we tell the compiler that we are planning to change a variable. This improves code clarity, as demonstrated below:</p><pre>fn main() {<br>    let mut counter = 0;  // Explicitly declaring mutability<br>    counter += 1;<br>}</pre><h4>Match expressions with Option and Result</h4><p>Rust’s match expression is a powerful and versatile construct, somewhat comparable to a more feature-rich version of switch statements found in some other languages. You have already learned about the Option and Result type in the section on <em>Static Typing</em>. Rust’s match expression provides a concise way to handle different cases, especially with Option and Result types. Consider these examples:</p><pre>fn process_option(opt: Option&lt;i32&gt;) {<br>    match opt {<br>        Some(value) =&gt; println!(&quot;Value: {}&quot;, value),<br>        None =&gt; println!(&quot;No value&quot;),<br>    }<br>}<br><br>fn process_result(res: Result&lt;i32, &amp;str&gt;) {<br>    match res {<br>        Ok(value) =&gt; println!(&quot;Result: {}&quot;, value),<br>        Err(error) =&gt; println!(&quot;Error: {}&quot;, error),<br>    }<br>}</pre><p>Beyond Option and Result, the match expression can be used with any enumerable type. It&#39;s not limited to specific types, making it a flexible and widely applicable tool for pattern matching.</p><h4>Defining Ranges</h4><p>Rust provides a concise syntax for defining ranges, particularly useful in for loops. The .. syntax creates a range for us. Also, note how readable the loop itself is <em>“for each number in a range from 1 to 5”</em>:</p><pre>fn main() {<br>    for number in 1..=5 { // (1, 2, 3, 4, 5)<br>        println!(&quot;Current number: {}&quot;, number);<br>    }<br>}</pre><p>1..5 would create a range from 1 to 4: (1, 2, 3, 4).</p><h4>Destructuring</h4><p>Rust’s destructuring assignment simplifies working with tuples, arrays, enums, and other types. The example below showcases this feature for tuples:</p><pre>fn get_coordinates() -&gt; (i32, i32) {<br>    (3, 7)<br>}<br><br>fn main() {<br>    let (x, y) = get_coordinates();<br>    println!(&quot;Coordinates: ({}, {})&quot;, x, y);<br>}</pre><h3>🚀 Performance</h3><blockquote>Rust is for people who crave speed and stability in a language. By speed, we mean both how quickly Rust code can run and the speed at which Rust lets you write programs.</blockquote><p>This quote is taken from the book <a href="https://doc.rust-lang.org/book/title-page.html"><em>The Rust Programming Language</em></a>. It highlights that Rust is prioritizing developer productivity without sacrificing runtime performance. Let’s take a deeper look at how Rust achieves that.</p><h4>Zero-Cost Abstractions</h4><p>Zero-cost abstractions are language features in Rust that allow for a better developer experience without incurring any additional runtime overhead. Which essentially means that you can use simple built-in helpers without making your code slower. One example is the contains method that works with vectors as well as with arrays:</p><pre>fn main() {<br>    let numbers = vec![1, 2, 3, 4, 5];<br>    let contains_three = numbers.contains(&amp;3);<br>    println!(&quot;The vector contains 3: {}&quot;, contains_three);<br>}</pre><p>The method contains is an easy way to check the presence of a value in a vector. It is clear what is going on and it is also easy to read that code. Let’s look at the implementation of contains:</p><pre>pub fn contains(&amp;self, x: &amp;T) -&gt; bool<br>where<br>    T: PartialEq&lt;T&gt;,<br>{<br>    self.iter().any(|y| x == y)<br>}</pre><p>The contains method uses the iter() method, which returns an iterator over the elements of the collection. The any method is then called on the iterator, which short-circuits as soon as it finds an element equal to the target (x in this case). The key here is that the implementation leverages Rust’s ownership and borrowing system, allowing for iteration without unnecessary copying or runtime overhead. We will have a deeper look in the section on the <em>Concept of Ownership &amp; Memory Safety.</em></p><h4>The Compiler</h4><p>Rust is often embraced for its great performance statistics during <em>runtime</em>. Why did I highlight the <em>runtime</em> fact here? Because the compile performance is still one of the most criticized points about Rust. Just the fact that this is an actual question in the Rust FAQs shows that developers have some concerns: <a href="https://prev.rust-lang.org/en-US/faq.html#why-is-rustc-slow"><em>Rust compilation seems slow. Why is that?</em></a></p><p>One of the reasons for the perceived slow compile time is the code translations and optimizations that the Rust compiler is performing. Another is the Rust type system, that needs to enforce all the constraints that make Rust safe at runtime.</p><blockquote>Zero-cost abstractions cost compile time after all</blockquote><h4>Freedom from Garbage Collection</h4><p>Rust has no Garbage Collection. Garbage Collection is a feature often used by programming languages to free up memory that is not used anymore. Unfortunately, this can create a performance overhead. After all the Gargabe Collector is just some code that checks if objects are not referenced anymore and then deletes them. As we will see in the next chapter Rust has a different concept of freeing up memory. But most importantly the absence of a Garbage Collector makes Rust more performant.</p><p>One prominent example of Rust’s performance is <a href="https://discord.com/blog/why-discord-is-switching-from-go-to-rust">Discord switching from Go to Rust</a>. Discord’s engineers dived into Rust, enticed by its memory efficiency and absence of a garbage collector, ultimately achieving performance surpassing Go.</p><h3>💾 Concept of Ownership &amp; Memory Safety</h3><p>The concept of <em>ownership</em> is one of Rust’s core features. Ownership is also considered one of Rust’s most distinctive features, granting it the ability to provide strong memory safety guarantees.</p><p>To appreciate the significance of ownership in Rust, it’s instructive to contrast it with the memory management practices in other languages. For instance, in Java, memory management often relies on a garbage collector, a mechanism responsible for automatically reclaiming memory that is no longer in use. Rust, however, takes a different approach. It manages memory through a system of ownership with a set of rules checked by the compiler at compile time. This ownership system is so efficient that none of its features introduce runtime overhead, ensuring that your Rust program remains performant even as it adheres to strict memory safety rules.</p><h4>Ownership Rules</h4><ul><li>Each value in Rust has a variable that’s called its owner.</li><li>There can only be one owner at a time.</li><li>When the owner goes out of scope, the value will be dropped.</li></ul><h4>Scope</h4><p>The concept of ownership revolves around the notion of scope, determining when variables come into existence and when they stop to exist (they go out of scope). Rust ensures memory safety by enforcing strict rules on ownership, preventing issues like dangling pointers and data races. When a variable goes out of scope, Rust calls a special function for us, known as drop. Consider the following code snippet:</p><pre>fn main() {<br>    let x = String::from(&quot;Hello, Rust!&quot;);  // x comes into scope<br><br>    // Some operations with x<br><br>} // x goes out of scope, and Rust automatically calls the drop function </pre><p>In this example, the variable x comes into scope when declared and goes out of scope at the end of the block, ensuring proper memory management. Rust’s automatic invocation of the drop function at the closing bracket ensures that the memory is freed.</p><h4>References and Borrowing</h4><p>Rust’s approach to handling references and borrowing is fundamental to its ownership model. Instead of transferring ownership, Rust allows the borrowing of variables through references. This ensures that multiple parts of code can access data without compromising safety. For instance:</p><pre>fn main() {<br>    let my_string = String::from(&quot;Rust is powerful!&quot;);<br>    print_length(&amp;my_string); // Passing a reference to my_string<br>}<br><br>fn print_length(s: &amp;String) { // &amp; denotes that we receive a borrowed value<br>    println!(&quot;Length: {}&quot;, s.len());<br>} // s goes out of scope, but no ownership is transferred</pre><p>In this example, the print_length function borrows a reference to my_string without taking ownership, demonstrating Rust&#39;s ability to handle shared access to data securely.</p><h4>Memory and Allocation</h4><p>Rust provides precise control over memory allocation, preventing common pitfalls like memory leaks. The ownership system ensures that memory is deallocated when variables go out of scope. Consider this example:</p><pre>fn main() {<br>    let my_string = String::from(&quot;Hello, Rust!&quot;);<br><br>    // &#39;my_string&#39; ownership is moved to &#39;string_owner&#39;<br>    let string_owner = my_string;<br><br>    // The following line would result in a compilation error since <br>    // &#39;my_string&#39; is no longer valid<br>    // println!(&quot;Original string: {}&quot;, my_string);<br>    <br>    // &#39;string_owner&#39; is still valid<br>    println!(&quot;Transferred string: {}&quot;, string_owner);<br>}</pre><p>In this example, the ownership of the my_string variable is moved to string_owner. Attempting to access my_string after the ownership transfer would lead to a compilation error, highlighting Rust&#39;s stringent memory management.</p><p>Additionally, Rust allows dynamic memory allocation using the Box type for creating values on the heap. This combination of ownership, borrowing, and controlled allocation empowers developers to build efficient and safe systems.</p><p>Here is a blog post, from one of my colleagues that goes into more detail about the concept of Ownership:</p><p><a href="https://medium.com/comsystoreply/rust-ownership-animated-intro-4445e662a9ad">Rust Ownership — Animated Intro</a></p><h3>🐛 Detailed Error Messages</h3><p>As developers, we all have experienced how frustrating cryptic error messages can be. Sometimes you just don’t know what to do or where to look. You copy and paste the error message into StackOverflow or Google and still get no results.</p><p>In languages like Java or C++, deciphering error messages can feel like navigating a labyrinth of technical jargon. Just consider these examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*DlO11WQkPf53kMt7" /></figure><pre>#include &lt;iostream&gt;<br>#include &lt;vector&gt;<br><br>int main() {<br>    std::vector&lt;int&gt; numbers = {1, 2, 3, 4, 5};<br>    int sum = 0;<br><br>    for (auto it = numbers.begin(); it != numbers.end(); ++it) {<br>        sum += numbers.erase(it);  // Intending to remove each element<br>    }<br><br>    std::cout &lt;&lt; &quot;Sum: &quot; &lt;&lt; sum &lt;&lt; std::endl;<br>    return 0;<br>}</pre><p>The noble intention here is to calculate the sum of elements as they are erased from the vector. However, the C++ compiler, in its wisdom, graces the developer with an error message that reads like an ancient prophecy:</p><pre>error C2662: &#39;void std::vector&lt;int,std::allocator&lt;_Ty&gt;&gt;::erase(const std::<br>vector&lt;int,std::allocator&lt;_Ty&gt;&gt;::iterator &amp;)&#39;: cannot convert &#39;this&#39; pointer <br>from &#39;const std::vector&lt;int,std::allocator&lt;_Ty&gt;&gt;&#39; to &#39;std::vector&lt;int,std::<br>allocator&lt;_Ty&gt;&gt; &amp;&#39;</pre><p>This confusing error message makes debugging feel like a challenging puzzle. You’re lost without clear clues on where to look, what exactly went wrong, or even how to fix it.</p><blockquote>In Rust, the compiler is your best friend.</blockquote><p>Rust is just awesome for its descriptive and concise error messages. The compiler’s error messages are designed to guide you through understanding and resolving issues. Oftentimes you even get hints about how to solve your errors. Let’s look at an example that we already used and see what happens if we comment out one line:</p><pre>fn main() {<br>    let numbers = vec![1, 2, 3, 4, 5];<br>    let contains_three = numbers.contains(&amp;3);<br>    // println!(&quot;The vector contains 3: {}&quot;, contains_three);<br>}</pre><pre>warning: unused variable: `contains_three`<br> --&gt; src/main.rs:3:9<br>  |<br>3 |     let contains_three = numbers.contains(&amp;3);<br>  |         ^^^^^^^^^^^^^^ help: if this is intentional,<br>  |                        prefix it with an underscore: `_contains_three`</pre><p>We do not use the variable contains_three anymore. The Rust compiler immediately warns us about this and states it clearly unused variable. Also, the compiler tries to figure out what we want to do and gives some help on how to fix the issue (prefixing the variable with an underscore). Consider another example:</p><pre>fn main() {<br>    let greeting = String::from(&quot;Hello&quot;);<br>    let message = greeting;<br>    println!(&quot;{}&quot;, greeting);<br>}</pre><pre>error[E0382]: borrow of moved value: `greeting`<br> --&gt; src\main.rs:4:20<br>  |<br>2 |     let message = greeting;<br>  |                     -------- value moved here<br>3 |     println!(&quot;{}&quot;, greeting);<br>  |                    ^^^^^^^^^ value borrowed here after move<br>  |<br>  = note: move occurs because `greeting` has type `String`, <br>    which does not implement the `Copy` trait</pre><p>This message not only indicates the error but also educates us on the concept of ownership and borrowing, fostering a deeper understanding of one of Rust’s core principles. We are not allowed to use a value after it was moved to ensure memory safety.</p><p>In essence, the error messages just make learning a breeze, by providing actionable insights and enhancing our comprehension. You don’t have to worry about getting something wrong the first time, as the compiler is your friend and will help you learn to write clean Rust code. The detailed error messages are one example of Rust’s commitment to developer-friendly design. There even is a <a href="https://github.com/rust-lang/rustlings/">course</a> that builds on this concept of learning Rust by debugging code!</p><h3>❤️ Bonus: Programmers Love It</h3><blockquote>The Most Loved languages are those that appeal to veteran developers.</blockquote><p>For the last couple of years, Rust has been one of the most loved languages by seasoned software developers according to Stack Overflow’s Developer Survey.</p><p><a href="https://stackoverflow.blog/2023/01/26/comparing-tag-trends-with-our-most-loved-programming-languages/">Comparing tag trends with our Most Loved programming languages</a></p><p>However, a nuanced analysis of data reveals interesting trends. Despite its popularity among experienced developers, Rust is not extensively used by those learning to code, highlighting a gap between love and learning. As we’ve seen, Rust’s detailed error messages play a role in its reputation as a developer-friendly language, offering clear guidance for learners. But I wouldn’t recommend anyone new to programming to start with learning Rust. It’s no surprise that on Stack Overflow, the languages favored by learners, like JavaScript and Python, continue to lead in the total number of tags. If that does not scare you to explore Rust further then read my guide on <em>How to Start Learning Rust </em>below<em>.</em></p><h3>Conclusion</h3><p>Rust brings a unique set of features to the table, making it an excellent choice for developers seeking performance, reliability, and memory safety. Its ownership and borrowing system ensures memory safety without sacrificing performance, and its detailed error messages aid in debugging and learning. Rust’s intuitive syntax and static typing make code easier to read, write, and maintain. These are just some of the points why many programmers love the language.</p><h3>How to Start Learning Rust</h3><p>Learning Rust can be difficult. Especially in the beginning.</p><figure><img alt="The graph shows the difficulty of learning Rust compared to JavaScript. Initially learning JavaScript is easier than Rust. But in the long term Rust becomes easier compared to JavaScript as it gives you a lot of benefits." src="https://cdn-images-1.medium.com/max/390/1*rpzHIanYdV3llY7_QgpJmQ.png" /><figcaption>The path of learning Rust vs JavaScript</figcaption></figure><p>I can agree with this chart. It is from this YouTube video <a href="https://youtu.be/2hXNd6x9sZs?si=dqCmWy7jMh9Ar0Xy"><em>How to Learn Rust — No Boilerplate</em></a>, which is also a great resource to get started. Here is my guide that was inspired by that video:</p><ol><li><strong>Read the book “The Rust Programming Language” from cover to cover once. You can read it for free online.</strong></li></ol><p><a href="https://doc.rust-lang.org/book/">The Rust Programming Language</a></p><p>2. <strong>Read the book again. But this time use the interactive version from Brown University and do the exercises.</strong></p><p><a href="https://rust-book.cs.brown.edu/">The Rust Programming Language</a></p><p>3. <strong>Read “Rust By Example”</strong></p><p><a href="https://doc.rust-lang.org/rust-by-example/index.html">Rust By Example</a></p><p>4. <strong>Do the rustlings course</strong></p><p><a href="https://github.com/rust-lang/rustlings/">GitHub - rust-lang/rustlings: :crab: Small exercises to get you used to reading and writing Rust code!</a></p><h4>Looking for a Job?</h4><p>This blog post was made possible by Comsysto’s concept of <em>Lab Time</em> where employees can use part of their working hours to explore new technologies and build what excites them the most. If you want to do that as well, it’s time you <a href="https://www.comsystoreply.de/career">join Comsysto</a>.</p><h4>Bonus Material</h4><ul><li><a href="https://google.github.io/comprehensive-rust/">Welcome to Comprehensive Rust 🦀</a></li><li><a href="https://fasterthanli.me/articles/a-half-hour-to-learn-rust">A half-hour to learn Rust</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b5d1d7ede" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/half-a-year-of-rust-9b5d1d7ede">Half a Year of Rust 🦀</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Frontend Testing: Essential Best Practices]]></title>
            <link>https://medium.com/comsystoreply/mastering-frontend-testing-essential-best-practices-b0924655e765?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0924655e765</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 08:02:02 GMT</pubDate>
            <atom:updated>2023-08-01T08:02:02.752Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A cover image with blue abstract forms and the title: Mastering Frontend Testing: Essential Best Practices" src="https://cdn-images-1.medium.com/max/1024/1*nAu9INN_3c4ILi3ySPG5mQ.png" /></figure><p>Frontend testing is a crucial aspect of web development that ensures the quality and reliability of your applications. As web applications become increasingly complex and user expectations rise, developers must adopt effective testing strategies. In this blog post, we will explore essential best practices. We will explore three key principles with the aim of improving your ability to write effective tests and develop reliable frontend applications. Additionally, you will be provided with valuable suggestions and guiding questions to consider when formulating your testing strategy.</p><h3>General Principles</h3><h4>Principle 1 — Safeguard against Regressions</h4><p>Are you writing tests for your application? Why do you write tests for your application? — Take a second to think about this.</p><p>Many people say that they write tests to verify that their application is working in the intended way. While this is one aspect of testing, there is more to it, especially when it comes to automated testing. Because once you run your tests very often, what is the purpose of rerunning them if nothing changes? If you run all your tests and they all pass, why should you run them again? If they don’t randomly fail (flakiness), then there really is no purpose in running your tests very often. What usually happens is that you change your application because of changed requirements or bug fixes. Then you run your tests again to see if your application still works.</p><blockquote>Testing is a guard to protect you of non-intended changes of behaviour</blockquote><h4>Principle 2 — Document Requirements</h4><p>Have you ever wondered what you agreed on with your users or your Product Owner about that feature that you implemented last year? What were the requirements? And how was the application supposed to behave again? We’ve all been there… This becomes even more relevant when you want to change your application or implement an additional feature without breaking anything. Why not just read through your test cases to remember the acceptance criteria?</p><blockquote>Your tests should reflect and document the requirements of your users</blockquote><p>So remember this already when you start to write your first test. Your test cases can help your future self to remember your user&#39;s requirements. (This principle is related to <a href="https://www.manning.com/books/specification-by-example">Specification by Example</a>.)</p><h4>Principle 3 — Layer your Tests</h4><p>The test pyramid is another key concept of software testing. And while it is often criticised (<a href="https://medium.com/@mateuszroth/why-the-test-pyramid-is-a-bullshit-guide-to-testing-towards-modern-frontend-and-backend-apps-4246e89b87bd">Why the test pyramid is bullsh*t</a>), I personally think there is value in it. The three main points I take from the test pyramid are:</p><ol><li>You should group your tests into different levels of granularity.</li><li>The higher you are in the pyramid, the slower your tests become, so you should have more tests of the bottom layer (unit) and fewer tests of the top layer (UI) (remember the saying time is money).</li><li>To get the most value of your tests you should strive for more integration and less isolation on the top layer; and for less integration and more isolation on the bottom layer (this again also affects the speed of your tests). Practically this means mocking and stubbing more on the bottom layers and less on the top layers.</li></ol><figure><img alt="The image depicts the test pyramid with three layers. On the bottom layer there are unit tests. On the middle layer there are services test. On the top layer there are user interface tests." src="https://cdn-images-1.medium.com/max/1024/1*zPc52c9h2LxohSDHEYnrJw.png" /><figcaption>The Testing Pyramid</figcaption></figure><blockquote>Use all layers of the testing pyramid (however you might slice them)</blockquote><h3>On Which Layer Should I Put My Test?</h3><h4>A Unit Test is for a reusable component that does a simple job</h4><p><strong>Example:</strong> A custom text field component that displays an error message on a wrong input (e.g. a password field during registration)</p><p><strong>Ask yourself:</strong></p><ul><li>How would a developer expect the component to behave?</li><li>What properties do I need to pass or how will the content change on state updates?</li></ul><p><strong><em>Do</em></strong> test a single component, and its edge cases and error states.</p><p><strong><em>Don’t</em></strong> test multiple components or a combination of hooks and components.</p><h4>An Integration Test should verify the interaction of multiple components in case they rely on each other</h4><p><strong>Example:</strong> A parent component that uses multiple subcomponents (e.g. a registration form that contains multiple text fields)</p><p><strong>Ask yourself:</strong></p><ul><li>How are the components affecting each other?</li><li>How might the components be used together?</li></ul><p><strong><em>Do</em></strong> test multiple components.</p><p><strong><em>Don’t</em></strong> test complex or lengthy flows.</p><h4>An E2E Test should test user interaction flows</h4><p><strong>Example:</strong> Multiple pages or components that make up a whole flow of user interactions (e.g. a user sees the home screen with a success message after the registration)</p><p><strong>Ask yourself:</strong></p><ul><li>How would the user interact with the application?</li><li>What is the goal that the user is trying to achieve?</li><li>What is essential to your application?</li></ul><p><strong><em>Do</em></strong> test complex or lengthy interactions and happy paths and consider using <a href="https://martinfowler.com/bliki/PageObject.html">page objects</a>.</p><p><strong><em>Don’t</em></strong> test the details. Focus on the essential parts of your application.</p><h3>Best Practices</h3><h4>Do</h4><ul><li>Focus your tests on the functionality that is most important to users</li><li>Test all important parts of your application’s functionality, including edge cases and error handling</li><li>Write your tests in a way that is easy to read and maintain</li><li>Avoid test duplication</li><li>Push your tests as far down the test pyramid as you can (more Unit tests, fewer E2E / UI tests)</li><li>Verify if your test case is at a reasonable spot in the test pyramid, e.g. “Does this E2E Test need to be an E2E Test?”</li><li>Use the <em>Given, When, Then</em> format to structure your tests. It is ok to use comments to help the reader e.g. // Given</li><li>Ensure that each unit test focuses on a single aspect =&gt; This approach helps maintain shorter and more comprehensible tests, making it easier to understand and reason about their purpose. It also helps with finding bugs.</li><li>Have clear names for your test cases (e.g. “should display error dialog if email not verified”)</li><li>Try to fail your tests intentionally during implementation to avoid false positives</li><li>Consider Test-Driven Development (TDD) =&gt; Red, Green, Refactor: write a failing test, make it pass, refactor your code</li><li>Include your acceptance criteria in your test cases</li><li>Focus on the main viewport size of your users =&gt; By doing so, you ensure that your application or website is optimised and visually appealing for the most commonly used screen dimensions.</li></ul><h4>Don’t</h4><ul><li>Don’t test implementation details =&gt; Tests should not fail because of a refactoring that didn’t change behaviour</li><li>Don’t use random test data =&gt; Using random test data can lead to inconsistent and unpredictable test outcomes. Test results may vary each time the test suite runs, making it difficult to reproduce failures or identify specific scenarios that cause issues. This makes debugging difficult.</li></ul><pre>// Bad<br>const email = Math.random().toString(36).substring(7) + &#39;@example.com&#39;;</pre><ul><li>Don’t write long unit tests. Don’t write short UI tests.</li><li>Don’t reflect your internal code structure or implementation steps within your tests:</li></ul><pre>// Good<br>it(&#39;should calculate the average of a list of numbers&#39;, () =&gt; {...});<br><br>// Bad<br>it(&#39;should iterate over the array using a for loop, sum the elements by <br>    calling the add() method from class A, divide the sum by the length of the <br>    array, and return the result&#39;, () =&gt; {...});</pre><ul><li>Don’t test trivial cases like text input fields</li></ul><pre>// Bad<br>user.type(&quot;John&quot;);<br>expect(screen.getByText(&quot;John&quot;)).toBeInTheDocument();</pre><ul><li>Don’t test hooks within a unit test for a component, but write separate tests for hooks</li><li>Don’t blow up your test cases with extensive and repetitive test setup code =&gt; use beforeEach / beforeAll, afterEach / afterAll where possible</li><li>Don’t test the framework =&gt; Focus on your application’s specific functionality and features. Don’t duplicate tests that are already covered by the framework’s own testing processes</li></ul><h3>How We Used This Testing Strategy in One of Our Client Projects</h3><p>The main change that we introduced in our team was when we split up our E2E/UI tests into two layers. To distinguish those two layers, we called them: Full-Stack Tests and Browser Tests.</p><figure><img alt="The image shows a pyramid with four layers of tests. On the top there are Full-Stack Tests. Below there are Browser Tests. Below are Integration Tests. On the bottom there are Unit / Component Tests. The top two layers of Full-Stack and Browser Tests form together the E2E and UI Tests and are implemented with Cypress." src="https://cdn-images-1.medium.com/max/1024/1*Nb_CUa1yBRSRxJCDlxg1iA.png" /><figcaption>Testing Pyramid for one of our client projects</figcaption></figure><p>Browser tests are mostly how you would expect your standard UI test to behave. We only tested pure frontend user flows. We mocked all backend or external calls. We used <a href="https://docs.cypress.io/guides/guides/network-requests#Fixtures">Cypress fixtures</a> to mock the returned data.</p><p>For full-stack tests we wanted to test our whole application including the backend, simulating how an actual user would interact with our application. To achieve this we decided to not mock any backend calls, but use sensible sandbox test accounts with realistic data. Also, we agreed to only test business-critical user flows and happy paths.</p><h3>Conclusion</h3><p>Have a discussion with your team about how you want to approach testing. Be sure to discuss the questions of what and how you want to test. What tools will you use? How do you understand the testing pyramid? How will you cut and distribute the layers? It is really important to have these kinds of discussions. Your tests should be as clean and maintainable as your production code. If you do not maintain your tests you will quickly end up in a big mess.</p><h4>Resources</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMWsk1h8pv2Q%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMWsk1h8pv2Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMWsk1h8pv2Q%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9bd5ddf7891b230e174f5b83a642372/href">https://medium.com/media/d9bd5ddf7891b230e174f5b83a642372/href</a></iframe><p><a href="https://martinfowler.com/articles/practical-test-pyramid.html">The Practical Test Pyramid</a></p><h4>Acknowledgment</h4><p>A big thank you goes to Anastasiia El Batya for creating the awesome visuals for this blog post 🙌</p><p>You want to find out what other tools we at Comsysto Reply apply and what services we offer? Visit our website: <a href="https://www.comsystoreply.de/services">https://www.comsystoreply.de/services</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0924655e765" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/mastering-frontend-testing-essential-best-practices-b0924655e765">Mastering Frontend Testing: Essential Best Practices</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use React Context with useState]]></title>
            <link>https://medium.com/comsystoreply/how-to-use-react-context-with-usestate-c8ae4fe72fb9?source=rss-f05e8c6e8324------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8ae4fe72fb9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Korbinian Schleifer]]></dc:creator>
            <pubDate>Wed, 12 Oct 2022 08:02:00 GMT</pubDate>
            <atom:updated>2023-12-19T09:58:28.065Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Are you tired of using props in your React App everywhere? Are you searching for an alternative to Redux? Are your child components passing props further down without using them? Here is a better way!</em></p><figure><img alt="React Context plus useState with the React logo" src="https://cdn-images-1.medium.com/max/1024/1*xKkFCZSTOuGCKkqYKvlHow.png" /></figure><p><strong><em>Prerequisites</em></strong><em>:</em> Basic React knowledge about props, state, components, and hooks. Additionally some TypeScript knowledge. We will use functional components in this example. (Also check out the article from my colleague Johannes on <a href="https://medium.com/comsystoreply/considerations-for-writing-react-components-part-01-introduction-bc4b7048ac72">Considerations for writing React components</a>)</p><h4>Outline</h4><p>1. The problem and when to use Context<br>2. The Basics with an easy Implementation<br>3. A more realistic example<br>4. What to consider</p><h3>1. The Problem and when to use Context</h3><p>One of the most common problems or considerations for using Context is the prop drilling problem. To illustrate this problem we will use a food ordering app as an example. So just imagine you wrote your fancy new food ordering app. Your app has food items that you want to display in a list. Each food item has a counter where you can add items to the shopping cart. To display the items before the order you also wrote a shopping cart component that displays the quantity of the food with a FoodSummary component. The component tree of the app might look something like this:</p><figure><img alt="Food Ordering App component tree with sub components. Food Item and Shopping Cart are sub components of App. Food Counter is a sub component of Food Item. Food Summary is a sub component of Shopping Cart." src="https://cdn-images-1.medium.com/max/1024/1*qKA-np2Blvlb28EYbx1aSg.png" /></figure><p>Here is a simplified code example of how we might keep track of the current count of a food item. The counter state is at the top of the tree because we need it for the FoodCounter and the FoodSummary component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70f19fc9044f2ad4e92276c2656fb013/href">https://medium.com/media/70f19fc9044f2ad4e92276c2656fb013/href</a></iframe><p>As you can see we are passing the state down as prop through the whole tree. In the FoodItem component, we might not even need the state but we only pass it through to the FoodCounter component. This is what the prop drilling problem is all about. (A similar thing could happen with the ShoppingCart and FoodSummary components, which are not shown in the code example)</p><p>By this, we congest our components and it might get hard for other people reading our code to figure out what is going on in them. This might even get worse when we start passing down multiple properties. But what we want is to keep our components clean and only have the states where we actually need them. This is where React Context comes to the rescue.</p><h3>2. The Basics with an easy Implementation</h3><p>Now let’s put this example into perspective. We will rename all building blocks to Component so we can focus on the important part: building up our Context. We will create a Context, a Context Provider, and a Context Consumer to manage our state in a different way.</p><h4>The three main building blocks</h4><figure><img alt="React component tree with a context that is on the side. The Provider is at the parent component and the consumer is at the child component." src="https://cdn-images-1.medium.com/max/1024/1*Irr6ioA9b8EPy0uuaIMSiQ.png" /></figure><p>As you can see from the image above, the three main building blocks are the Context, the Provider, and the Consumer so we need to:</p><ol><li>Create the <strong>Context</strong></li><li>Wrap the parent component with the <strong>Provider</strong></li><li><strong>Consume</strong> the Context</li></ol><h4>1. Create the Context</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/662b93adf31234aa08f3f18af37ed95b/href">https://medium.com/media/662b93adf31234aa08f3f18af37ed95b/href</a></iframe><p>As you can see in the code example, it is really easy to create a Context in React. You just need to call the createContext function. As an argument, you can pass an optional default value. In this case, we just pass &quot;defaultValue&quot; as a string.</p><h4>2. Wrap the parent component with the Provider</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/391db0f6a2101e965bc60cd05bc99999/href">https://medium.com/media/391db0f6a2101e965bc60cd05bc99999/href</a></iframe><p>In the parent component, we can wrap the elements that we return with our Context. Specifically, we are wrapping MyParentComponent with the Provider property of MyContext. This is a default property we get from React after the Context is created. If the Context is created in another file we can easily import it here. As you can see from the example the Provider can be used like any regular component in React.</p><p>Additionally, the Context Provider component comes with a value prop. We can use this to pass any value we like. In this case, we just create a &quot;My Context Value&quot; string and pass it to the Context Provider.</p><h4>3. Consume the Context and use the value</h4><p>Inside MyComponent or some child component down the tree we can use:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12f5974cf042b1894925423d069978dd/href">https://medium.com/media/12f5974cf042b1894925423d069978dd/href</a></iframe><p>So now we can consume our Context directly in MyComponent or in any of its child components. To consume the Context we just call the useContext Hook and pass it our Context (MyContext) as an argument. This gives us the value we <em>provided</em> in the Provider. I guess you can see now where the names are coming from 😉.</p><p>When we have the value we can use it like any other kind of prop or state variable. Here we just return it inside a paragraph.</p><h4>Important: How does React know which value to use?</h4><blockquote>React sees that you are trying to use your Context in the consumer. To find the corresponding value of the Context, React goes up the component tree and looks for a matching provider. If it finds the provider, it uses the value that was defined there. If React however does not find a matching provider going up the component tree, then it will use the default value that you provided on Context creation.</blockquote><h3>3. A more realistic example</h3><p>The first examples were generic and minimalistic to explain the concept of React Context. Now we will look at an example that is much closer to what you would find in a real-world application. As an example, we will use an onboarding or registration flow, where a user signs up in our app.</p><p>For this example, we will use TypeScript. Also, we will create our own Provider component where we will use the useState hook. Imagine that the onboarding flow has multiple steps where we want to share the data between these steps and also show the data in a summary screen. Because we don’t want to pass all the data around as props we will use an OnboardingContext.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa430cb9313e445e1aee2c55d00051e6/href">https://medium.com/media/aa430cb9313e445e1aee2c55d00051e6/href</a></iframe><p>As a starting point, we create an interface for the Context with the username state and a setUsername state action. For simplification, we only use the username here. But of course, you could extend the interface with more properties like the mail address or the user&#39;s birthday.</p><p>After that, we just create our Context as before, which can be of type OnboardingContextValue or undefined. As a default value, we pass undefined. Now let’s create our custom Provider component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/492a28c7495e909fdace3e8bb42e0340/href">https://medium.com/media/492a28c7495e909fdace3e8bb42e0340/href</a></iframe><p>Here we just call our usual useState hook and unpack the username and the setUsername function. Then we return our onboarding Context Provider with all child components. As values, we just pass our username and the setUsername function. Of course, at this point, you could also put in more states and pass them with the value prop to the Provider. Maybe you already wondered why we passed undefined as a default value on our Context creation. Here comes the answer:</p><blockquote><strong>We wrap our Onboarding Context consumer in our own custom hook. This is a nice trick that helps us to catch errors.</strong></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/255d30b52d6aff021eab76d829098305/href">https://medium.com/media/255d30b52d6aff021eab76d829098305/href</a></iframe><p>When the Context is created and can’t find a matching provider, undefined is used as a default value. This will throw an error for us. We actually want this error to happen, because we don’t want to use the default value with our Context. We want to use the states that we defined in our custom Provider component. But if the onboardingContext is undefined we have probably forgotten to wrap our parent component with our custom Provider.</p><p>In order to solve this issue we wrap our parent component with our custom Provider:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3cf3aa852efc17b0968cedb2e665fef/href">https://medium.com/media/e3cf3aa852efc17b0968cedb2e665fef/href</a></iframe><p>To use our state values we can use our custom hook in one of the child components. We just unpack the username and the setUsername function. Now we can use them like any other state value or state action. Similar like when we would have used the useState hook in this component directly. This also makes it easy to move states from single components to a Context.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2370fdd161563aebac2b57966aa86b07/href">https://medium.com/media/2370fdd161563aebac2b57966aa86b07/href</a></iframe><h3>4. What to consider</h3><p>There are certain things that you should consider before introducing Context into your codebase. First, you should start thinking about your data. What data do you need for your components? And also: Where exactly is this data needed? This should give you a clearer picture of your whole application in general. This also includes which data fits together and if the data should really be in a shared Context.</p><p>After that, you can continue by asking yourself: What states am I currently using? You might still need these states but can move them to the Context. Ask yourself which states you want to have in your Context and which state is not needed there, because it is only needed for one component. Also, ask yourself how you are changing the state. You can move the set state functions to your Context but also go a step further by moving custom handlers there.</p><p>Lastly, you should ask yourself if prop drilling is really such a big problem for you. Creating a Context comes with a particular overhead. It might make your application harder to change or refactor. For example Context makes it harder to test your components. It is easier to pass mocked props to your component than writing a custom test render function that wraps the component with the Context in the test. Maybe the overhead of the Context is not worth the small annoyance of passing props.</p><p>Also if we use Context it can be hard to understand how data flows between components. If we use props, it is always obvious, what data goes in and out of a component. With Context would need to do some digging first to find out where the data is actually coming from.</p><h4>To summarise</h4><blockquote>&gt; Not everything needs to be in one Context.</blockquote><blockquote>&gt; Your Context does not need to be globally accessible. Keep state as close to where it is needed as possible.</blockquote><blockquote>&gt; Is prop drilling really a problem in you application?</blockquote><p>Do you like what we are doing and do you want to become part of it? Check out our current job offers: <a href="https://www.comsystoreply.com/career">https://www.comsystoreply.com/career</a></p><p>This blogpost is published by <a href="https://legal.comsysto.com/comsystoreply.de/en/impressum/">Comsysto Reply GmbH</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8ae4fe72fb9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/how-to-use-react-context-with-usestate-c8ae4fe72fb9">How to use React Context with useState</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>