Live data from Hacker News

$20k bounty was claimed

prettier.io

71–80 of 345 posts

Re: $20k bounty was claimed

#71
post #23

I feel like people complaining about Prettier being "heavily opinionated" are missing the point. Perhaps I'm biased by my decade of using Go, but not having to worry about superfluous stylistic choices is a welcome reduction in cognitive load. (Up to a point I guess, e.g. I'd never put up with K&R-style newline opening brackets).

Prettier is very opinionated about line length which gofmt isn't. That's the only complaint I have and it's bad enough I just refuse to use it. Add one character to a line and enjoy a ten-line diff. Edit: See a contrived example of something gofmt doesn't touch (the behavior I want): https://go.dev/play/p/cKMKnFwT8tq

Funny thing: I recently learned Go, coming from doing some TypeScript and the refreshing feel that was discovering Prettier.

I really miss that gofmt applied some limit to line length. In TS I just write a too long line, and Prettier reformats it into a sensible set of consecutive lines, I don't even have to think if breaking before or after this or that parentheses or bracket. With Go, I have to, and I'd rather not.

Re: $20k bounty was claimed

#72
Awesome! Lets gooo!

Can't say prettier performance ever bothered me, but if it can run faster and leaner I'm all for it! Increase my battery life :D

In general it's really exciting to see the advancements in JS tooling, the quick successions of tooling in JS might be controversial, but I love it. Each step was a significant improvement over what was there before, and the current Rust rewrite wave has already given us great tools that I use daily.

I also like that there is some money being thrown at the problems!

Re: $20k bounty was claimed

#73
post #59

Earlier quoted context omitted.

It's not really an issue if you do a one-time Prettification commit, and then stick to Prettifying automatically thereafter. Then you won't ever see line-width changes mixed in with functional changes. Isn't this an issue with every linter? At some point you're going to have to decide what to do with old code that doesn't match the new style rules.

> Then you won't ever see line-width changes mixed in with functional changes. You will - every time you extend a line which now exceeds the limit.

Isn't this a natural consequence of having line length limits? This seems like a general problem, not a problem with Prettier.

Re: $20k bounty was claimed

#74
I dislike prettier and wonder why it's so popular because

- I sometimes prefer lines to exceed maxLength (ex: template string, which prettier would horribly break on vars)

- allow `1 + 2 * 3` or `a || b && c` to be parenthesis-less because everyone know the precendence here

Re: $20k bounty was claimed

#75
post #42

Speed is always welcome, but I just wish prettier was a little less opinionated. Specifically around line length, it will just not leave my formatting alone. I find prettier formatted code much less readable than unformatted code, and this isn't a problem I have with other code formatters like rustfmt.

Have you tried the print width option: https://prettier.io/docs/en/options.html#print-width ?

Yes, but unlike most formatters where the width option is a maximum and it mostly leaves your code alone below that width, prettier will aggressively widen your code to fit if you up the print width setting.

I think rustfmt will actually also widen code you have put newlines in sometimes. But it's heuristic is somehow much better than prettier's.

Re: $20k bounty was claimed

#76

"This means that we can now focus on the next important aspect: Performance. Prettier has never been fast per se, but fast enough for most use cases. This has always felt unsatisfying so we wanted to do something about it. What better way than a friendly competition. On November 9th, we put up a $10k bounty for any project written in Rust that would pass 95% of Prettier test suite." I don't see how better performance…

Here is the answer I got from vjeux:

> There's a lot of fast web tooling being written in rust those days. https://twitter.com/Vjeux/status/1722769322299609565

I don't buy it. I think vjeux is riding the hype.

Re: $20k bounty was claimed

#77

Earlier quoted context omitted.

> Then you won't ever see line-width changes mixed in with functional changes. You will - every time you extend a line which now exceeds the limit.

Isn't this a natural consequence of having line length limits? This seems like a general problem, not a problem with Prettier.

Sure

Re: $20k bounty was claimed

#78
post #23

I feel like people complaining about Prettier being "heavily opinionated" are missing the point. Perhaps I'm biased by my decade of using Go, but not having to worry about superfluous stylistic choices is a welcome reduction in cognitive load. (Up to a point I guess, e.g. I'd never put up with K&R-style newline opening brackets).

Prettier is very opinionated about line length which gofmt isn't. That's the only complaint I have and it's bad enough I just refuse to use it. Add one character to a line and enjoy a ten-line diff. Edit: See a contrived example of something gofmt doesn't touch (the behavior I want): https://go.dev/play/p/cKMKnFwT8tq

Couldn't you just set the "printWidth" in .prettierrc.json to something super long?

Re: $20k bounty was claimed

#79

Speed is always welcome, but I just wish prettier was a little less opinionated. Specifically around line length, it will just not leave my formatting alone. I find prettier formatted code much less readable than unformatted code, and this isn't a problem I have with other code formatters like rustfmt.

I think the real issue with prettier is that it's almost become a de facto standard. E.g. personally I don't like it at all, but do like Svelte, and Svelte's official (and AFAIK only) formatter uses prettier. Hence I use prettier for Svelte, and ditto for a few other things.

So the whole "extremely opinionated, if you want configuration go somewhere else" is great in principle, when people are choosing to use the tool. But if it becomes the only option for certain swathes of users, a touch more configuration would really be appropriate.

Re: $20k bounty was claimed

#80

Earlier quoted context omitted.

I wish it were more opinionated. It treats new lines as significant in a lot of its formatting

I also don't understand their stand about curly braces. They don't add or remove them. I think they should make it uniform.

That's bizarre. They add/remove parens...but not curly braces...

How do you even justify that...

Post reply on HN