Imagine turning  three friends [tic, tac, toe]  into three friends  ・tic ・tac ・toe . A new top-level syntax is suggested to highlight the benefi

Delimiter-first code

submited by
Style Pass
2024-11-29 16:30:06

Imagine turning three friends [tic, tac, toe] into three friends ・tic ・tac ・toe . A new top-level syntax is suggested to highlight the benefits of this approach. It’s simple, maintains visual structure more effectively, and could help address common formatting issues in code.

A well-known proposal is to write commas first in languages like javascript, JSON or SQL, which don’t have trailing commas (JS has these days, but not the other two):

But these arguments don’t quite hold up. Tools can adapt to any notation, so Argument 1 isn’t relevant. And while Argument 2 points to the comfort of familiarity, code culture has already evolved far from typical writing norms. We count from zero, use underscores in names, bend traditional rules for quotes, and use indentation rather than paragraphs to structure text. As tools prove alternative methods work well, they tend to gain traction.

Criticism of delimiter-first style stems from habit and tool compatibility, yet examples in SQL and JavaScript highlight its benefits, and the Haskell community largely supports leading commas, demonstrating its practical value.

Leave a Comment