Eugene Lazutkin
lazutkin.com
Eugene Lazutkin
@lazutkin.com
Duff's device, part 2: copying within an array — on every Node and Deno we can install today, Array#copyWithin runs 47 to 84 times slower than a plain loop. JavaScriptCore has the fast path, and V8 landed one in June. www.lazutkin.com/blog/2026-09...
Duff's device, part 2: copying within an array
Duff’s device in JavaScript raced hand-written loops that copy one array into another. A reader asked the follow-up: how do they compare with Array#copyWithin, the built-in that copies a range …
www.lazutkin.com
September 15, 2026 at 5:51 AM
Coding tactics: the series — the map of eight posts on ifs and loops: linearize the flow, simplify the conditions, state the invariant, jump when it keeps the code flat, and take the small optimizations on the way. www.lazutkin.com/blog/2026-09...
Coding tactics: the series
Over the summer I published a series on coding tactics: the everyday craft of ifs, loops, and the reasoning behind them. Eight posts, one thesis, best read in order. This is the map.
www.lazutkin.com
September 8, 2026 at 5:43 AM
"Premature" optimization — skipping optimization to profile later bets on a Pareto jump. The jump is rarer than the mantra assumes, and the tail left uncurtailed turns structural.

www.lazutkin.com/blog/2026-09...
"Premature" optimization
“Premature optimization is the root of all evil” — our field’s favorite half-sentence, quoted far more often than the sentence it was cut from. Usually it serves as permission: build …
www.lazutkin.com
September 1, 2026 at 5:50 AM
Death by a thousand reasonable decisions — nobody writes bad code on purpose. It accretes from decisions that were each reasonable at the time. Why it happens, and what ownership and a scheduled refactor buy. www.lazutkin.com/blog/2026-08...
Death by a thousand reasonable decisions
When I read consistent, cohesive code, I have a feel for its author. I may disagree with the ideas, but I can feel where the author is driving it. Other times the feel is split-brain — the …
www.lazutkin.com
August 25, 2026 at 5:25 AM
Exotic goto: generators and exceptions — yield and throw are jumps too, and each decides what happens to the code that has not run yet.

www.lazutkin.com/blog/2026-08...
Exotic `goto`: generators and exceptions
The last post argued that break, continue, and labeled jumps are structured goto — disciplined jumps that keep code linear. Two ordinary language features are jumps in disguise: yield, which suspends ...
www.lazutkin.com
August 18, 2026 at 5:54 AM
Duff's device in JavaScript — I ported Tom Duff's 1983 switch trick and measured it across eight runs. The verdict flips with the engine, the version, and the CPU underneath.

www.lazutkin.com/blog/2026-08...
Duff's device in JavaScript
In 1983, Tom Duff needed to copy memory into an output register faster than his compiler could manage, and wrote the most famous abuse of switch in the history of C. I ported his device to JavaScript ...
www.lazutkin.com
August 11, 2026 at 5:21 AM
`break`/`continue` is the new `goto` — Dijkstra's paper argued against unrestricted jumps, not named exits. Labeled breaks beat the flags people replace them with, and they skip work too. www.lazutkin.com/blog/2026-08...
`break`/`continue` is the new `goto`
“Go To Statement Considered Harmful” is one of the most-quoted titles in programming, and almost nobody reads past it. The argument underneath is narrower than the slogan it became — and …
www.lazutkin.com
August 4, 2026 at 7:10 AM
Fast enough — I once worked out from first principles that servers should run compiled languages. The client half of that prediction held. The server went the other way, and the reasons are better than the prediction. www.lazutkin.com/blog/2026-07...
Fast enough
Efficient resource utilization was at the forefront of computing from the very beginning. Over time we traded some of that efficiency for developer experience, and preserved the rest by harnessing …
www.lazutkin.com
July 28, 2026 at 6:46 AM