Whether a freelance developer has a calm year or a frightening one usually depends less on code than on cash flow, slack, and how they react when a big client goes quiet. Morgan Housel's The Psychology of Money (2020) is a short book about exactly that kind of behaviour, and a surprising amount of it maps straight onto software careers. Here are the ideas I keep coming back to, in developer terms, with small scripts you can run on your own numbers.
TL;DR
- Compounding rewards time far more than brilliance. Skills, reputation and savings all grow this way, and technical debt compounds in the opposite direction.
- Getting ahead and staying ahead need different habits. The first takes risk; the second takes humility and enough caution to survive bad years.
- Plan with room for error. For freelancers that means runway measured in months, a cash floor you refuse to plan below, and real buffers in estimates.
- A few clients, projects or pieces of work usually produce most of your results. Keep making small bets, and never let one client or platform hold your whole income.
- Decide what "enough" means before success decides for you, and treat savings as the freedom to say no.
Note: This is a developer's reflection on a book, not financial advice. I'm not a financial advisor, and every number in the code below is made up for illustration. For decisions about your own money, talk to a qualified professional.
Why a money book belongs on a dev blog
Housel's central argument is that doing well with money depends more on behaviour than on intelligence: patience and restraint can carry someone with no finance training, while one overconfident bet can wipe out a brilliant person.
Swap "money" for "software career" and the argument still holds. The careers that look enviable after ten years often belong less to whoever was cleverest in year one than to people who kept going, avoided the mistakes you cannot undo, and let small advantages pile up.
Compounding needs time more than brilliance
One of the book's best-known points is about Warren Buffett: as Housel tells it, the large majority of Buffett's fortune arrived after his mid-sixties. Skill mattered, but the real engine was starting as a kid and never stopping. Time is the strongest lever in compounding, and intuition underrates it because growth looks flat for a long while.
A tiny function makes the shape visible:
def compound(start: float, rate: float, periods: int) -> list[float]:
"""Return the value at the end of every period."""
values = []
value = start
for _ in range(periods):
value *= 1 + rate
values.append(value)
return values
fast = compound(1_000, 0.15, 10)
slow = compound(1_000, 0.08, 30)
print(f"15% for 10 years: {fast[-1]:>8,.0f}")
print(f" 8% for 30 years: {slow[-1]:>8,.0f}")
for year in (10, 20, 30):
print(f" 8% run, end of year {year}: {slow[year - 1]:>8,.0f}")
share_last_decade = (slow[-1] - slow[19]) / slow[-1]
print(f"Share of the final value added in the last 10 years: {share_last_decade:.0%}")Save it as compound.py and run python3 compound.py (or python compound.py on Windows; it needs Python 3.9+). It prints:
15% for 10 years: 4,046
8% for 30 years: 10,063
8% run, end of year 10: 2,159
8% run, end of year 20: 4,661
8% run, end of year 30: 10,063
Share of the final value added in the last 10 years: 54%The modest rate kept up three times as long ends more than twice as large as the impressive one. And more than half of the 30-year run's final value shows up in the last decade. The first decade adds only about 1,159, roughly a ninth of the final value, which is why it feels like nothing is happening.
Tip: The rates here are arbitrary, not expected returns. Change them and the curve still bends upward: later years always add more than earlier ones, though how lopsided it gets depends on the rate. At 2%, the last decade adds under a fifth of the final value.
Skills and reputation compound too
Careers work the same way. Each thing you learn makes the next thing cheaper to learn. Once HTTP caching really clicks, CDN behaviour, service workers and Next.js revalidation stop being three separate mysteries and start looking like variations on one idea. Reputation compounds as well: a client who had a good experience refers you, and a clear write-up or a solid open source fix keeps getting found long after you shipped it.
None of this is visible after six months, which is why so many people stop before it matters. Optimise for staying in the game: a steady habit you can keep for years beats an intense burst that ends in burnout.
Technical debt compounds in reverse
The same arithmetic runs backwards. Ignored technical debt rarely costs a fixed amount. It makes every future change a little slower, and the next slowdown lands on an already slower team. Here is a toy model where each sprint of neglect costs 3% of the remaining pace:
# Toy model: each sprint of ignored debt makes the next one 3% slower.
for sprint in (6, 13, 26):
pace = 100 * (1 - 0.03) ** sprint
print(f"After {sprint:>2} sprints: {pace:5.1f}% of the original pace")It prints:
After 6 sprints: 83.3% of the original pace
After 13 sprints: 67.3% of the original pace
After 26 sprints: 45.3% of the original paceThe 3% is invented, and real codebases do not decay this smoothly. The shape is the point: nobody notices a few percent per sprint, yet 26 two-week sprints later the team is moving at under half speed. Paying down a little debt every sprint is the engineering version of not letting a high-interest balance sit on a credit card.
Getting wealthy vs staying wealthy
Housel draws a sharp line between getting money and keeping it. His point is that the traits that build wealth, such as boldness and optimism, are not the ones that protect it; protecting it is about caution and living below your means. Of the two, he puts survival first, because compounding only pays people who are still around.
Software has the same split. Shipping a product takes boldness: launch before it feels ready, say yes to the hard project, learn the new stack on the job. Keeping it alive takes a different temperament: backups you have actually restored, monitoring, boring dependency upgrades, contracts with clear scope.
For a career, staying power mostly means avoiding the few mistakes you cannot recover from: a blown deadline that loses your best client, a breach caused by skipped basics, or burnout that takes you out of work for months. Avoiding ruin is not glamorous, but it keeps everything else compounding.
Room for error
Housel's case for a margin of safety is that the future keeps producing things nobody predicted, so a good plan is one that still works when parts of it turn out wrong. Room for error is not pessimism. It is what lets you stay optimistic about the long run without being knocked out by the short run.
Runway for irregular income
Freelance income is lumpy. Payments arrive by milestone, clients pay late, and a quiet month can follow a great one. The basic defence is runway: cash that covers your expenses for a number of months, plus a floor you refuse to plan below.
The script below simulates a year of hypothetical client payments, then reruns it with the biggest client paying 60 days late and with that client gone. Each scenario reports the lowest cash point, the year-end balance, and the first month cash drops below the floor or below zero.
type Payment = { client: string; amount: number };
type Month = Payment[];
interface RunwayReport {
lowestCash: number;
endingCash: number;
firstMonthBelowFloor: number | null;
firstMonthBelowZero: number | null;
}
function simulateRunway(
startingCash: number,
monthlyExpenses: number,
months: Month[],
floor: number,
): RunwayReport {
let cash = startingCash;
let lowestCash = cash;
let firstMonthBelowFloor: number | null = null;
let firstMonthBelowZero: number | null = null;
months.forEach((payments, index) => {
const income = payments.reduce((sum, p) => sum + p.amount, 0);
cash += income - monthlyExpenses;
lowestCash = Math.min(lowestCash, cash);
if (firstMonthBelowFloor === null && cash < floor) firstMonthBelowFloor = index + 1;
if (firstMonthBelowZero === null && cash < 0) firstMonthBelowZero = index + 1;
});
return { lowestCash, endingCash: cash, firstMonthBelowFloor, firstMonthBelowZero };
}
function withoutClient(months: Month[], client: string): Month[] {
return months.map((payments) => payments.filter((p) => p.client !== client));
}
function delayClient(months: Month[], client: string, by: number): Month[] {
const shifted = withoutClient(months, client);
months.forEach((payments, index) => {
for (const p of payments) {
// payments pushed past the last month land outside this simulated year
if (p.client === client && index + by < shifted.length) shifted[index + by].push(p);
}
});
return shifted;
}
function clientShares(months: Month[]): Record<string, number> {
const totals: Record<string, number> = {};
let grand = 0;
for (const p of months.flat()) {
totals[p.client] = (totals[p.client] ?? 0) + p.amount;
grand += p.amount;
}
return Object.fromEntries(
Object.entries(totals).map(([client, total]) => [client, Math.round((total / grand) * 100)]),
);
}
// Made-up numbers: replace them with your own.
const startingCash = 190_000;
const monthlyExpenses = 50_000;
const floor = 2 * monthlyExpenses; // never plan to dip below two months of expenses
const year: Month[] = [
[{ client: "A", amount: 120_000 }],
[],
[{ client: "B", amount: 40_000 }],
[{ client: "A", amount: 120_000 }],
[{ client: "C", amount: 30_000 }],
[],
[{ client: "A", amount: 120_000 }, { client: "B", amount: 40_000 }],
[],
[{ client: "C", amount: 30_000 }],
[{ client: "A", amount: 120_000 }],
[{ client: "B", amount: 40_000 }],
[],
];
const fmt = (n: number) => Math.round(n).toLocaleString("en-US");
console.log(`Runway with zero income: ${(startingCash / monthlyExpenses).toFixed(1)} months`);
console.log("Income share by client (%):", clientShares(year));
const scenarios: [string, Month[]][] = [
["Plan", year],
["A pays 60 days late", delayClient(year, "A", 2)],
["A disappears", withoutClient(year, "A")],
];
for (const [name, months] of scenarios) {
const r = simulateRunway(startingCash, monthlyExpenses, months, floor);
console.log(
`${name.padEnd(20)} lowest ${fmt(r.lowestCash).padStart(8)} | ending ${fmt(r.endingCash).padStart(8)}` +
` | below floor: ${r.firstMonthBelowFloor ?? "never"} | below zero: ${r.firstMonthBelowZero ?? "never"}`,
);
}Save it as runway.ts and run npx tsx runway.ts (npx downloads tsx the first time). Recent Node versions can also run it directly with node runway.ts; check that yours supports type stripping. It prints:
Runway with zero income: 3.8 months
Income share by client (%): { A: 73, B: 18, C: 9 }
Plan lowest 190,000 | ending 250,000 | below floor: never | below zero: never
A pays 60 days late lowest 90,000 | ending 250,000 | below floor: 2 | below zero: never
A disappears lowest -230,000 | ending -230,000 | below floor: 2 | below zero: 6Three things stand out. The plan looks comfortable. In this example, where every delayed payment still lands inside the year, a 60-day delay from one client leaves the year's total unchanged, yet still pushes you below the floor in month two. That is a cash-flow problem, not an income problem, and it catches freelancers off guard. Finally, client A supplies roughly three-quarters of the income, and losing them turns a healthy year into a hole by month six.
Tip: Run the scenarios you would rather not think about: your largest client leaving, every invoice paid a month late, a month off sick. If any of them breaks the plan, you need more runway, less concentration, or both.
Buffers in estimates
Estimates need the same margin. We estimate the work we can picture, and overruns come from the work we could not: an API that behaves differently from its docs, a review cycle that takes a week, a dependency upgrade that breaks the build. The buffer is not for the risks on your list. It is for the ones that are not on it yet.
In practice that means adding contingency at the project level instead of quietly padding every task, writing down what is out of scope, and pricing fixed-bid work so a reasonable overrun does not wipe out your margin. A realistic date beats an optimistic date followed by a delay.
Tails drive the results
Another chapter argues that a small number of events account for most outcomes. Venture investors expect most bets to fail and a few to pay for everything. Being wrong often is normal, as long as the wins are big enough to cover the misses.
Developer careers look similar. Trace where your best work and clients came from and a few sources probably explain most of it: one long-term client, one project that taught you a whole stack, one article or repository people still find. You cannot tell in advance which ones those will be, so keep placing small, cheap bets: side projects, writing, open source contributions, conversations. Most go nowhere. That is the cost of being around when one does not.
Do not depend on one client or platform
Tails cut both ways. The client that brings most of your income is also the single point of failure in your finances, as the runway script showed. Platforms are the same: a marketplace that changes its fees or ranking, one social account that brings all your leads, an API whose pricing changes on short notice.
Treat concentration like a database with no replica. Know what happens when it goes away, and have a fallback ready: a second client, an email list you own, or more runway.
Knowing what enough is
Housel writes about people who already had more than they needed and lost it by reaching for more. His point is that the hard part is deciding you have enough and then actually stopping; no extra upside justifies gambling the things you rely on.
The developer version is overcommitting. You take one more client because the money is good, quality slips for all of them, a deadline is missed, and referrals dry up. Deciding in advance how many clients or hours is enough protects the things that actually compound: your reputation and your health.
Lifestyle creep
The quiet version of never having enough is lifestyle creep. A strong quarter feels like a raise, spending rises to match, and the runway that looked healthy now covers fewer months. Expenses are the denominator in every runway calculation, so each permanent increase in spending shortens it, even when income rose too. Treat a good month as runway first and lifestyle second.
Saving buys independence
Housel argues that saving needs no particular goal. Savings hedge against surprises you cannot name, and above all they buy control over your time, which he treats as one of the biggest returns money can give.
For freelancers this is concrete. Savings let you turn down a client with red flags, take a month to learn a new stack, negotiate calmly, or wait for the right contract. Someone with six months of runway and someone with two weeks are having very different conversations with the same client. "Wealth is what you don't see," as one of Housel's chapter titles puts it, and runway fits: invisible from outside, yet it shapes every decision you make.
Reasonable beats rational
Housel prefers being reasonable to being coldly rational: choosing a strategy you can actually stick with, even if a spreadsheet says another one is slightly better. A plan you abandon in a panic is worse than a slightly weaker plan you keep.
Engineers like optimal answers, so this one stings a little. Holding more cash than a model calls efficient may look irrational, but if it lets you sleep and say no to bad work, it is reasonable. Likewise, a boring stack you know deeply can beat a theoretically better one you fight every week. Design the plan for the person who follows it: you, on a bad day.
Luck and risk
Housel treats luck and risk as two sides of the same coin: forces outside your control that shape outcomes as much as effort does. Because they are hard to separate from skill, he suggests being careful about whom you copy and how you judge yourself.
For developers, that means not studying only the outliers. The founder whose risky bet paid off and the developer who went all in on a framework that happened to win are visible because it worked; the people who made the same bets and lost are not writing threads about it. Look for patterns across many careers, and judge decisions by the information you had at the time, not only by how they turned out. A failure despite sound decisions is not proof you are bad at this, and a lucky win is not proof you have it figured out.
Wrapping up
None of these ideas require finance skills, just patience, slack and honesty with yourself, the same things that make an engineering career durable. Let skills and savings compound, stop debt from doing the same, and survive first. Keep a runway and a floor, and stress-test them. Spread your bets, and decide what enough looks like before you are too busy to ask. Then put your own numbers into the runway script and plan for the scenario that makes you uncomfortable.