6 ms·
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 wor
by portlander12345 9y 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.
- eknkc 9y agoThis is what I do writing Go. gofmt comes around and cleans up my mess when I save.
- saranshk 9y agoI 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 9y agoEven better if your editor auto indents. I use aggressive indent mode for Emacs and it works ok. Sluggish on large files though.
- josteink 9y 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.
- tonto 9y agoEven if true, the CLI resurgence in recent years has really out shined advances in IDE in my view
- josteink 9y agoI'm not saying that CLI-based tools are bad in any way. They are awesome, especially for automation. I'm just saying that discovering the benefits of automatic code-formatting seems like a very strange thing to do in 2018. This has been around for a loooong, looong time now.
- z3t4 9y agoCan you give any examples ?
- josteink 9y agoThis is a screenshot of some of the formatting options provided in Visual Studio: https://imgur.com/a/6PkSi https://imgur.com/a/6PkSi What on earth would prettier include to make it that much more extensive?
- always_good 9y agoYou don't understand how much Prettier formats your code. Your condescension is misinformed. It's not comparable to run of the mill IDE formatting.
- deleted 9y ago[deleted]
- cc81 9y agoExactly. 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.
- GordonS 9y agoI 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!
- scrollaway 9y agoI miss Prettier in Python. YAPF is atrocious. Good news is some Prettier contributors (let's call em pretties) are working on Python support.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- PetitPrince 9y agoWhat are your gripes with yapf ? I'd like to use a formatter for my Python code; should I rather wait for something better ?
- scrollaway 9y agoNot opiniated enough, not enough configuration in the places that matter, some formatting bugs, very slow. Try it and see, it works for some people.
- joshuamorton 9y agoMy favorite thing is using long argument lists with it without a trailing comma. Similar for hardcoded np matrices.
- samhunta 9y agoWe 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.
- dvddgld 9y agoAfter using prettier with vscode recently, I have to agree, not having to think about formatting at all while editing feels fantastically freeing.
- nemoniac 9y agoTo 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.