Skip to content

Coding and Commenting Style

Coding and Commenting Style

The rules this codebase is written to. The architecture page says which way the dependencies point; this one says what the code looks like once it is there. Both exist because the README promised them at the start of the build, and because a rule that lives only in someone's head cannot be reviewed against.

The mechanical half of this page is enforced by .editorconfig and the compiler settings, not by review: indentation, line endings, using order, var usage, unused locals and parameters. Review is for the half a tool cannot check.

In plain words

This page sets the rules the code here is written to, from naming to where each piece may live. A comment explains why the code is written as it is, because the code already shows what it does. A settings file the editor and compiler read (.editorconfig) checks the mechanical rules.

What that is worth: a developer can predict what a file is called and where it goes before opening it, and the organization gets code a reviewer can check against written rules instead of rules that live in someone's head.

Naming

  • C#: PascalCase for types, methods and properties, camelCase for locals and parameters, _camelCase for private fields. Interfaces that are ports read as the thing they provide (IVehicleSource), not as the implementation.
  • TypeScript: camelCase for values and functions, PascalCase for types and components, SCREAMING_SNAKE for module constants (FILTER_DEBOUNCE_MS, EMPTY_FILTERS).
  • The wire is snake_case end to end because the dataset is (body_style, min_next_bid). Nothing is renamed in transit.
  • A test name is a sentence: Increments_are_tiered, Live_auction_accepts_a_bid_at_the_minimum_and_rejects_below_it. A failing run should read like a report.
  • Files are named for what they hold, one main type each: BidRules.cs, VehicleCard.tsx, VehicleCard.module.css beside it.

Layering

  • Dependencies point inward. TheYard.Data references nothing; TheYard.Domain may reference Data; Application talks to Infrastructure only through ports. If a file needs a using that points outward, the code is in the wrong project, and OnionTests fails the gate (ADR: Onion and SOLID, how this codebase holds them).
  • Domain code is pure: no DateTime.Now, no filesystem, no HTTP. Time arrives as an AuctionClock the caller built, which is why the tests can anchor it.
  • The host binds and delegates. A handler in its slice under api/TheYard.Api/Features/ reads the request and asks Application for the answer; a rule in a handler or in Composition/ is a bug in layering.
  • The browser holds no business rules. If a calculation decides money or eligibility, it belongs in Domain and travels on the wire.
  • src/lib is plain TypeScript with no React import; src/hooks is React state more than one component needs; src/components render.

Comments

The rule is what, how and why, with no history. A comment says what the code does where the name cannot, how where the way is not obvious, and why this way or what breaks otherwise; it never leans on a date, a version or a review to stand in for the reason, and a test holds that (ADR: The rules a change has to pass).

/// <summary>
/// Places one bid for one buyer. The rules run against the store's standing
/// for the vehicle, read under the gate, and the bid is kept only if the
/// store still holds that same standing when it is written. If the other
/// site moved it in between, the standing is read again and the rules run
/// again, so a bid that no longer clears the minimum is refused with the
/// sentence it would have got a moment later.
///
/// <para>The caller's cancellation is honoured up to the gate and not past it. Waiting
/// a turn is the one part of a bid a caller who has gone can be let out of for nothing;
/// once the turn is theirs the store is written and memory follows, and a sequence
/// abandoned between those two would leave the store holding a standing this process
/// does not know about. So the body runs under no token, deliberately, which is the
/// promise the ports record made and this rung kept (ADR: The ports learn to wait, the
/// addendum on the token).</para>
/// </summary>
public async Task<BidOutcome> PlaceBidAsync(Vehicle vehicle, int amount, AuctionClock clock, string userId, CancellationToken cancellation)
{
    await LoadAsync(cancellation);
    await _gate.WaitAsync(cancellation);
    try
    {
        for (int attempt = 1; attempt <= Attempts; attempt++)
        {
            var (held, version) = await CurrentAsync(vehicle.Id, CancellationToken.None);
            var merged = held is null ? vehicle : vehicle.RaisedTo(held.Amount, held.BidCount);
            // Sold is read from the same standing the write will compare
            // against, so two buyers, on one site or two, cannot both find
            // it false.
            var outcome = BidRules.ResolveBid(merged, amount, clock, held?.SoldBuyNow ?? false);
            if (outcome.Kind == BidOutcomeKind.Rejected)
            {
                return outcome;
            }

            var state = new BidState(
                outcome.Amount,
                merged.BidCount + 1,
                WonBuyNow: outcome.Kind == BidOutcomeKind.Won,
                AtMs: clock.NowMs);
            var next = StandingFold.Next(held, userId, state);
            // The store first, then memory. A store that throws leaves the
            // dictionaries as they were, so a failed write means the bid did
            // not happen anywhere, which is the answer the caller already has.
            if (await _store.TrySaveAsync(userId, vehicle.Id, state, next, version, CancellationToken.None))
            {
                _ledger.Record(userId, vehicle.Id, state, next);
                return outcome;
            }
        }
        return BidOutcome.Rejected(MovedReason);
    }
    finally
    {
        _gate.Release();
    }
}

Live from api/TheYard.Application/Shared/Auction/BidBook.Bidding.cs, region place, read from this build at 99df7a8.

The comment above the store write in that method is worth keeping: the two lines could be swapped without a compiler noticing, and the reason they cannot is a failure that would reach a visitor. A comment reading // save the bid would not be. The method is read from this build, so the page shows the comment as it stands today and not as it was pasted once.

Four more habits:

  • A public C# member gets a <summary> when its name cannot carry the whole contract. IVehicleSource.LoadAsync() needs none; LiveSamples.Expand needs several lines.
  • A file that implements a decision names the record: (ADR-015), (ADR: The palette). That is how a reader gets from a line to the reasoning behind it.
  • A comment that explains a workaround says what would happen without it, because that is the part that decides whether it can be removed later.
  • Code shown in a served record is documented by that record, and carries teaching comments for a reader meeting the pattern for the first time (ADR: Docs and testing). Code no record shows keeps its own comments.

Quoting the owner

Records open with the instruction that produced them, in Steve's words, so a reader can see what was asked before reading what was built. Those words were typed fast, often from a phone, and they are quoted the way a newspaper quotes speech: spelling, casing and punctuation regularized for print, product names written in full, the meaning and the phrasing his. Never [sic], never a typo kept for authenticity, and never the back-and-forth around the instruction; the record carries the ask and what it decided, not the exchange. A record that names a correction he made frames it as the rule it produced.

Tests

  • The suite is chosen by what the code depends on: pure rules get xunit unit tests, anything needing the host gets an integration test through WebApplicationFactory, anything needing a browser gets Playwright.
  • A test builds what it needs with the builders in TestData, overriding only the fields it cares about.
  • Time is anchored, never Now. Shared state is reset in beforeEach or isolated in its own fixture class.
  • Browser tests locate by role and accessible name, which keeps the suite honest about accessibility.
  • ADR: The tests, explained walks all three suites for a newcomer.

Status

  • Every card under Cloud infrastructure calculates a status: a tone dot and a headline on the Admin rail, read from the route the card itself reads. The list is GLANCED in src/lib/railGlances.ts, and its test holds it equal to the rail's Cloud infrastructure section, so a card cannot ship without one.
  • A line that is not read says "not read" with its reason and never colours its card (CardFrame.Unread). A resource with nothing wrong with it is green.
  • A card judges the site's own traffic: what the live tests do to a shared resource is counted apart and named, never charged to the site.

Formatting

  • Four spaces in C#, two in TypeScript, CSS and JSON. UTF-8 everywhere; the files that carry a byte-order mark or CRLF keep them, because rewriting a file's encoding is a diff nobody asked for.
  • Lines wrap around 120 characters in C# and 100 in TypeScript. Prose in the documents wraps at 100 (max_line_length = 100 for Markdown in .editorconfig) so a diff of a paragraph is readable.
  • One statement per line; no single-line if bodies without braces.
  • Prose in this repository, including these documents and every commit message, uses no em dashes. That is the house voice, not a style preference, and the ship gate counts them.

Files

Store

The Yard, home

Steven StoutStaff .NET engineerRemote

Production .NET that stays up. Built with AI, measured on every version.

Steven Stout

Hi, I'm Steve. I build the systems that make delivery boring in the best way, then coach people inside them.

  • 200+

    production releases, none took the platform down

    Conway Investment Research, 2019 to 2024. Sole engineer for the first three years on a live financial advisory platform.

    See how
  • 50%

    shorter release cycle

    Storee Construction, 2024 to 2026. Four ASP.NET applications onto one .NET 10 platform on Azure, with a four-person team I hired and mentored.

    See how

01Verified

Steven Stout

A real person, and the work is mine.

  • Identity

    Checked by LinkedIn, not by me.

    LinkedIn verified my government ID.

  • Running system

    You are looking at it.

    Version 1.0.5.273 is live. Nothing ships unless it passes the automated gates first.

That's who I am. Here's how I work.

02Strengths

Ten strengths, each with the proof beside it. The numbers match my resume and LinkedIn, and the live ones are read from this site as you look.

  • 01

    Keeps production alive

    200+ releases on a live financial platform, and none took it down. Sole engineer for the first three years.

    See the Conway work

  • 02

    Simplifies messy systems

    Four ASP.NET applications onto one .NET 10 platform on Azure, and a release cycle 50% shorter.

    See the Storee work

  • 03

    Marries dev and infrastructure

    Blue-green releases at Storee that flipped in about 5 seconds with nobody signed out, and Azure Front Door at two employers.

    See this site's cloud

  • 04

    Designs data that holds up

    White-label clients on one shared database, the isolation built into the data, and no cross-client issues.

    See the Conway work

  • 05

    Keeps AI-written code honest

    15 quality numbers that may only improve: 273 releases in a row with none worse.

    See the quality numbers

  • 06

    Resourceful

    $30,000+ cut from Azure and vendor spend at Conway. This site's Azure bill is public, resource by resource.

    See the bill

  • 07

    Builds people up

    Hired and mentored a four-person team. 13 colleagues recommend me by name.

    Read the recommendations

  • 08

    Takes ideas to production

    This site: designed, built and run solo, with 352 versions measured through one gate.

    How it was built

  • 09

    Writes clearly

    Posts on real engineering problems, in plain words.

    Read the blog

  • 10

    Owns decisions

    153 decision records, each with its tradeoff and the call I made.

    See the decision records

Built with AI. Gated so quality never slides.

Steven Stout’s showcase: a used-vehicle auction on .NET and React, built and run by one engineer, live on Azure, with its decisions written down.

No quality number has gotten worse at any release since 1.0.5.1 on 10 November: 273 releases in a row.

One engineer, an AI agent and a gate that checks 15 quality numbers on every release. 352 versions measured, with every result public, the worst days included.

82 releases in the last 7 days, each through the same gate.

Async methods with no CancellationToken, may only fall

11091.0.3.1391.0.5.2731.0.4.115, the ratchet
Every number, on the Quality page

TheYard, right nowLive

Answering in

unread

02505007501,000

server time at p95, the usual five minutes of the last day.

Azure this month

unread

the bill, by resource, read from Azure. The Admin tab shows every line.

Since the last roll

unread

 

rolled in place by the pipeline, behind one gate.

People who have visited

unread

30 days agotoday

Scanners, my own tools' and my own reads left out.

03Start here

04Where teams are heading

How I see engineering with AI, and the setup on this site that backs it.

AI-augmented teams · Architecture and ownership

AI writes more of the code. Someone still has to own what ships.

Teams are going to be heavily AI-augmented. That moves the senior job toward architecture and technical ownership: deciding what to build in pieces small enough to verify, and owning what ships.

  • Task tracking will get automated too. Judgment stays human: seeing a design fail at scale before it does.
  • On this site the AI's first design held the whole catalogue in memory. I caught it when the App Service plan hit 82 per cent and moved the work to the store.

What the AI wrote, what I decided

07Tech stack

  •    
  •    
  •    

Read from the build, never typed by hand

What TheYard runs on

What we use, where it runs, its AWS twin, the version as built, and the file that proves it.

Cloud patterns, not one vendor: every Azure piece in this stack has a named AWS twin. Mapped, not yet run on AWS.

  • .NET 1114 projects
  • React 19.3TypeScript 7.0
  • Azure9 Bicep files
  • 11GitHub Actions workflows
The whole stack, with the file that proves each line

The last release the gate stopped was 1.0.5.258 on 2 December, at its browser 1 of 2 job.

08How it is built

09How it is run

10Who and why

Next step

11What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn