Formatting code should be unnecessary
31–40 of 484 posts
Re: Formatting code should be unnecessary
#32It basically is, unless you’re in a whitespace-Nazi language like Python (no offense!). It doesn’t get much less formatted than Minified JavaScript, except maybe Perl or Brainfuck.
Re: Formatting code should be unnecessary
#33You can't easily search / grep etc. an IR, unless you use some kind of reverse translator. Readable source files have their benefits in being simple in that sense.
Imagine having to write a new diff tool for each language!
Re: Formatting code should be unnecessary
#34Kind of a stupid take if you ever plan on sharing your code or using git.
Re: Formatting code should be unnecessary
#35Kind of a stupid take if you ever plan on sharing your code or using git.
Is it? When every developer has an IDE that can easily format the code in whichever the way they prefer, and minify it back just before pushing a commit.
Re: Formatting code should be unnecessary
#36The tradeoff here is not being able to use a universal set of tooling to interact with source files. Anything but text makes grep, diff, sed, and version control less effective. You end up locked into specialized tools, formats, or IDE extensions, while the Unix philosophy thrives on composability with plain text. There's a scissor that cuts through the formatting debate: If initial space width was configurable in th…
Exactly. This idea comes up time and time again, but the cost/benefit just doesn't make sense at all. You're adding an unbelievable amount of complex tooling just to avoid running a simple formatter. The goal of having every developer viewing the code with their own preferences just isn't that important. On every team I've been on, we just use a standard style guide, enforced by formatter, and while not everyone agre…
Re: Formatting code should be unnecessary
#37Re: Formatting code should be unnecessary
#38It never ceases to amaze me how many times people can essentially re-invent S-expressions without realizing that's what they are doing.
Re: Formatting code should be unnecessary
#39The tradeoff here is not being able to use a universal set of tooling to interact with source files. Anything but text makes grep, diff, sed, and version control less effective. You end up locked into specialized tools, formats, or IDE extensions, while the Unix philosophy thrives on composability with plain text. There's a scissor that cuts through the formatting debate: If initial space width was configurable in th…
The entire OS was built around these source files. the unix philosophy on the other hand only "thrives" if every other tool is designed around (and contains code to parse) "plain text"
And how did that work out for them?
This seems like one of the many cases where unix won out by being a lowest common denominator. Every platform can handle plain text.
Re: Formatting code should be unnecessary
#40Earlier quoted context omitted.
Imagine having to write a new diff tool for each language!
You don't need a special grep for every language, you just need a tool that translates the mini version into the formatted version and back. Then you chain the tools, just like anything else in UNIX.