Skip to content
TopicTracker
出典 buttondown.com/hillelwayne原文を表示
翻訳言語翻訳言語

末尾ではないセパレータは喜びをもたらさない

JSONやHaskell、Prologなど多くの言語では、リストやオブジェクトの末尾にカンマを付けられない仕様になっている。この設計は「最後の行だけ特別扱い」を強いるため、要素の追加・削除・並び替えといった編集操作を非対称で面倒なものにする。一方、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.