Re:A Prettier JavaScript Formatter
by artursapek on Tuesday January 10, 2017 @11:55AM
(#13366297)
Don't let HN negativity get you down. This is an awesome project and I'll contribute bug fixes/test cases if we end up adopting it on our team (very likely based on your blog post).
the parent gave an ill example and suggest a solution, how's that a negativity?
I believe it was the "Nice attempt, but currently wrong." at the start of the comment. "Nice attempt" could imply that this should be thrown out in favor of another attempt to solve the problem.
The entire comment was patronizing. "Nice attempt" minimizes the effort involved and implies the author is a novice. "but currently wrong" categorizes the entire project as a failure because of a single bug. The followup "From my own experience writing a formatter" really drives the whole thing home.
Re:A Prettier JavaScript Formatter
by artursapek on Tuesday January 10, 2017 @01:58PM
(#13367775)
Classic HN :-)
Wasn't meant that way.
"Nice attempt" used to actually mean the words it said. You know, like "nice job".
Also, “currently wrong” is a really sweeping statement to make based on a single problem written in a fairly uncommon style. Yes, there are things which need to be fixed but that doesn't mean we have to be so dismissive of someone else's work which they've given away for free to the community.
Re:A Prettier JavaScript Formatter
by artursapek on Tuesday January 10, 2017 @01:28PM
(#13367439)
Like dangoor said, it was the way it was delivered.
I'm actually very excited by your "attempt". Looking forward to where it goes!
Re:A Prettier JavaScript Formatter
by mnarayan01 on Tuesday January 10, 2017 @01:36PM
(#13367527)
I think what the GP is saying is to do the re-parsing before/after every time you reformat (and then presumably error exit if the ASTs don't match). When/if you no longer have any known bugs like that you might want to remove it, but it does seem like a good idea until you get there.
Re:A Prettier JavaScript Formatter
by tlrobinson on Tuesday January 10, 2017 @01:24PM
(#13367381)
Running existing codebases through it and comparing the ASTs is a nice idea. Seems like it should be pretty easy to automated it for the top N (100?) JavaScript projects.
There are a very few subtle bugs like the one you mentioned above. As noted in the readme, this is a beta. It's certainly more than an attempt.