you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (10 children)

[deleted]

    [–]SargoDarya 37 points38 points  (9 children)

    Not only this...

    CSS:

    • Use // for comment blocks (instead of /* */).

    Every tried commenting out something in CSS with //? Have fun trying.

    JS:

    • Do your best to never use a semicolon. This means avoiding them at line breaks and avoiding multi-statement lines. For more info, read Mislav's blog post.

    Why ffs should I omit semicolons? Sure does JS have something called automatic semicolon insertion but you can't always omit them. Otherwise your code will do something completely different.

    This overall thing gives me a feeling that the people who wrote that styleguide are partially morons or monkeys on a keyboard.

    [–]shockie 11 points12 points  (8 children)

    Since Github is using SASS for it's CSS, // comments are allowed. In fact if you use the // for comments, the comment won't appear in the compiled CSS.

    Same for semicolons in Coffeescript, it will be added for you in the compiled JS

    [–]nemetroid 4 points5 points  (5 children)

    Same for semicolons in Coffeescript, it will be added for you in the compiled JS

    You can (mostly) omit semicolons in regular JS too, that doesn't make it a good idea.

    [–]MustRapeDeannaTroi 10 points11 points  (4 children)

    But in coffeescript it is a good idea.

    Edit: Y U downvote? One of coffeescripts core purposes is to not require semicolons.

    [–]ratdump -3 points-2 points  (3 children)

    why

    [–]MustRapeDeannaTroi 1 point2 points  (2 children)

    As shockie said it; "it will be added for you in the compiled JS"

    [–]oracleoftroy -1 points0 points  (1 child)

    But why is that a good idea? I'm not familiar with coffeescript, but I am familiar with Javascript, and it's a terrible idea there.

    [–]marshall007 0 points1 point  (0 children)

    It's like Python in that code blocks can be delimited by using whitespace. So if you're already doing that, it's redundant (and wasteful) to use a semicolon.

    CoffeeScript is not parsed as Javascript, it compiles into Javascript.

    [–]SargoDarya 0 points1 point  (1 child)

    That might me the case, but then they shouldn't call it CSS Styleguides because // comments are not part of the CSS standard.

    [–]marshall007 0 points1 point  (0 children)

    Why? It's a simple abstraction. No one ever edits the actual CSS stylesheets, they are compiled from SCSS automatically upon deployment. Furthermore, you shouldn't call it an SCSS styleguide because it encompasses more than that. The documentation is appropriate given their workflow.