尾随分隔符才让人快乐
本文指出JSON、Haskell、TLA+等语言禁止尾随逗号(trailing comma)属于设计失误。当增删条目时,开发者不得不手动调整末行逗号,而尾随逗号允许统一的行级增删操作,显著减少改动复杂度。文章对比了Go/Python(仅允许尾随逗号)、Alloy(允许首尾逗号)等方案,并讨论了尾随分隔符可能带来的解析歧义问题。
本文指出JSON、Haskell、TLA+等语言禁止尾随逗号(trailing comma)属于设计失误。当增删条目时,开发者不得不手动调整末行逗号,而尾随逗号允许统一的行级增删操作,显著减少改动复杂度。文章对比了Go/Python(仅允许尾随逗号)、Alloy(允许首尾逗号)等方案,并讨论了尾随分隔符可能带来的解析歧义问题。
The author rejects becoming a "reverse centaur"—a term for humans forced to review machine-generated code—after observing a surge in LLM-produced pull requests to his open source projects. Despite his personal decision not to use generative AI coding tools, he now spends increasing time reviewing code written by AI and explains how he resists this role.
The author, who once advised his sister to use code libraries without fully understanding them, now finds himself unable to commit AI-generated code he doesn't fully comprehend. He recounts spending 10 hours fixing code that an LLM produced in 12 minutes, and notes that while others trust AI code generators like a car engine, his need to understand every line negates any productivity gains.
The article argues that many single-page app developers misuse divs or buttons with onclick handlers instead of proper anchor tags for navigation, breaking browser history, accessibility, and native link features. The author urges using native `<a href>` elements or framework Link components.
The article argues that Lucas Costa's concept of "backpressure" for systems handling code-generating AI is a misnomer. Backpressure signals upstream processes to slow down, while Costa's suggestions are about improving quality, not reducing quantity. The author proposes "lean manufacturing" as a more accurate analogy for managing unstable inputs from AI-generated code.
The article explains that the Windows thread pool is optimized for throughput rather than low latency, which can cause delays in task execution. It discusses the trade-offs between throughput and latency when scheduling work on thread pools.