<?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 Sergio Alexandre Duarte on Medium]]></title>
        <description><![CDATA[Stories by Sergio Alexandre Duarte on Medium]]></description>
        <link>https://medium.com/@sergio.alexandre.duarte?source=rss-b4d5c256ce69------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8JOLUD0DhKlLiY4WWiB_Nw.jpeg</url>
            <title>Stories by Sergio Alexandre Duarte on Medium</title>
            <link>https://medium.com/@sergio.alexandre.duarte?source=rss-b4d5c256ce69------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:45:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sergio.alexandre.duarte/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[How to Keep Your OutSystems Architect Happy: Data Modelling Decisions Worth Documenting]]></title>
            <link>https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-data-modelling-decisions-worth-documenting-e234675c625e?source=rss-b4d5c256ce69------2</link>
            <guid isPermaLink="false">https://medium.com/p/e234675c625e</guid>
            <dc:creator><![CDATA[Sergio Alexandre Duarte]]></dc:creator>
            <pubDate>Wed, 30 Sep 2026 06:26:37 GMT</pubDate>
            <atom:updated>2026-10-13T08:03:57.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KI0XIJL_XCvVjrUXGWu3Q.png" /><figcaption>AI generated</figcaption></figure><p>I have seen a production incident caused by a single checkbox. A developer deleted a test Customer record to clean up sample data. The delete rule on the Order reference was set to Delete, not Protect. Forty-three orders disappeared with it. Nobody remembered setting that rule, because nobody wrote it down.</p><p>That is not a bug. That is a decision nobody documented, made visible by data loss.</p><p>In the <a href="https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-write-code-that-doesnt-come-back-to-haunt-you-69444dbd3651">first article</a> I argued that how you write OutSystems code today decides how much it costs you tomorrow. In the <a href="https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-naming-conventions-nobody-argues-about">second</a> I covered naming, the smallest unit of shared language. This one is about something more dangerous because it is invisible: the modeling decisions buried in checkboxes and properties that nobody sees unless they go looking.</p><h3><strong>Why modeling decisions are architecture, not detail</strong></h3><p>A name is visible everywhere it is used, but a delete rule, a mandatory flag, or the choice between an Entity and a Static Entity is visible nowhere until it fires. You only discover it when a delete fails with a foreign key constraint error, or silently cascades and removes records you meant to keep.</p><p>These decisions do not stay contained to one entity. A mandatory foreign key changes the join type an Aggregate generates by default, which changes which records show up on a screen. A delete rule decides whether a cleanup script wipes half your database or throws an error. None of this is visible in Service Studio without opening each attribute one by one.</p><h3><strong>Decisions that remove the guesswork</strong></h3><p>These are the ones that repeatedly cause incidents or rework in OutSystems factories when nobody wrote down the reasoning.</p><h4>1. <strong>Delete rule per reference attribute</strong></h4><p>OutSystems gives you three options for what happens to child records when the parent is deleted:</p><ul><li><strong>Protect</strong>: blocks the delete. You can’t remove the parent while children exist.</li><li><strong>Delete</strong>: cascades. Removing the parent removes every child record too.</li><li><strong>Ignore</strong>: allows the delete but leaves the child’s foreign key pointing at nothing. This breaks referential integrity silently.</li></ul><p>Protect is the OutSystems default, and it’s the safest choice for most master-detail relationships. It forces someone to make an explicit decision before data disappears, instead of letting it happen automatically.</p><p>Before picking a rule for a relationship you haven’t set before, check the <a href="https://success.outsystems.com/documentation/11/building_apps/data_management/data_modeling/entity_relationships/delete_rules/">official delete rules documentation</a>. The three options behave differently at scale than they appear to in a quick Service Studio test.</p><p>Whatever you pick, write down why. One sentence per relationship is enough: “Order references Customer as Protect because orders are legal records and must never disappear silently.”</p><h4>2. <strong>Mandatory vs Optional foreign keys</strong></h4><p>This single checkbox decides your Aggregate join type. Mandatory generates an INNER JOIN (Only With) by default; Optional generates a LEFT JOIN (With or Without).</p><p>If a developer makes a foreign key mandatory to “be safe,” every Aggregate touching that relationship silently drops rows where the link is missing, and nobody notices until a report comes up short.</p><p>Marking a foreign key mandatory in the entity does not stop bad data on its own. The database will reject a NULL, but it will not tell you the record you referenced doesn’t exist, and OutSystems will not stop you from trying to save a default value that quietly bypasses the check. That validation belongs in the Core Service (CS) Validate action, not in a Business Logic (BL) module: confirm the identifier is not empty and that the referenced record exists, before the Create or CreateOrUpdate action runs. Business rules about <em>*when*</em> that reference is required belong in BL. Whether the check exists at all does not.</p><p>Document which foreign keys are structurally required by the business (Order must have a Customer) versus which are optional by design (Order may have a Referrer), and confirm the CS layer actually enforces the mandatory ones.</p><h4>3. <strong>Entity, Static Entity, or Site Property</strong></h4><p>This is a three-way decision, not two.</p><p>Static Entities are for closed, mostly immutable sets known at design time (statuses, types, roles). Regular Entities are for anything that changes at runtime or grows past a handful of records. Site Properties are for configuration, not data: API keys, feature toggles, URLs, single values with no relationships that change per environment rather than per business event. A country list is a Static Entity. A feature flag is a Site Property. Confusing the two gets you a Static Entity nobody can change without a deploy, or a Site Property trying to hold structured, related data it was never built to hold.</p><p>Static Entities carry a trap of their own. The identifier’s “Is AutoNumber” property defaults to Yes. If you need a text identifier instead, you must switch it to No before the entity’s first publish. Publish once with AutoNumber left on and the identifier is locked permanently, you cannot change it afterward, and the only way out is a new Static Entity plus a rewire of every reference to it. This is not a style preference, it is a one-shot setting with no do-over, which makes it the single most invisible decision in this list.</p><p>Document the line your team uses to decide between the three, and check the identifier setting on every new Static Entity before the first publish, not after.</p><h4>4. <strong>Soft delete convention</strong></h4><p>IsDeleted plus DeletedOn, applied to every entity that needs history, or applied to none. A factory where half the entities soft-delete and half hard-delete forces every query author to check first, every time.</p><p>Document which entities are exempt and why (lookup tables usually don’t need history; financial and audit-relevant entities usually do).</p><h4>5. <strong>Normalization boundary</strong></h4><p>Third Normal Form (3NF) is the default assumption. Every deliberate deviation, a denormalized column for reporting speed, a cached calculated field, needs one line explaining the tradeoff it was made for.</p><p>Without that line, the next developer either “fixes” your intentional denormalization or copies the pattern somewhere it does not belong.</p><h4>6. <strong>Attribute count and entity splits</strong></h4><p>There is no hard OutSystems limit, but an entity that keeps absorbing unrelated attributes becomes an aggregate-of-everything that every screen partially depends on.</p><p>The trigger to split is usually one of three signals: a distinct lifecycle (the fields change on a different schedule or by a different actor than the rest of the entity), a distinct access pattern (most screens never touch this data, so it slows down every query that does load the full row), or a distinct owner (a different team or module is responsible for it). Large or infrequently needed fields, images, long text, attachments, are the clearest case of a distinct access pattern: keeping them on the parent table means every list screen pays the load cost even when it never displays them.</p><p>Splitting is not free. Fields moved to a new table lose their history in the old one from that point forward. If existing data needs to survive the split, write the migration plan before you touch the entity, not after someone asks where a value went.</p><p>Document the point at which your team splits an entity into a primary table and a detail table, and what triggers that split.</p><h4>7. <strong>Computed vs stored attributes</strong></h4><p>FullName as a stored, maintained column versus FirstName + “ “ + LastName computed at query time. Both are valid. What’s not valid is deciding it differently per developer per entity.</p><p>Document the default (compute unless there’s a performance reason to store) and the exceptions.</p><h4>8. I<strong>ndexing beyond the automatic PK index</strong></h4><p>OutSystems auto-indexes primary keys and foreign keys. Anything else, attributes used in frequent filters or sorts, is a manual decision that gets forgotten under deadline pressure.</p><p>Document which non-key attributes are indexed and the query pattern that justified it, so the next person doesn’t drop it during a “cleanup.”</p><h4>9. <strong>Composite uniqueness without a composite primary key</strong></h4><p>OutSystems does not let you create an Entity with a composite primary key. If uniqueness depends on a combination of attributes, an iPhone 15 in red is a different product record than an iPhone 15 in black, but the pair (Product, Color) must be unique, the platform gives you no native way to declare that on the key.</p><p>The workaround is a unique index across the combination of attributes, and the same rule enforced again in the CS Validate action so the user gets a clean validation error instead of a raw database constraint failure. Skip either half and you get a bug that only shows up under concurrent inserts, long after the entity shipped.</p><p>Document which entities rely on a composite unique index instead of a natural composite key, and confirm the CS Validate action checks it, not just the database.</p><h3><strong>A minimal, enforceable template</strong></h3><p>You do not need a data governance document nobody opens. You need a one-page data dictionary addendum, attached to the Entity Diagram, that answers five questions per relationship and per entity:</p><ul><li>Reference attribute: delete rule and one-line reason (e.g., OrderId on Invoice -&gt; Protect, invoices are financial records)</li><li>Foreign key: mandatory or optional, the business reason, and where the not-null/existence check is enforced</li><li>Entity type: Entity, Static Entity, or Site Property, and why</li><li>Soft delete: applied or not, and why</li><li>Composite uniqueness: which attribute combination must be unique, and whether a unique index plus CS Validate check exists for it</li></ul><p>This lives next to the Entity Diagram in your factory’s documentation module, not in a wiki nobody opens after month one.</p><h3><strong>How to make this stick without bureaucracy</strong></h3><p>The naming rules stuck because they were enforced in code review, not because someone read a document. The same applies here, with one addition: modeling decisions need to be reviewed at the moment the entity or relationship is created, not after.</p><p><strong>What works in practice:<br></strong>A Pull Request (PR) that adds a reference attribute without an explicit delete rule comment does not get approved. Any deviation from Protect as the default gets one sentence of justification in the PR description. A PR that adds a mandatory foreign key without a corresponding CS Validate check for existence does not get approved either, the checkbox and the enforcement travel together. When converting between Entity, Static Entity, or Site Property, the reason travels with the change, not just the change itself. A Static Entity’s “Is AutoNumber” setting gets confirmed in review before the first publish, because there is no fixing it after. Shared, cross-team entities get a stricter bar: no undocumented delete rule or mandatory flag change without architect sign-off, because the blast radius is bigger than one module.</p><h3><strong>What a happy architect actually wants</strong></h3><p>As an architect, I do not care whether you default to Protect or Delete. I care that when I open an Entity Diagram, I can tell which relationships are load-bearing and which are convenience links, without opening every attribute to find out.</p><p>Naming problems cost you search time. Modeling problems cost you data. A missing name is an annoyance. A wrong delete rule is a production incident with your name on the postmortem.</p><p>The teams that avoid these incidents are not the ones with the most rigorous 3NF discipline. They are the ones who wrote down, in one place, why the model looks the way it does, so the next person doesn’t have to reverse-engineer intent from a checkbox.</p><p>If your architect opened your Entity Diagram right now and asked why a single reference attribute is set to Ignore, could anyone on the team answer without guessing?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e234675c625e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-data-modelling-decisions-worth-documenting-e234675c625e">How to Keep Your OutSystems Architect Happy: Data Modelling Decisions Worth Documenting</a> was originally published in <a href="https://medium.com/team-resilience">Team Resilience</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 Keep Your OutSystems Architect Happy: Naming Conventions Nobody Argues About]]></title>
            <link>https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-naming-conventions-nobody-argues-about-a8efd2ef9603?source=rss-b4d5c256ce69------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8efd2ef9603</guid>
            <category><![CDATA[outsystems]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Sergio Alexandre Duarte]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 06:01:01 GMT</pubDate>
            <atom:updated>2026-07-28T14:33:05.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Keep Your OutSystems Architect Happy: Naming Rules Nobody Should Argue About</h3><p>I have seen developers on the same team write CreatedBy, Creation_By, CreatedByUserId and CreateByUserId for the exact same type of operation. No one flagged it in code review. Six months later, a new developer joined and had to map all four before understanding what any of them did.</p><p>That is not a style difference. That is a missing shared language.</p><p>In the <a href="https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-write-code-that-doesnt-come-back-to-haunt-you-69444dbd3651">first article</a> I argued that the way you write your OutSystems code today will either save or cost you hundreds of hours tomorrow. This one is about the smallest unit of that: the names you give to things.</p><h3>Why This Matters</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ujX6TRwblHU5nHfjx3t91w.png" /><figcaption>Illustration: AI-generated</figcaption></figure><p>OutSystems amplifies naming problems. You are not just naming variables. You are naming entities and attributes that become database schema, Aggregates and Data Actions that get reused across screens and modules, and Server Actions and integrations that show up in other applications.</p><p>A bad name leaks everywhere. It shows up in Service Studio search, in dependencies, in architecture maps. If your naming is inconsistent, your architecture becomes inconsistent. The system stops being predictable.</p><h3>Core Idea: Predictability, Not Originality</h3><p>You are not trying to come up with clever names. You are trying to make names guessable.</p><p>If I open your OutSystems factory and can predict what a module is responsible for from its name, how Aggregates and Actions are named inside it, and which attributes are keys, flags, or audit fields, then I can move fast without a tour guide. That is where the real time savings are.</p><h3>Practical Rules</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*euPP56HIKowPJeEYVgzNXw.png" /><figcaption>Illustration: AI-generated</figcaption></figure><p>Keep the rules boring and strict. The value is in consistency, not creativity.</p><p><strong>1. Align with OutSystems casing, and keep it consistent</strong><br> OutSystems pushes PascalCase on most public elements. Use that as your default: Entities, Structures, Actions, and public variables in PascalCase. Local and screen variables can be camelCase if you want to distinguish them, or PascalCase if you do not care. Do not mix CreatedBy, created_by, and createdBy in the same factory.</p><p><strong>2. Make identity fields obvious</strong><br> A thing’s Id is always Id. A foreign key is always &lt;EntityName&gt;Id.</p><ul><li>Use: Id, CustomerId, OrderId, CreatedBy, UpdatedBy</li><li>Avoid: CreatedByUserId, CustomerRef, User, Parent without Id</li></ul><p>In an Aggregate, Join, or Data Action, you should not have to open the entity to know whether a field is an identifier or a full record.</p><p><strong>3. Standard audit fields across the whole factory</strong><br> Pick one set and never argue about it again: CreatedOn, CreatedBy, UpdatedOn, UpdatedBy. Optional but recommended: DeletedOn and IsDeleted for soft-delete. Do not let CreationDate, CreatedAt, LastUpdated, or ModifyDate sneak in — every variation is a filter to get wrong when joining entities or writing reports.</p><p><strong>4. Treat action names as your API surface</strong><br> Server Actions, public actions, and Service Actions are the API of your architecture. Use clear verb patterns:</p><ul><li>Use: CreateOrder, GetOrderById, GetOrdersByCustomerId, UpdateOrderStatus, DeleteOrder</li><li>Avoid: FetchOrder, BuildOrder, ProcessOrderUpdate, HandleOrder</li></ul><p>If I see GetXById in one module and FetchX somewhere else, I have to context-switch every time I search.</p><p><strong>5. Name Aggregates and Data Actions by what they return</strong><br> Aggregates have a huge blast radius, they get cloned and reused everywhere. Name them after the dataset, not the screen.</p><ul><li>Use: OrdersByCustomerId, ActiveSubscriptions, UsersWithRoles, InvoicesPendingApproval</li><li>Avoid: GetOrders, OrderListData, InvoiceScreenData</li></ul><p>If you change a screen, the Aggregate name should still make sense.</p><p><strong>6. Keep booleans readable in expressions</strong></p><ul><li>Use: IsActive, IsArchived, HasPermission, CanEditInvoice</li><li>Avoid: Active, ArchivedFlag, Permission, Editable</li></ul><p>In OutSystems flows, conditions sit far from the declaration. IsActive reads like a sentence. Active reads like a bug waiting to happen.</p><p><strong>7. Be ruthless about abbreviations</strong><br> Only a few earn their place: Id, URL, API. Use Customer, not Cust. Use Number, not Nr. Use Identifier, not Idtf. You save a few characters and cost people minutes of &quot;what is this again&quot; over the system&#39;s lifetime.</p><h3>Common Mistakes</h3><p>These are the specific failures the rules above are designed to prevent. If you see any of these during code review, that’s your signal to stop and fix it before merge.</p><ul><li>Three variants of the same concept in one factory (CreatedBy, Creation_By, CreatedByUserId, CreateByUserId) ; usually the result of different developers never aligning on rule 1 or 3.</li><li>Foreign keys that don’t end in Id (CustomerRef, Parent); forces every consumer to open the entity to check the field type.</li><li>Aggregates named after the screen that first used them (InvoiceScreenData) instead of what they return; breaks the moment the screen changes or the Aggregate gets reused elsewhere.</li><li>Action verbs that don’t match the rest of the factory (FetchOrder next to GetOrderById); creates search friction every single time someone looks for the right action.</li><li>Booleans without a readable prefix (Active, Editable); ambiguous in conditions and easy to misread as a non-boolean field.</li><li>Custom abbreviations invented per-developer (Idtf, Nr, Cust); nobody agrees on the abbreviation, so it becomes its own naming problem.</li></ul><h3>Checklist</h3><p>Use this as your rollout plan, not a one-time document to publish and forget.</p><ul><li>Write the naming rules as one page, not a 20-page Confluence doc; the rules above already fit on one page.</li><li>Add the rules to your code review checklist so a request with User, UserId, and UserIdentifier in the same action cannot be approved.</li><li>Fix names opportunistically when you touch a module; no big rename project, just continuous cleanup.</li><li>Enforce strictly in shared modules; if it is used by multiple teams, the naming rules are not optional.</li><li>Apply the minimal template below across Entities, Attributes, Actions, Aggregates, and Modules:</li></ul><blockquote>Entities: singular nouns — <em>Customer, </em><em>Order, </em><em>Invoice</em></blockquote><blockquote>Attributes: primary key as <em>Id | </em>foreign keys as<em> </em><em>&lt;EntityName&gt;Id | </em>audit fields as<em> </em><em>CreatedOn, </em><em>CreatedBy, </em><em>UpdatedOn, </em><em>UpdatedBy | </em>soft delete as<em> </em><em>DeletedOn, </em><em>IsDeleted | </em>booleans as<em> </em><em>IsX, </em><em>HasX, </em><em>CanX</em></blockquote><blockquote>Actions:<em> </em><em>Create&lt;Entity&gt; | </em><em>Get&lt;Entity&gt;ById | </em><em>Get&lt;Entities&gt;By&lt;Filter&gt; | </em><em>Update&lt;Entity&gt; | </em><em>Delete&lt;Entity&gt;</em></blockquote><blockquote>Aggregates and Data Actions: <em>&lt;Entities&gt;By&lt;Filter&gt; | </em><em>Active&lt;Entities&gt; | </em><em>&lt;Entities&gt;With&lt;RelatedThing&gt;</em></blockquote><blockquote>Modules: keep a simple layer hierarchy such as <em>Customer.Core, </em><em>Customer.UI, </em><em>Customer.API.</em>Do not mix domain name and technical names in the same layer.</blockquote><p>This is not the only correct template. The important part is that you choose one and apply it everywhere.</p><h3>Conclusion</h3><p>As an architect, I do not care if you prefer CreatedOn over CreatedAt. I care that I can open any high-traffic module and know where to start, predict entity, action, and aggregate names without guessing, and trust that similar problems look similar in the model.</p><p>You do not have a naming style problem. You have a time problem. Every irregular name is a small tax you pay every time someone reads or searches for it, and across a team and a year, that tax adds up fast.</p><p>So here is the question for this article: if a developer you have never met searched your factory for CustomerByEmail right now, would they find exactly what they expect, or three slightly different guesses?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8efd2ef9603" width="1" height="1" alt=""><hr><p><a href="https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-naming-conventions-nobody-argues-about-a8efd2ef9603">How to Keep Your OutSystems Architect Happy: Naming Conventions Nobody Argues About</a> was originally published in <a href="https://medium.com/team-resilience">Team Resilience</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 Keep Your OutSystems Architect Happy: Write Code That Doesn’t Come Back to Haunt You]]></title>
            <link>https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-write-code-that-doesnt-come-back-to-haunt-you-69444dbd3651?source=rss-b4d5c256ce69------2</link>
            <guid isPermaLink="false">https://medium.com/p/69444dbd3651</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[outsystems]]></category>
            <dc:creator><![CDATA[Sergio Alexandre Duarte]]></dc:creator>
            <pubDate>Tue, 12 May 2026 08:31:00 GMT</pubDate>
            <atom:updated>2026-05-12T14:58:42.065Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months ago, I did a presentation to our Development Teams about maintainability, and ended with a cautionary message: the way you write your code today will either save or cost you hundreds of hours tomorrow.</p><p>That presentation sparked debates among us, and I’ve been thinking about it ever since. So I’ve decided to write a guide for any OutSystems developer who wants to build systems that don’t become nightmares a few months down the line.</p><p>Let’s get into it.</p><h4>1. Why Maintainability Matters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4NM8OxAZhEfJq6zo" /><figcaption>Illustration: AI-generated</figcaption></figure><p>“Here’s a question worth sitting with: how much of your team’s time is actually spent building new features versus trying to figure out why that code was built that way, fixing features that were broken by a recent change, or just understanding where to start?”</p><p>Research shows that developers spend roughly 41%¹ of their working time dealing with technical debt and bug fixes rather than delivering new value. That’s almost half the working week, gone.<br> <br>Not on innovation, not on new features, but on the consequences of decisions made under pressure in the past. And somehow we don’t learn from the pain we went through because we keep perpetuating the same behavior.</p><p>Maintainable code isn’t just a best practice. It’s a cost reduction strategy that pays dividends for the entire lifetime of your system. Here’s what it actually delivers:</p><ul><li><strong>Less technical debt accumulation.</strong> Clean, well-structured code from the start means you’re not paying interest on shortcuts you’ve already forgotten about.</li><li><strong>Better team productivity. </strong>Readable, well-organised code means developers spend less time deciphering what someone else wrote and more time delivering value. No more “only João knows how that module works…”</li><li><strong>Fewer bugs introduced during changes.</strong> Tightly coupled, poorly structured code means fixing one thing often breaks another. Clear boundaries and single responsibilities make changes predictable.</li><li><strong>Faster onboarding.</strong> When a new developer joins a project, with maintainable code they become productive much faster because the codebase becomes self-explanatory.</li><li><strong>Up to 50% faster feature delivery.</strong> Teams with clean architecture can add new functionality additively, not destructively.</li><li><strong>A codebase that can scale.</strong> A system should be able to accommodate as many developers it needs to its growing amount of modules without having dependencies on specific people to do specific parts of the code.</li></ul><h4>2. Understanding Technical Debt</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vi6zyP_wujTH7AEL" /><figcaption>Illustration: AI-generated</figcaption></figure><p>Let’s be clear: every team has technical debt. Every single one. It doesn’t mean you’re doing something wrong; it means you’re building real software under real pressure. The problem isn’t debt itself. The problem is pretending it doesn’t exist.</p><p>Technical debt arises from time constraints and changing requirements. We’ve all been there: the deadline is Friday, the requirement changed on Thursday, and you just need to get it done. That’s not negligence, that’s software development.</p><p>The danger comes when it compounds. Think of it like a messy desk. One sticky note is fine. Ten sticky notes, you can still find things. But after a year of “I’ll sort this later”? You don’t even have a place to sit anymore.</p><p>You saved two days in March. Congratulations! Your prize? Well you’ll spend three weeks in October figuring out why everything is broken and creating hot fixes for that data in production.</p><p>The solution? If you have to take shortcuts, be intentional when you do so. Name them for what they are, and have a plan to address them. Debt that’s tracked and managed is manageable. Debt that’s forgotten is a ticking time bomb.</p><h4>3. Core Principles of Maintainable Code</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Y_9ureKRSy9p-QL" /><figcaption>Illustration: AI-generated</figcaption></figure><p>When I open a module I haven’t seen before, I ask myself these four questions:</p><ol><li>Does each component have a single and clear job?</li><li>Can I read the flow without simulating every branch?</li><li>Is the naming telling me what it does?</li><li>Is it consistent with the rest of the codebase?</li></ol><p>These four questions map the four principles that make code maintainable: Modularity, Simplicity, Readability, and Consistency.</p><p>These are not only principles worth memorising. If any of the answers is <strong><em>“no”,</em></strong> that is a signal that tells me that the module is going to cost extra time to analyse, even before I start diving into the business logic.</p><h4>4. Practical Best Practices in OutSystems</h4><p>The OutSystems platform gives you a lot of power. That power can create quality or chaos depending on how you use it. Here are the non-negotiables worth agreeing on as a team:</p><ul><li><strong>Keep logic readable at a glance.</strong> Avoid deeply nested conditions and unnecessary boolean inversions. Your actions should have a clear top-to-bottom happy flow where the main success path reads naturally without mentally simulating every branch. Agree as a team on consistent true/false arrow directions in if-statements. It sounds trivial until you multiply every inconsistency across thousands of nodes and dozens of modules.</li><li><strong>Make actions self-descriptive.</strong> Names and comments should explain the flow without needing to open every element. A developer reading your action should understand the intent without needing to click into everything.</li><li><strong>Documentation is not optional, it’s architecture. </strong>Add inline comments to every public action. Not on every node, but enough that the overall intent and flow are clear at a glance. Undocumented implementation decisions like these are the most dangerous surprises during debugging.</li><li><strong>Data modelling decisions need context. </strong>For every entity, document whether it is or not a multi-tenant. A developer joining mid-project should not have to reverse-engineer architectural decisions made months earlier. Use clear, descriptive attribute names and follow the IsAttribute pattern for booleans: IsActive, IsDeleted, IsVerified. Ambiguous field names are a maintenance risk that compounds over time.</li><li><strong>Handle exceptions or don’t catch them. </strong>Re-raising an exception is not handling it. Log at the point of actual handling, once, not at every layer. Logging at every layer creates noise that makes debugging harder, not easier. The stack trace should tell a clear story, not a choose-your-own-adventure.</li><li><strong>Naming is documentation. </strong>Every action, entity, attribute, and variable should communicate its purpose instantly. If a developer needs to open the implementation to understand what something does, the name has already failed. Agree on naming conventions as a team and enforce them in code reviews. One developer writing GetUser, another writing FetchUserData, and a third writing UserRetrieve for equivalent operations is not a minor style difference. It means your codebase has no shared language.</li><li><strong>Folder structure is the first impression. </strong>How you group actions tells the next developer how to think about the module. Group by purpose, not by convenience. Before organising a folder, ask: does this grouping improve maintainability? Folder structure is often the first thing a new developer encounters. Make it count.</li></ul><p>The principles are consistent across all of these: clarity, intent, and respect for the developer who comes next. That developer might be a teammate, a new hire, or yourself six months from now.</p><h4>5. Embedding Maintainability in Your Way of Working</h4><p>Knowing best practices is the easy part. The hard part is making them stick when deadlines are close, the sprint is full, and someone just needs to get it done. Maintainability only becomes real when it stops being a principle you agree with and starts being something your team does every single day.</p><p><strong>Start with the code in front of you.</strong> Every time you open an existing action to make a change, you are already spending time understanding it. Use that time. Add a comment. Clean up a confusing name. Improve the flow structure slightly. It costs you a few minutes and saves the next developer hours. That next developer is often you, three months from now, wondering what you were thinking.</p><p><strong>Bring debt to the surface before the sprint starts, not during it.</strong> If a user story touches an area with structural issues or poor readability, raise it in refinement. Name it, estimate it, and plan for it. Debt that surfaces mid-sprint creates pressure, and pressure creates shortcuts, and shortcuts create more debt. Break the cycle before it starts.</p><p><strong>Let someone else read your code.</strong> After a large or complex story is delivered, invite a developer from another team to walk through the implementation cold, no context, no guided tour. If they cannot follow the logic without asking questions, that is your signal. Not a blame session, just a signal. The goal is a codebase that explains itself to anyone, not just the person who built it.</p><p><strong>Design before you build.</strong> The worst time to think about architecture is when you are already inside Service Studio building it. Sketch the flow first. On paper, on a whiteboard, in a notes app. Define your inputs, outputs, decision points, and error paths before you place a single node. Five minutes of upfront thinking prevents thirty minutes of untangling later.</p><p><strong>Make maintainability part of your code review criteria.</strong> Correctness is not enough. If a comment is missing, if the naming is unclear, if the flow is hard to follow, send it back. Not harshly, but consistently. Over time, this does something no documentation or team presentation ever achieves: it shapes habits. People write cleaner code when they know clarity is a requirement, not a bonus.</p><p>The teams that maintain clean codebases are not smarter or more disciplined by nature. They just built the right habits into the right moments: refinement, review, delivery, and every time they open a file.</p><h4>Key Takeaways</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PC3TMwyvXaUS1mYa" /><figcaption>Illustration: AI-generated</figcaption></figure><p>You don’t have a code quality problem. You have a time problem.</p><p>Every messy action, every undocumented entity, every “I’ll clean this up later” decision is a debt note signed with someone else’s name. And that someone else is usually future-you, six months from now, with a critical bug open and a user waiting.</p><p>The teams that win at maintainability are not the ones with the most discipline. They’re the ones who stopped treating quality as a virtue and started treating it as a default. They made clean code the path of least resistance, not a conscious choice on a good day.</p><p>So here’s the real question to take away: if a developer you’ve never met opened your most-touched module right now, what would they think of you?</p><ul><li>**References** <br>[1] <br>Stripe. The Developer Coefficient (2018). <br><a href="http://stripe.com/files/reports/the-developer-coefficient.pdf">stripe.com/files/reports/the-developer-coefficient.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69444dbd3651" width="1" height="1" alt=""><hr><p><a href="https://medium.com/team-resilience/how-to-keep-your-outsystems-architect-happy-write-code-that-doesnt-come-back-to-haunt-you-69444dbd3651">How to Keep Your OutSystems Architect Happy: Write Code That Doesn’t Come Back to Haunt You</a> was originally published in <a href="https://medium.com/team-resilience">Team Resilience</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>