Live data from Hacker News

The GitHub Styleguide

github.com

31–40 of 82 posts

Re: The GitHub Styleguide

#31
post #24

I'd recommend adding: * Alphabetize properties within each CSS rule To here: https://github.com/styleguide/css

I strongly prefer logically grouping related styles. The only advantage from alphabetizing rules is perhaps slightly faster scanning of rules, but I don't think it is even very helpful in doing that. You generally don't have that many rules in a single style anyway so it's not a problem that needs solving. However, by grouping related styles I think there are a some small yet worthwhile advantages. Grouped styles can…

I would agree with that if there were a defined, consistent logic, but I've never seen that done well across multiple developers. After switching to alphabetized rules, my CSS feels much more organized and I'd say is much easier to scan and refactor.

Re: The GitHub Styleguide

#33
post #14

After reading this, I just want to say that I do not think semicolon-less javascript is, in general, a good idea. Development projects are almost always team efforts. And, unfortunately, there's almost always one or two team members who aren't very good. Some of you folks that only work on startups with brilliant people might disagree, but in my experience most development teams have some bad apples who have let thei…

Yeah, you save one character per line, and gain a lot more in cognitive friction. Words to live by: "don't make me think" even about whether or not I need a semi-colon here.

Dropped semicolons about 6 months ago and haven't had a problem even once.

Once you get into the habit, it requires zero extra effort. You just know when to put them in, same way you just know when to use parens vs curlies.

Coding with semis is like coding with parens around every expression; unnecessary and paranoid.

Re: The GitHub Styleguide

#35
If you're commenting on the dangers on no semis I would put money on the fact you haven't given it a real try. Perhaps you tried it, had an issue once, and immediately reverted. Its like critiquing a book you haven't read.

Re: The GitHub Styleguide

#36

Earlier quoted context omitted.

They actually don't provide a justification. That blog makes the argument that omitting them is harmless. Neither GitHub nor the blog make an argument for why you should omit them, however.

Do you use semicolons in Ruby, Python, shell, or other semicolon-less language where semicolons are allowed? If not, what's your justification for omitting them?

[deleted]

Re: The GitHub Styleguide

#37

Earlier quoted context omitted.

They actually don't provide a justification. That blog makes the argument that omitting them is harmless. Neither GitHub nor the blog make an argument for why you should omit them, however.

Do you use semicolons in Ruby, Python, shell, or other semicolon-less language where semicolons are allowed? If not, what's your justification for omitting them?

Why is a justification needed?

Re: The GitHub Styleguide

#39
post #33

Earlier quoted context omitted.

Yeah, you save one character per line, and gain a lot more in cognitive friction. Words to live by: "don't make me think" even about whether or not I need a semi-colon here.

Dropped semicolons about 6 months ago and haven't had a problem even once. Once you get into the habit, it requires zero extra effort. You just know when to put them in, same way you just know when to use parens vs curlies. Coding with semis is like coding with parens around every expression; unnecessary and paranoid.

  > Coding with semis is like coding with parens around every expression; 
  > unnecessary and paranoid.
Unless, of course, one is using Scheme or some other Lisp variant.

Re: The GitHub Styleguide

#40
post #14

After reading this, I just want to say that I do not think semicolon-less javascript is, in general, a good idea. Development projects are almost always team efforts. And, unfortunately, there's almost always one or two team members who aren't very good. Some of you folks that only work on startups with brilliant people might disagree, but in my experience most development teams have some bad apples who have let thei…

Yeah, you save one character per line, and gain a lot more in cognitive friction. Words to live by: "don't make me think" even about whether or not I need a semi-colon here.

That's a good point, even the reference article states that, in some cases, a semicolon is necessary (in the begin of the line). If it's necessary reason about use it on some cases (and mistakes will happen), why not use it on every line?

The guide doesn't have anything about brackets and spacing on function calls (maybe because it's dropping the language).

Post reply on HN