3 ms·
Prettier’s biggest win is that it automates 99% of style complaints away and practically eliminates most classes of nitpicking. But, as well as the issue with
by ljm 3y ago
Prettier’s biggest win is that it automates 99% of style complaints away and practically eliminates most classes of nitpicking.
But, as well as the issue with line noise, it also encourages patterns that I think detract from code comprehension. It favours expressions over statements and even now, it’s not easy to set a breakpoint in the middle of one, so you end up rewriting into statements just so you can step through.
It will favour deeply nested ternary statements in react so your code reads more like a tree with densely tangled roots.
It will favour shorthand syntax for optionally merging properties into an object, which basically relies on a quirk of the splat operator.
There is fuck all standard library to speak of without pulling in an insane amount of dependencies, but surely stuff like deep merge and compact should be provided out of the box?
- tubthumper8 3y ago> It favours expressions over statements and even now, it’s not easy to set a breakpoint in the middle of one, so you end up rewriting into statements just so you can step through. I've never had an issue setting an inline breakpoint[1] in VS Code, is it an issue in other IDEs? [1] https://code.visualstudio.com/Docs/editor/debugging#_inline-breakpoints https://code.visualstudio.com/Docs/editor/debugging#_inline-...
- ljm 3y agoI use emacs, but chrome/firefox are a bit finicky about where you can set a breakpoint. (Most people I know just use console.log - print debugging works all the time but I like having a repl)
- yawboakye 3y agodoes it? prettier is extremely configurable, unlike gofmt. so deferring to the authority of prettier is essentially deferring to the authority of the prettier.yml config. not that i have a problem with that _per se_, i’d expect the author(s) to take responsibility and appreciate that they’re defining/imposing their own taste(s).
- nicoburns 3y agoExtremely configurable? It has like 3 config options, and an explicit policy of not being configurable.
- hu3 3y ago> prettier is extremely configurable That's the opposite of what they claim: https://prettier.io/docs/en/option-philosophy https://prettier.io/docs/en/option-philosophy
- yawboakye 3y agothe delta, when prettier is introduced in a project for the first time, not counting +/- whitespace and semicolons (where none existed) isn’t huge. where it matters, the configuration options you get is all that’s necessary.