Posts

Showing posts from January, 2017

Is a Single-Line CSS Comment Without Any Spaces Between the Opening and Closing Symbols Okay?

CSS comments are identified by the opening symbol of /* and closing symbol of */ and no other symbol. Also, like all other languages supporting this format, the comments may not be nested ("Comments", 2016).

Issue and ResearchBut what about the spacing in between the opening and closing symbols? Authoritative sources (Robbins, 2012) and experts on StackOverflow ("Is it bad practice to comment out single lines of CSS with //?", 2013) teach leaving one blank space after the opening and before the closing symbol for a single line comment. That looks more readable than skipping the mentioned spaces. The cost for this is two more key presses and the mental effort required. This effort will be repeated for very (manually typed) comment.