---
title: "How to Write Code Without Having to Read It"
description: "Engineers can safely change unfamiliar code with minimal reading by letting the compiler, linter and unit tests guide them: locate the entrypoint via user-visible strings (or git bisect for regressions), make the breaking change at the leaf component, then climb the callstack following build errors and sweep back down via lint errors, exhaustive switches and test failures."
url: "https://swe.quest/articles/how-to-write-code-without-having-to-read-it-1700fbc56278687d"
canonical: "https://shopify.engineering/write-code-without-reading-it"
source: "Shopify Engineering"
published: "2022-10-11"
difficulty: "medium"
kind: "Opinion"
reading_minutes: 12
tags: ["type-systems","testing","refactoring","typescript","developer-productivity"]
---

# How to Write Code Without Having to Read It

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-10-11, 12 min read, Opinion. Original: [https://shopify.engineering/write-code-without-reading-it](https://shopify.engineering/write-code-without-reading-it)

## Summary

Engineers can safely change unfamiliar code with minimal reading by letting the compiler, linter and unit tests guide them: locate the entrypoint via user-visible strings (or git bisect for regressions), make the breaking change at the leaf component, then climb the callstack following build errors and sweep back down via lint errors, exhaustive switches and test failures. To make code easier for the next "non-reader," replace comments with enforced checks, wrap primitives in custom types, merge dependent arguments into tagged unions, nested objects or enums, and split decision logic into pure functions so unit tests stay simple. Examples use React Native and TypeScript but the approach generalizes to any typed, tested codebase.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Type systems](https://swe.quest/tags/type-systems.md) (Compilers & runtimes)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)

## Prerequisites

- TypeScript types ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- unit testing basics ([easy posts on Testing](https://swe.quest/tags/testing.md?difficulty=easy))

## Keywords

TypeScript, React Native, tagged unions, git bisect, exhaustive switch

## Related posts

- [Migrating a Large Flow Monorepo to TypeScript](https://swe.quest/articles/migrating-a-large-flow-monorepo-to-typescript-750b673839e64549.md): Yelp Engineering · 2026-08-04 · Medium · 11 min read · TypeScript, Refactoring & migrations, JavaScript, Type systems, Build systems
  Yelp migrated 1.4 million lines of Flow-typed JavaScript in a Lerna monorepo to TypeScript over three and a half years, converting one package at a time without ever bulk-disabling typechecking.
- [Balancing Old Tricks with New Feats: AI-Powered Conversion From Enzyme to React Testing Library at Slack](https://swe.quest/articles/balancing-old-tricks-with-new-feats-ai-powered-conversion-from-enzyme-to-react-0b1af45f56ad7d09.md): Slack Engineering · 2024-05-22 · Medium · 15 min read · Testing, AI for coding, Refactoring & migrations, React, LLMs
  Slack converted over 15,000 Enzyme tests to React Testing Library ahead of its React 18 upgrade by combining AST codemods with an LLM (Claude 2.1).
- [Bun v1.4.3](https://swe.quest/articles/bun-v1-4-3-5b1b87352d175154.md): Bun · 2026-10-10 · Medium · 65 min read · TypeScript, Type systems, Runtimes & VMs, JavaScript, Performance engineering
  Bun v1.4.3 adds \`bun check\`, a TypeScript type checker ported from typescript-go that passes all 51,210 of TypeScript 7.0.2's conformance tests and runs 3x to 6.4x faster than tsc 7 with 2.2x to 4.9x less memory.
- [From Ruby to Node: Overhauling Shopify’s CLI for a Better Developer Experience](https://swe.quest/articles/from-ruby-to-node-overhauling-shopify-s-cli-for-a-better-developer-experience-c31f4bbd707f942e.md): Shopify Engineering · 2023-01-10 · Medium · 12 min read · Developer tools, TypeScript, JavaScript, Refactoring & migrations, Testing
  Shopify rewrote its CLI from Ruby to TypeScript on Node to reduce system requirements, unify the Theme, App and Hydrogen workflows, and stay easy for internal teams to contribute to.
- [Why We Ripped Twin out of 400+ Components](https://swe.quest/articles/why-we-ripped-twin-out-of-400-components-f0b99539dbfc3cb4.md): Railway · 2023-05-04 · Medium · 7 min read · CSS, Frontend, Refactoring & migrations, Build systems, React
  Railway replaced twin.macro with vanilla Tailwind across 400+ React components, which removed the last dependency on Babel and let the monorepo move fully to SWC.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
