Live data from Hacker News

$20k bounty was claimed

prettier.io

231–240 of 345 posts

Re: $20k bounty was claimed

#231
post #81

Earlier quoted context omitted.

This is often useful, but JavaScript specifically has the annoying property that newlines can be semantically meaningful. For example, if someone changes: function isUserBanned(username) { return db.findUserByName(username)?.banned; } To: function isUserBanned(username) { return db.findUserByName(username)?.banned; } you want to see that diff because the second version always returns undefined. If you ignore whitespa…

That's technically true, but extrememly rare to cause real problems (short of bad intent). It reminds me of people/teams enforcing braces on single-line ifs, because one might add another line someday, forget to add braces, and break the logic. Even when it happens, there should still be tests that catch this.

On the one hand, yes, there should be tests. On the other, `goto fail;` :P

Also, adding braces from the start means that adding one new line of code is a one-line patch, instead of a four-line one - I do that for the same reason that I always put trailing commas on my array definitions

Re: $20k bounty was claimed

#233
post #63

Earlier quoted context omitted.

I'd rather have a strict line length limit, than having my coworker creating objects in lines 150 or 180 chars long. So we'd end up discussing what is the best choice. I bet I'd also end up discussing those things with Anthony Fu. If the limit is 80, then the limit is 80 , not 81. Come Prettier. No more discussions. I definitely buy the tiny amount of "noise" it brings, in exchange for freeing me from an immense amou…

> If the limit is 80, then the limit is 80, not 81. I agree with that. But the limit should be 120 or 160, not 80 (and my formatter should allow me to set a wider limit like that without making all my lines extra-wide - I want to be able to put things on one line where appropriate and not where it's not). > I definitely buy the tiny amount of "noise" it brings Tiny? It makes a lot of my code 3-5x as long. And often b…

> It makes a lot of my code 3-5x as long.

Do you mean entire files are made 3-5x as long or just individual lines every now and then?

Re: $20k bounty was claimed

#234
post #219

Earlier quoted context omitted.

Wasmer is a VC company building a platform that depends on the existence of these platform APIs – sockets, threads, forking, etc. They have a vested interest in the existence of these APIs, and the health of the developer ecosystem, to stay alive. From here, it kind of seems like the fundamental foundation of everything Wasmer is building. Meanwhile, Bytecode Alliance is a registered non-profit with many large corpor…

> The issue isn't with WASIX, but with you and your actions. Is refreshing to see at least some honesty. Haters gonna hate, so I personally don't mind. Have a great day!

This is kind of my point. It would be refreshing to see the CEO that would like our industry to build on top of his platform to show some humility. Do you care to admit to making any mistakes in your interactions, or is it all because we are just a bunch of haters?

Re: $20k bounty was claimed

#235
post #137

Earlier quoted context omitted.

> If the limit is 80, then the limit is 80, not 81. I agree with that. But the limit should be 120 or 160, not 80 (and my formatter should allow me to set a wider limit like that without making all my lines extra-wide - I want to be able to put things on one line where appropriate and not where it's not). > I definitely buy the tiny amount of "noise" it brings Tiny? It makes a lot of my code 3-5x as long. And often b…

Like I mentioned to the sibling parent, 100 is an OK middle ground. 120, or more, is too long already, and 160 is waaaay beyond what I'd consider acceptable. No way you can fit 2 side-by-side editor panes with those line lengths, unless you use a tiny sized font. I get it, 160 looks OK and fits into a 4K display without any other windows open. I believe working with dual panes is more productive, so I'll always stand…

I wasn't aware Rust chose a 100 line default. I'll definitely be using this to argue on my teams for why we should stretch the line length limit past 80. Thank you Rust for moving the industry forward

Re: $20k bounty was claimed

#236
post #234

Earlier quoted context omitted.

> The issue isn't with WASIX, but with you and your actions. Is refreshing to see at least some honesty. Haters gonna hate, so I personally don't mind. Have a great day!

This is kind of my point. It would be refreshing to see the CEO that would like our industry to build on top of his platform to show some humility. Do you care to admit to making any mistakes in your interactions, or is it all because we are just a bunch of haters?

I'm not even going to enter into the flame-bait. I obviously disagree with your points.

Hope you have an awesome day

Re: $20k bounty was claimed

#237
post #52
post #6

That's interesting. I've been using "deno fmt" as of late and it's been fine for me. https://docs.deno.com/runtime/manual/tools/formatter

FWIW it doesn't matter which formatter you choose, so long as everyone working on the project is required to use it.

In the same way it doesn't matter which side of the road you drive on. What matters is that everyone else is also driving on that side

Re: $20k bounty was claimed

#238
post #27

Are there benchmarks for Biome anywhere? How much better does it perform than prettier exactly?

Found some here: https://github.com/biomejs/biome/blob/main/benchmark/README.... They claim 25x but the numbers are old so I'm not sure if I believe them now that a bunch of new functionality has been added. Either way, if it's anywhere within that ballpark it's still a huge achievement.

This heavily depends on your workstation. Biome scales very well. With 16 threads on a i7-120P, I got the following figures:

Webpack repository:

  Biome ran
    2.19 ± 0.11 times faster than dprint
    4.18 ± 0.14 times faster than Biome (1 thread)
   32.12 ± 1.18 times faster than Prettier
   32.45 ± 2.56 times faster than Parallel-Prettier
I am not sure why Parallel-Prettier is slower than Prettier for the webpack repository.

Prettier repository:

  Biome ran
    1.89 ± 0.21 times faster than dprint
    3.47 ± 0.34 times faster than Biome (1 thread)
   36.70 ± 3.41 times faster than Parallel-Prettier
   46.66 ± 4.32 times faster than Prettier

Re: $20k bounty was claimed

#239
post #235
post #137

Earlier quoted context omitted.

Like I mentioned to the sibling parent, 100 is an OK middle ground. 120, or more, is too long already, and 160 is waaaay beyond what I'd consider acceptable. No way you can fit 2 side-by-side editor panes with those line lengths, unless you use a tiny sized font. I get it, 160 looks OK and fits into a 4K display without any other windows open. I believe working with dual panes is more productive, so I'll always stand…

I wasn't aware Rust chose a 100 line default. I'll definitely be using this to argue on my teams for why we should stretch the line length limit past 80. Thank you Rust for moving the industry forward

I guess Rust made the same reasoning than Python. For this kind of things, the PEP documents tend to be well based on experience and be a good guideline which even applies for other languages. Check the PEP 8 that I linked in my comment: although they recommend a very conservative limit of 80 (79 actually) it says that if it makes sense, 100 (99) can be used too. And that's from 2001.

Re: $20k bounty was claimed

#240
post #155

Earlier quoted context omitted.

> If the limit is 80, then the limit is 80, not 81. I agree with that. But the limit should be 120 or 160, not 80 (and my formatter should allow me to set a wider limit like that without making all my lines extra-wide - I want to be able to put things on one line where appropriate and not where it's not). > I definitely buy the tiny amount of "noise" it brings Tiny? It makes a lot of my code 3-5x as long. And often b…

Do you work with a large team? There is no correct answer for formatting for a team, there is only correct answer for individual person. The line limit 80/120/160 will work for certain people with their setup, but not others. Stuff like using a ultrawide screen with two columns, or code on laptop screen with single column, or code with half screen code editor and half screen browser, etc, there are endless mutation,…

I don't care what the limit is unless it's consistently applied.

My least favorite though no limit + soft wrapping, the philosophy being the code adapts to the user, but in actuality means the file looks completely different based on your monitor and setup removing visual aid to code navigation and familiarity.

Post reply on HN