3 ms·
IMHO there should be a distinction between code serialisation (the bytes on-disk, in version control) and code formatting for display/editing. The serialisatio
by chriswarbo 6y ago
IMHO there should be a distinction between code serialisation (the bytes on-disk, in version control) and code formatting for display/editing.
The serialisation should be normalised automatically, preferably in a way that minimises line-based diffs.
The way code is formatted for display should be distinct, and can usually be more of a personal preference. Most people seem to be happy for their editor to use syntax highlighting to make things more readable, but not much else. Indentation, line length, aligning sub-expressions, etc. can also help readability, but showing those things differently from the bytes on disk is usually avoided.
Perhaps this is due to a conflation of meaning for certain bytes. For example, \n can mean "token separator" to the language, "long line splitter" or "intent separator" to the developer, "unit of comparison separator" to version control, etc.