monterail / guidelines

[DEPRECATED] We are Ruby on Rails experts from Poland. Think hussars. Solid & winged. These are our guidelines.
71 stars 17 forks source link

Trailing commas #229

Closed MichalZalecki closed 9 years ago

MichalZalecki commented 9 years ago

http://www.2ality.com/2013/07/trailing-commas.html

The link is for the brief only and as you might think is not only JS matter. It's not mentioned in the article, but my point is the VCS history cleanliness. If you'd like to add an element you won't left your comma on the previous line. Small improvement but the idea is interesting. I read about that in some comment under some dummy "there are 2 kinds of programmers..." fb post. What do you think?

teamon commented 9 years ago

It looks ugly, but I'm buying the vcs diff argument. On Tue 23 Jun 2015 at 22:04 Michał notifications@github.com wrote:

http://www.2ality.com/2013/07/trailing-commas.html

The link is for the brief only and as you might think is not only JS matter. It's not mentioned in the article, but my point is the VCS history cleanliness. If you'd like to add an element you won't left your comma on the previous line. Small improvement but the idea is interesting. I read about that in some comment under some dummy "there are 2 kinds of programmers..." fb post.

— Reply to this email directly or view it on GitHub https://github.com/monterail/guidelines/issues/229.

MichalZalecki commented 9 years ago

Yep, it's not the prettiest for sure. It more vcs vs the look. I'm also not used to leaving trailing commas, but it's good to be aware of the advantage.

kubakrzempek commented 9 years ago

Trailing commas are awesome, not only because of the vcs diff but also because you can remove/add whole line (works with js objects or ruby hashes, but not only) without thinking about whether you should work with commas as well.

jandudulski commented 9 years ago

:+1:

always using that style

teamon commented 9 years ago

@MichalZalecki Please submit a PR.

hodak commented 9 years ago

Merged https://github.com/monterail/guidelines/pull/237