Camen Design Forum

"Web Languages" Pet Peeves

Grimmeh

My pet peeve with HTML is that I cannot settle on a formatting style: what to indent and what to not; what to separate with empty lines and what to group together, &c. Strange, I know.

For CSS, I’ve recently grown to like a formatting style as such:

element { property-name: values; }

element {

<indent>property-name: values;
<indent>property-name: values;
<indent>property-name: values; }

As for pet peeves, I haven't got many, but no space between a property name and the values pisses me right off. I’ll make sure to add them in before anything.

As for other logical languages, curly braces should be on the same line as what's before it and there should be empty lines after and before them. Whitespace between parenthesis on both sides, always. I like whitespace, it makes it airy and easy to read. I rely on the editor to let me know the start and end of code blocks.

function ( parameters ) {

<indent>i = ( 1 + 1 );

}

Append

(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn