Skip to content

Comment on Ask HN: Examples of Unusual Code Formatting Styles?

Comments

Historically it was common advice to avoid elaborate code formatting, as keeping up such formatting by hand was tedious, time consuming, and inconsistent, compared to the value add.

Given near all code (let's say for large projects) is authored with IDEs, elaborate formats can be applied consistently and automatically, at little or no cognitive or typing cost.

To me the question is then if such formatting can increase the legibility of the code. The grid of static variable declarations in [2] is nice, but I wonder if sorting the variable lexicographically would make it easier to read/find a var by name?

Not sure how splitting method signature names onto a second line helps, though.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.