<?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 Wesley Beary on Medium]]></title>
        <description><![CDATA[Stories by Wesley Beary on Medium]]></description>
        <link>https://medium.com/@geemus?source=rss-7e03b2ae6c9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rF5fHc2EI9zfIT6c</url>
            <title>Stories by Wesley Beary on Medium</title>
            <link>https://medium.com/@geemus?source=rss-7e03b2ae6c9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:03:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@geemus/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[Developing CLIs]]></title>
            <link>https://medium.com/effortless-encryption/developing-clis-29c223171313?source=rss-7e03b2ae6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/29c223171313</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[cli]]></category>
            <dc:creator><![CDATA[Wesley Beary]]></dc:creator>
            <pubDate>Mon, 12 Aug 2024 18:40:45 GMT</pubDate>
            <atom:updated>2024-08-12T18:40:45.069Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHsNAz8WD7PHsgrUnWeDpw.png" /></figure><p>Building CLI features often boils down to:</p><ul><li>Release new API endpoint(s).</li><li>Build new CLI actions that need the API changes.</li><li>Realize mistakes were made in the API you just released.</li><li>Try to fix the API for this feature without creating more problems in the future.</li><li>Try to remember what you were trying to achieve in the CLI and then actually achieve it.</li><li>GOTO: realize mistakes were made.</li></ul><p>Each step requires the one before and oops we’ve reinvented waterfall project management. You get worn down by the pain trying to gracefully pave over mistakes until you limp to functional, but bow out well before exceptional. And don’t get me started on maintaining the resulting cluster of ad-hoc “fixes” and warts.</p><p>Been there, done that. We knew we needed to move past the waterfall-ish approach.</p><p>Here is the story of how we got there and some of the tools that helped along the way.</p><h3>Off to a Sketchy Start</h3><p>We wanted cheap, fast iteration until we understood the feature, and only then commit to expensive implementation and long-term support. As a small team, I was often doing this process end to end, and wanted to focus on each part in turn. We wanted to fake implementation parts until we felt confident enough to make it.</p><p>Getting back to the process, it starts with proposing features. We wanted to get out of the abstract, but not if it meant half-baked implementation. We faked it with “sketches”, inspired by the Google Docs CLI sketch approach that Github describes <a href="https://www.youtube.com/watch?v=zsjeZZVAk1E&amp;t=685s">here</a>.</p><p>Unfortunately, static sketches didn’t quite give us the feedback we wanted. Our CLI changes output over time, more like animation than a drawing. To achieve higher fidelity, I wrote little Ruby programs to take basic inputs and respond by printing appropriate canned responses.</p><p>Since then we’ve found an even better way to capture animated CLI output, but to explain that requires a little detour.</p><h3>Do You Even Test?</h3><p>As we started to flesh out our CLI, we also wanted to test edge cases and detect regressions. I surveyed public <a href="https://cobra.dev/">cobra</a>/<a href="https://github.com/charmbracelet/bubbletea">bubbletea</a> based CLIs to look for ideas, and found frustratingly few tests. Then we stumbled upon Charm’s <a href="https://charm.sh/blog/teatest/">teatest</a> which gave us a starting point.</p><p>Teatest focuses on golden tests, capturing a known good output and then asserting that future outputs continue to match it. Which brought us back, once again, to high fidelity capture of animated CLI outputs. Teatest gave us the great idea of a frame-based solution, like a flipbook, which we have built upon:</p><pre>─── SigninHeader ───────────────────────────────────────────────────────────────<br># Signin To Your CLI Account `cli auth signin`<br>─── SigninInput --──────────────────────────────────────────────────────────────<br># Signin To Your CLI Account `cli auth signin`<br> ? What is your username?<br> ? user<br>─── SigninInput ────────────────────────────────────────────────────────────────<br># Signin To Your CLI Account `cli auth signin`<br> * Signing in to your CLI account… ⠋<br>─── SigninInput ────────────────────────────────────────────────────────────────<br># Signin To Your CLI Account `cli auth signin`<br> * Signed in to your CLI account: user@example.com</pre><p>This simplified example shows what a golden output might look like for a basic authorization command. The horizontal lines delineate frames, with labels indicating the active model. Taken together we get a high fidelity capture of output even as lines are added, removed, or replaced.</p><p>We use a flag in our test suite to update files with the golden outputs, and otherwise the tests fail if the output doesn’t match the files. This keeps us aware of output changes and facilitates PR reviews by allowing us to understand what the output should look like and if it has changed. We like it so much that we plan to replace our sketch programs with golden style output in Github style google docs so we can capture both animation and style ideas.</p><p>With our once and future sketches in hand, let’s return to getting started with new API endpoints.</p><h3>Designing API and CLI Together</h3><p>We work on the API and CLI simultaneously, because the best designs for these grow out of tight integration. We are able to do this, while still avoiding the perils of waterfall, by iterating on designs in cheaper contexts and waiting to implement until the requirements solidify. For our APIs, this means sketching with <a href="https://www.openapis.org/">OpenAP</a>I:</p><pre>openapi: 3.1.0<br>info:<br>  contact:<br> email: contact@example.com<br>  description: An example API.<br>  title: Example API<br>  version: 0.0.1<br>servers:<br>  - url: https://api.example.com<br>tags:<br>  - description: account operations<br> name: account<br>paths:<br>  &#39;/v0/auth/signin&#39;:<br> post:<br>   description: Signin to CLI.<br>   operationId: auth_signin<br>   responses:<br>     &#39;200&#39;:<br>       content:<br>         &#39;application/json&#39;:<br>           schema:<br>             additionalProperties: false<br>             properties:<br>               email:<br>                 description: Email address for authenticated user.<br>                 example: username@example.com<br>                 type: string<br>             required:<br>               - email<br>             type: object<br>       description: Successful signin.<br>   summary: Signin to CLI.<br>   tags:<br>     - account</pre><p>This simplified example shows what a schema might look like for a basic authorization command. We use the <a href="https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview">spectral</a> linter to simplify working on these files.</p><p>With a sketch in hand, we then use <a href="https://docs.stoplight.io/docs/prism/674b27b261c3c-prism-overview">prism</a> as a mock API server while we implement the CLI. When we inevitably realize mistakes were made, we can just tweak the spec and get back to our CLI iteration. Working at this high level allows us to evolve the API and CLI together and defer costly implementation until we have better knowledge.</p><h3>Implementing APIs</h3><p>We also lean into our OpenAPI spec to keep us honest during implementation using <a href="https://github.com/interagent/committee">committee</a>. assert_schema_conform tests alignment and the middleware notifies us of any live discrepancies. These combine to allow for red green implementation while protecting us from regressions.</p><h3>Testing with Mocks and Proxies</h3><p>To round things out, our test suite uses flags to run prism in either mock or proxy mode. By using flags we can focus on writing just one kind of test, though it does mean we skip some tests in one mode or the other. We use mock tests for their speed and on Windows and macOS where our full stack doesn’t run in CI. Our proxy tests let us run tests against our entire stack just by adding a flag, making it easy to run end to end testing whenever we deem it necessary.</p><h3>Pulling it All Together</h3><p>Sketches and specs help us iterate past the abstract without having to get bogged down in implementation. Then mocks and proxies help us ensure the implementations match the sketches. By continuing to iterate our process, each feature causes less pain, which we have deeply appreciated while building the teams experience we will deliver later this month.</p><p>We will keep iterating on our process, I hope you learned something from it and I would love to learn from you. What have you tried, where are you proud and what remains frustrating?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29c223171313" width="1" height="1" alt=""><hr><p><a href="https://medium.com/effortless-encryption/developing-clis-29c223171313">Developing CLIs</a> was originally published in <a href="https://medium.com/effortless-encryption">Effortless Encryption</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Principles for Architecture at Salesforce]]></title>
            <link>https://medium.com/salesforce-engineering/10-principles-for-architecture-at-salesforce-82105d5399a8?source=rss-7e03b2ae6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/82105d5399a8</guid>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[general-engineering]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[architecture-files]]></category>
            <dc:creator><![CDATA[Wesley Beary]]></dc:creator>
            <pubDate>Tue, 14 Sep 2021 16:23:23 GMT</pubDate>
            <atom:updated>2021-09-14T17:16:38.815Z</atom:updated>
            <content:encoded><![CDATA[<p><em>co-written by </em><a href="https://medium.com/@thefutureian"><em>Ian Varley</em></a></p><p>Software engineering can’t be reduced to a set of rules. Rather, it’s about understanding the problems we’re trying to solve, and making trade-offs among competing priorities. It’s nuanced work that requires experience and lots of <a href="https://engineering.salesforce.com/118-why-writing-matters-for-engineers-8ffdeaa40e68">clear communication</a>.</p><p>That said, there are some things we think are true across the board — some principles that apply broadly to all of the decisions we make. Here we lay out 10 principles that we encourage our software architects to embody and aspire to, not because it is easy, but because it is hard (a la <a href="https://en.wikipedia.org/wiki/We_choose_to_go_to_the_Moon">JFK’s 1962 speech</a> about going to the moon), and not because they are <em>rules</em> but because they guide our software toward more success down the road.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*H-0ozR7nACK6ZZPht6h6CA.png" /></figure><p>So, to the principles:</p><ol><li><strong>Speak for Trust</strong>: This is not surprising if you’ve been around Salesforce at all. Trust is our number one value. When making decisions, we often think about delivering new features to our customers quickly, which is important! But we also need voices pushing for building lasting trust with those customers. That’s one important consideration for our senior individual contributors (ICs) like architects — to think about building software the right way, from the outset, even in the face of product deadlines.</li><li><strong>Technology Serves Customers</strong>: There are usually many layers between us and customers, and while sometimes necessary at our scale, it has downsides. Figuring out what’s going on with real customers when they use our software can feel like a game of telephone. We ask our architects to be aware of customer pain and frustration, even through all of these layers.</li><li><strong>Champion Long-term Value</strong>: The software architect is sometimes the only one in the room with the knowledge of the consequences our actions might have in 5 or 10 years. Lean into that! Avoid getting caught up in the pressure to ship something for the short term and instead think about the long term impact of decisions being made right now.</li><li><strong>Complexity is Debt</strong>: Our systems are complicated (duh), even more so on the inside than from the outside. Treat every bit of complexity added to our system as highly suspect.</li><li><strong>Make Architecture An Equal Partner</strong>: Too often, individual contributors (ICs) think they’re not really allowed in the room when important decisions are being made, instead leaving that to management and product. We’re here to tell you that this is wrong and unhelpful; as we’ve laid out in the previous few principles, architects bring a really unique perspective here: thinking long term and factoring in technical ideas. Work to make your presence known.</li><li><strong>Communicate the “Why”</strong>: e.g. write it down! Software tends to last a lot longer than you think it will. Once you realize that a large part of successful software engineering is actually more like archaeology, you’ll be more inclined to leave better records of your thinking for posterity. Your future self, not to mention the rest of the team, will thank you. (<em>Listen to more on this topic in our podcast episode, “</em><a href="https://engineering.salesforce.com/118-why-writing-matters-for-engineers-8ffdeaa40e68"><em>Why Writing Matters for Engineers</em></a><em>.”)</em></li><li><strong>Overcome Silo</strong>s: Big companies don’t always have the right incentive structures for building shared value. But it’s the architect’s job to push back against this. That often involves trading in favor of global good rather than what’s locally optimal, and doing the work to build relationships and reuse across organizational silos.</li><li><strong>Design Still Matters</strong>: Sure, modern software delivery is agile. But that’s not an excuse for skipping planning and design! You still need to answer the major questions, and lay out the theory of a system. If you constantly wobble the underlying architecture of a system, you get an emergent pile of mismatched metaphors, partially implemented abstractions, and half baked solutions. Don’t spend months coding to save hours of planning.</li><li><strong>Everything Evolves</strong>: Building systems isn’t just about envisioning perfection. You have to move from here to there, and that’s often the most difficult, awkward part of any project. Don’t just think about end states, think about decomposability, flexibility, staging, and paths from one place to another.</li><li><strong>Don’t Be a Jerk</strong>: Human understanding keeps things running smoothly in software engineering. If nobody likes working with you, everything is going to be harder. The “human” side of software engineering is just as important, if not more important, than the technical side.</li></ol><p>Changing personal behaviors is hard, and changing company culture is even harder. We hope these 10 principles offer ways of thinking about software engineering that help move the needle on both.</p><p><em>Like what you just read? Join our </em><a href="https://careers.mail.salesforce.com/tpil-blogs"><em>Talent Network</em></a><em> to scope out open software engineering roles at Salesforce and come join the conversation!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82105d5399a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/salesforce-engineering/10-principles-for-architecture-at-salesforce-82105d5399a8">10 Principles for Architecture at Salesforce</a> was originally published in <a href="https://medium.com/salesforce-engineering">Salesforce Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>