On the Quiet Violence of Implicit Conversions
JavaScript will let you add [] to {} and thank you for it. A field guide to footguns.
Notes from a programmer's desk — on code, systems, and the strange joy of debugging at 2am.
I'm Maksim Zhabin — software engineer writing about the craft. TypeScript today, Rust tomorrow, assembly for fun. New essay every other Tuesday.
JavaScript will let you add [] to {} and thank you for it. A field guide to footguns.
Skip the regex. Skip the generator. Two hundred lines of switch statements and you'll understand something new about every language you've ever used.
Result types, error channels, and the curious peace of letting things crash loudly in development.
The blinking greeting at the top of this page isn't a CSS animation — it's a real React hook. Type, pause, delete, advance. Click copy and paste it into your project.
// A self-cleaning typewriter hook. No deps, ~30 lines.
import { useState, useEffect } from 'react';
export function useTypewriter(
words: string[],
speed = 80,
pause = 1800,
) {
const [text, setText] = useState('');
const [i, setI] = useState(0);
const [del, setDel] = useState(false);
useEffect(() => {
const word = words[i % words.length];
const delay = del ? speed / 2 : speed;
const t = setTimeout(() => {
setText(del
? word.slice(0, text.length - 1)
: word.slice(0, text.length + 1));
}, delay);
if (!del && text === word) {
const p = setTimeout(() => setDel(true), pause);
return () => { clearTimeout(t); clearTimeout(p); };
}
if (del && text === '') {
setDel(false);
setI(i + 1);
}
return () => clearTimeout(t);
}, [text, del, i, words, speed, pause]);
return text;
}
function Hero() {
const greeting = useTypewriter([
'hello, traveler.',
'you found /dev/log.',
'console.log(love)',
]);
return <h1>{greeting}</h1>;
}
142 essays on programming, written over four years. Filtered here by recency — the full index lives in the JSON.
One essay. No tracking, no ads, no "10x" anything. Unsubscribe with a single click — I won't even be offended.