3

Prettier is a plague.
It isn't pretty , it never has been.

Comments
  • 2
    I've had very positive experiences with Rustfmt so my conclusion is that Prettier is shit because its layout algorithm is shit. The most noticeable problem to me is that it supports zero possible cases of block last element in an inline layout, so everything becomes super long. Rustfmt will keep a variety of expression types in inline form if the last element (or last argument of last function call) is a long array literal or lambda. This shit:

    let foo = args.iter().any(|x| {

    x == "-f" || x.startsWith("--foo=")

    });
  • 1
    @lorentz A conceptual problem with formatters also is that you cannot make an 'exception' without having to declare it.

    Of course said declaration makes the code more cluttered as well.

    I'm of the opinion that good formatting is learned just like writing with 12 fingers or switching to a different keyboard layout.

    Always do it and eventually you will do it automatically / naturally.

    The people I work with write code as if they were using JSON.stringify without options ..
  • 1
    @ElectroArchiver When you say good formatting, do you mean a shared universal formatting style that the entire project follows, or do you mean a set of high level guidelines under which any formatting is permissible, or am I oversimplifying?
  • 2
    @lorentz Generally any is better than none.

    Mixed formatting isn't as bad as people make it out to be , yes having one style is nicer but if it's not too dissimilar so what.

    In the projects I work with , we always have 90% old vendor code that is kinda minified and of course transpiled because fuck us for wanting types ..

    So any new code added ( which is often separate ) I write and enforce to be of a certain quality ( not just formatting )
Add Comment