top | item 16550148

(no title)

portlander12345 | 8 years ago

Besides the streamlining of code review, it’s hard to overstate how much this streamlines _editing_. You can modify code so much faster if you don’t have to worry at all about formatting. Just push code around any which way, cut and paste, type some giant expression into the middle of another one. Then hit Save and move on.

And contrary to what you might expect, Prettier basically never makes stupid formatting choices. It’s incredibly nuanced.

discuss

order

cc81|8 years ago

Exactly. Currently I have been moving back and forth between languages and editors and when I code C# or Java I miss prettier all the time.

VS Studio and IntelliJ have some language formatting but the difference between them and prettier feels huge.

scrollaway|8 years ago

I miss Prettier in Python. YAPF is atrocious. Good news is some Prettier contributors (let's call em pretties) are working on Python support.

GordonS|8 years ago

I use Visual Studio with ReSharper on a daily basis, and it automatically formats code just fine - but I've been a ReSharper user for many years now, so I'm not sure if it's VS or R# that is doing the formatting!

sebazzz|8 years ago

Microsoft uses Roslyn to format code as it is committed.

saranshk|8 years ago

I have kind of stopped indenting my files while editing. I know prettier will do that when I hit save (I have it as an extension in code)

jwdunne|8 years ago

Even better if your editor auto indents. I use aggressive indent mode for Emacs and it works ok. Sluggish on large files though.

dvddgld|8 years ago

After using prettier with vscode recently, I have to agree, not having to think about formatting at all while editing feels fantastically freeing.

eknkc|8 years ago

This is what I do writing Go. gofmt comes around and cleans up my mess when I save.

mjaniczek|8 years ago

This. But with Elm and elm-format :) It's a must in any language!

samhunta|8 years ago

We started using Prettier as a pre-commit git hook and the results have been amazing. There are developers in PRs who will not be comfortable with the eslint settings, have linting turned off or will otherwise ignore linting. Prettier just streamlines so much and you can disable the warnings in eslint that prettier handles automatically. It's insanely useful.

nemoniac|8 years ago

To streamline it even more use aggressive-indent-mode in emacs. Your code is indented correctly after every keystroke and you have even fewer formatting worries.

josteink|8 years ago

> it’s hard to overstate how much this streamlines _editing_. You can modify code so much faster if you don’t have to worry at all about formatting. Just push code around any which way, cut and paste, type some giant expression into the middle of another one. Then hit Save and move on.

If this is a new discovery for you, it sounds like you missed out on these things we used to call "IDEs" which were pretty popular more than a decade ago.

MrManatee|8 years ago

Every IDE or editor I've used has had automatic indenting, but what I hadn't experienced before Prettier is working with a formatter that can break expressions onto multiple lines. For me, that's the new thing that streamlines editing.

If that was a common feature in formatting tools more than a decade ago, then I missed it too.

tonto|8 years ago

Even if true, the CLI resurgence in recent years has really out shined advances in IDE in my view