Hacker News new | ask | show | jobs
by josteink 3023 days 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.

2 comments

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.

Even if true, the CLI resurgence in recent years has really out shined advances in IDE in my view
I'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.

I hate replying with an XKCD, but https://xkcd.com/1053/

The OP didn't even state they're "discovering [it] in 2018", at all. And even if they did, so what? What is the point that you're trying to make -- that you're a better developer because you knew something they didn't?

Can you give any examples ?
This is a screenshot of some of the formatting options provided in Visual Studio:

https://imgur.com/a/6PkSi

What on earth would prettier include to make it that much more extensive?

Just curious, does VS format files based on max length and break them if it exceeds? I have never seen a setting for that
I think the idea behind prettier is that it does not have many options.

Does VS format on the fly, or only on save ?

You don't understand how much Prettier formats your code. Your condescension is misinformed. It's not comparable to run of the mill IDE formatting.