HN Hall of Fame Weekly email

John Carmack on Inlined Code

number-none.com Essays & writing Essays & articles Software engineering Class of 2019-01 Hall of Fame
Screenshot of number-none.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 11 calendar years, with breakout response in 5 of them.

submissions
21
submitters
14
observed span
2014–2026
peak thread · 389 comments
556 pts
latest 20+ return · 2024-10-06
556 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

When I first heard the maxim that an intelligent person should be able to hold two opposing thoughts at the same time, I was naive to think it meant weighing them for pros and cons. Over time I realized that it means balancing contradictory actions, and the main purpose of experience is knowing when to apply each. Concretely related to the topic, I've often found myself inlining short pieces of one-time code that made functions more explicit, while at other…

mihaic·556-point thread·

The older I get, the more my code (mostly C++ and Python) has been moving towards mostly-functional, mostly-single static assignment (let assignments). Lately, I've noticed a pattern emerging that I think John is referring to in the second part. The situation is that often a large function will be composed of many smaller, clearly separable steps that involve temporary, intermediate results. These are clear candidates to be broken out into smaller functions. But, a conflict arises from the fact that…

I have had the pleasure to work with lots of other people's code of varying styles and quality. Nothing is harder to read and understand than code which is deeply nested calls from one little helper (or wrapper) function to another. Nothing is easier to read and understand than code which just flows straight through from top to bottom of a big function. There are other tradeoffs of code reuse and speed and worst-case-speed and probability of introducing bugs. If…

dzdt·395-point thread·

My personal rule is: if a simple (<=10LOC) function is used fewer than 3 times in code, it's not really a function, it should be inlined. Only noobs avoid copy&paste at all costs. There's time and place for it. Consider that code is written once but read multiple times, and it's a lot harder to read it than to write it, in particular if there are endless chains of function calls, as you commonly see in e.g. Java and the…

m0zg·161-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
5

100+ points or 50+ comments

Total points
1839

reference only — not used in Hall rules or ranking

Total comments
1127

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2014-09-26John Carmack on Inlined CodeFirst breakoutm0nastic456260
2015-09-29John Carmack's thought on code inliningfieryeagle20
2016-06-23John Carmack on Inlined Code (2014)Tomte30
2016-07-14John Carmack on Inlined CodeSymmetry20
2016-07-19John Carmack on Inlined Code (2014)rinesh395199
2016-08-10John Carmack on Inlined Code (2007)simonpure50
2017-02-04John Carmack on Inlined Code (2014)Tomte30
2017-05-13John Carmack on Inlined Code (2014)Tomte232
2018-08-19John Carmack on Inlined Codeingve30
2019-01-21John Carmack on Inlined Code (2014)Hall inductiontosh161105
2020-06-11John Carmack on Inlined Code (2014)elcomet10
2020-12-01John Carmack on Inlined Code (2014)tosh138169
2020-12-02John Carmack on Inlined Codesmusamashah10
2022-04-01John Carmack on Inlined Codetosh30
2022-04-04John Carmack on Inlined Codebauxitic_filly10
2022-06-02John Carmack on Inlined Code (2014)Tomte30
2022-11-20John Carmack on Inlined Code (2014)Tomte11
2023-09-21John Carmack on Inlined Code (2007)ahaferburg10
2024-01-16John Carmack on Inlined Codetakemine792
2024-10-06John Carmack on inlined code (2014)Best thread · Latest 20+ point returnbpierre556389
2026-05-26John Carmack on Inlined Codetosh20