Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lorentz1522829dI'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=")
}); -
@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 .. -
lorentz1522828d@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?
-
@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 )
Related Rants
-
Milenchy45Why are the fastest laptops always considered "gaming" laptops and look like fucking alien spaceships? 😩 T...
-
Chippy1"I'm not ugly. I just reduce my graphics to have better performance."
-
n3xus20GUYS WE HAVE BEEN WRITING FOR LOOPS IN JAVA WRONG THE WHOLE TIME. Here is how it should be done correctly... i...
Prettier is a plague.
It isn't pretty , it never has been.
rant
always has been
prettier
ugly