Live data from Hacker News

$20k bounty was claimed

prettier.io

261–270 of 345 posts

Re: $20k bounty was claimed

#261

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.

There's a more insidious side effect to prettier related to the line length thing which I'm not sure other commenters touched upon, and the reason I avoid opinionated formatters.

Prettier will affect your diff in ways you didn't intend to.

Remove a member from a destructuring assignment that brings it below the line length limit, and suddenly your diff is +1/-5 instead of 0/-1, making it slightly more difficult for your reviewer to see what the exact difference is between those 5 lines removed and 1 line added - it's not immediately clear which member was removed.

You try to rewrite a previous commit to fix a typo using Git's interactive rebase, and now the next commits won't replay on top if it because Prettier decided to reformat an entire code block.

Another fun thing to try with prettier: add a precommit hook that runs prettier, and then try to stage partial file changes.

No thanks.

Re: $20k bounty was claimed

#262
post #70

Earlier quoted context omitted.

Sure you will. Whoops, my regex got too long and now the diff is - filter: /\.(jimmy|jimbo|jeremiad)$/ + filter: + /\.(jimmy|jimbo|jeremiad|james)$/ . And it's not clear where the change is. GP's article has an example of that in a linked tweet.

Is that down to the formatter - which you've configured to enforce a certain line length ( https://prettier.io/docs/en/options.html#print-width ) - or the diff visualiser that doesn't show a difference between whitespace and other changes?

It's impossible to turn off line length rules. You can only change the width, which means if you set it to a big number it will aggressively unwrap code you want to keep wrapped sensibly. Awful and unacceptable.

Re: $20k bounty was claimed

#263

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.

It's an issue with prettier because it cannot be disabled.

Re: $20k bounty was claimed

#264
post #171

Earlier quoted context omitted.

Keep in mind as a freelancer you have to make about for $2.50 for every $1 a salaried person makes, as you're on the hook for 100% of taxes, health care, business expenses, etc.

Yeah, it's closer to 1.5x. Most companies budget total comp at 150% of salary.

Most? I can't think of a gig beyond maybe a couple of folks in a coworking space where I wouldn't be laughed out of the room with "just make it 150% of salary and we'll figure out the real number whenever". Virtually every company I've ever worked with budget the actual number, because they know how much the overhead cost is. There's a huge difference between "a number I use when asked 'ballpark how much a new hire is gonna run us'" and "what is the amount of money I'm asking the CEO to allocate me in next years budget".

Re: $20k bounty was claimed

#265

Earlier quoted context omitted.

I'm not sure what roadmap you are talking about. Threads are actually removed from WASI Preview 2. WASI Preview 2 still doesn't support threads, fork, subprocesses or longjmp/setjmp (among others). Not even that, when WASIX was created not even sockets were supported in WASI. I'd recommend trying to compile bash or curl to WASI Preview 2 and WASIX and see how far you get in each before trying to polarize the readers…

The roadmap I linked above. The WASI folks have done a poor job at communicating, no doubt. Just for you I did some googling: see here[0] for the current status of WASI threads overall, or here[1] and here[2] for what they are up to with WASI in general. In this PR[3] you can see they enabled threads (atomic instructions and shared memory, not thread creation) by default in wasmtime. And in this[4] repository you can…

Just to be clear, and to reinforce what I mentioned.

WASI Preview 2 doesn't officially support threads. There are some ways to get it running as you mentioned, but threads are NOT part of WASI Preview 2. Which is what you initially stated and I corrected.

We don't want to have competing standards either, and we'd love to merge things upstream. However, based on my interactions with the WASI subgroup it seems clear they want to keep some of this things that WASIX needs out of the spec (and that's ok!). If you would not like to have that, then you shall probably direct your requests towards them, not us.

> I want good tech to win

Me too! I now understand this over-idealistic belief is the root of the issue. Good tech doesn't win, a good product does.

I wrote more about this, if you are curious, here: https://wasmer.io/posts/is-not-about-wasm-is-about-what-you-...

Re: $20k bounty was claimed

#266

Earlier quoted context omitted.

I'm not sure what roadmap you are talking about. Threads are actually removed from WASI Preview 2. WASI Preview 2 still doesn't support threads, fork, subprocesses or longjmp/setjmp (among others). Not even that, when WASIX was created not even sockets were supported in WASI. I'd recommend trying to compile bash or curl to WASI Preview 2 and WASIX and see how far you get in each before trying to polarize the readers…

The roadmap I linked above. The WASI folks have done a poor job at communicating, no doubt. Just for you I did some googling: see here[0] for the current status of WASI threads overall, or here[1] and here[2] for what they are up to with WASI in general. In this PR[3] you can see they enabled threads (atomic instructions and shared memory, not thread creation) by default in wasmtime. And in this[4] repository you can…

thank you! slimsag is not the one being polarizing at all… pretty sure everyone in the wasm space is sick of this too, but hey, keep building I guess?

Re: $20k bounty was claimed

#267

Earlier quoted context omitted.

Do you have any examples where prettier code is much less readable? I haven't really ran into that issue and have been very happy with prettier.

A good example from further down the comment section: Prettier doesn't break template literals, but it will break non-literal sections of template strings. For example, if we wrote this: const foo = `aaaaaaaaaaaaaaa${bbbbbbbbbbbbb}ccccccccccccccc${ddddddddddd}`; prettier would fix it to const foo = `aaaaaaaaaaaaaaa${ bbbbbbbbbbbbb }ccccccccccccccc${ ddddddddddd }`; Which is not only much harder to read in it's own ri…

I have a PR fixing that: https://github.com/prettier/prettier/pull/15209

Just needs another maintainer's stamp.

Re: $20k bounty was claimed

#268

Earlier quoted context omitted.

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...

Curly braces are reflected in the AST, parens are not.

Re: $20k bounty was claimed

#269

Earlier quoted context omitted.

> I sometimes prefer lines to exceed maxLength (ex: template string, which prettier would horribly break on vars) Prettier doesn't break a long template literal though...? > allow `1 + 2 * 3` or `a || b && c` to be parenthesis-less because everyone know the precendence here "Everyone knows" is usually an unwise assumption. And adding parentheses does make it easier to read even for people who know their order of oper…

Not OP, but prettier doesn't break template literals, but it will break non-literal sections of template strings. For example, if we wrote this: const foo = `aaaaaaaaaaaaaaa${bbbbbbbbbbbbb}ccccccccccccccc${ddddddddddd}`; prettier would fix it to const foo = `aaaaaaaaaaaaaaa${ bbbbbbbbbbbbb }ccccccccccccccc${ ddddddddddd }`; (or something similar) and it would be fully equivalent. I don't like it doing that either tbh…

I have a PR fixing that specific issue: https://github.com/prettier/prettier/pull/15209

Just needs another maintainer's stamp.

Re: $20k bounty was claimed

#270

Earlier quoted context omitted.

I came here to say that $200/hour is only "extremely conservative" in very few and small geographic parts of the world. Where I'm from (in a large city in the US) this number would be described as extravagant. I've charged $200 or more on only one occasion myself, and it was a very short-term arrangement.

I'm from a large city (but not the largest) in Canada and $200/hour or higher is common for high end devs, architects, and project managers. I charged $200/hour twenty years ago. These days I'd charge $250-300/hour if I was a contractor. It is not extravagant in most of North America, but again, it is a rate for higher end talent. I have not charged less than $150/hour since the 90s. I once had some contractors in my…

Yeah when I was a contractor in 1996 Mountain View $200 was table stakes for someone with non trivial technical skills.
Post reply on HN