98 points · by ekiauhce · 2y ago · 79 comments
[0] https://biomejs.dev/ [1] https://github.com/biomejs/biome/pull/1362
The performance comparison on Biomejs’ site shows a Prettier run taking 14 seconds, which I can imagine on a very large code base might be true - but that’s a one-off case surely? Once it’s run, it’s just a case of format on save or commit which is back to near-instantaneous.
What’s the use case I’m missing here?
Biome can also format malformed code. It supports formatting as you type.
Biome has less known non-idempotent formatting (For some edge cases you need to run twice Prettier to get a stabilized output).
Biome is also a linter. You get two tools that are closely compatible.
But still, formatting changed files on commit, even on CI ought to be a fraction of a second.
Really like that they don't give options to change the settings. Just one less thing to bike shed within teams. Really doesn't matter what is picked, just as long as it is consistent (and not obviously stupid).
The ‘original’ quote, from someone explaining why gofmt has no configuration options is:
> The usual saying is that gofmt isn’t anybody’s preferred style, but it’s adequate for everybody.
And the interpretation from someone asking about configuring some aspect of it is (emphasis mine):
> The usual saying is that gofmt isn’t anybody’s preferred style, but it’s adequate for everybody who still using it
Being opinionated about defaults is often a positive thing. Removing any options just makes your tool less useful.
Which order do they do it in? Later classes are later in the css so more likely to be applied?
https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
> If the competing selectors have the same values in all the three columns, the proximity rule comes into play, wherein the last declared style gets precedence.
If the knife storage had been opinionated, we would have expended no effort and achieved consistency. The choice of direction was essentially arbitrary, but making a choice and sticking to it was valuable.
- https://prettier.io/docs/en/why-prettier - https://prettier.io/docs/en/option-philosophy
I switched to Rome (now Biome) after this debacle: https://github.com/prettier/prettier/issues/840
value = (a ? ((a * b) + c) : d);
It turns into: value = a ? a * b + c : d;
This is just a very basic example, there are many situations where the result is way worse. I feel pretty confident in saying that this is quite obviously stupid.Maybe we could write a formatter plugin in Elixir that does the same thing if this one isn't usable directly.
It saddens me to see people new to web development don't realize that to deploy a webpage, all it takes is just uploading (SFTP) a single .html file onto a web server.
Nothing more is technically required than that, but we've made it so complex you'd never know.
Deploy it to what? How? Via what? Who is managing it? Who is paying for it? Who physically installed the server, and setup your ability to DrawTheRestOfTheHTML?
Personally - while we want abstraction in our deployment understandings to smooth ramp understanding - its important to see all the supporting inputs that made your SFTP of an .html possible.
>>I once saw him teach a philosophy lesson about a pencil. A Fuckin' Pencil!
Yes, it's unfortunate that new developers don't know the basics. However, that's not an option for a multi-page site with complex user interactions.
There's no point in complaining about new tools being created which serve a need. If it makes someone's job easier when they're creating complex web apps, it's a good thing.
I guess you can get away with that because a tool can follow those rules.
But man, I <3 alpha sort.
But then I'm so old school I prefer just putting the CSS in the CSS, or even the `style` attribute. (I must say I do appreciate the pseudo-class support in tailwind.)
https://github.com/validator/validator/wiki/Markup-%C2%BB-Vo...
What do you mean by "never been specified"? They are in the spec: https://www.w3.org/html/wg/spec/syntax.html#start-tags
> Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.
[1] https://html.spec.whatwg.org/dev/input.html#the-input-elemen...
You will never find any HTML specification which will tell you a closing slash is required or that it has any meaning or does anything at all.
And the link you provided is specifically for the input tag, which has nothing to do with the syntax definition in general. Why would they repeat a generally applicable rule in more specific sections?
I'm wondering why you are so triggered by that issue that you have to bring it up in a context where its off-topic (it could be brought up on any post related to Prettier).
The validator Wiki page even highlights that it's essentially a non-issue, except for interactions with unquoted attributes, which Prettier also converts to quoted attributes, so that interaction never happens. The other reason is for "teaching the wrong" mental model, which I guess is fair from the position of MDN, but Prettier was never designed as a "teaching formatter".
And if you, even with all that context want to opt-out of that formatting, there is a community-maintained plugin that adjusts the formatting to how you want it: https://github.com/awmottaz/prettier-plugin-void-html