What I dislike about OCaml

That’s a confusing statement; previously-deprecated options were removed in 0.22, earlier this year. As a result, at least for a while, I’ve locked our ocamlformat version to 0.21; it’s TBD whether we end up upgrading eventually, or retreat to an alternative formatting mechanism.

(That deprecation and removal, and previous statements that ocamlformat’s focus would tend towards fewer options (and thus an easier-to-maintain implementation, and understandable meta-objective) is what causes this topic to resurface periodically.)

Aside from maintainability concerns, the regular mention of “diff-friendliness” (as in the comment @shonfeder linked here) as an overriding criteria for supporting any given formatting option is baffling to me. Lots of activities in programming create things that aren’t “diff friendly”, but that’s very rarely an important factor in deciding to do anything IME. I reach for formatting tools to enforce a degree of regularity in a codebase, and do so yielding something that is most readily scanned, comprehended, and edited. Worrying about whitespace in diffs feels quite irrelevant in comparison.

2 Likes