Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I run a very small team of developers on a web application, just three people (and not even full time). We're all capable developers, but we write our code in very different ways: we name similar things in different ways, we use different HTML and CSS to achieve similar outcomes. We can manage this OK because we're small, but can't help feeling it would be better to get some standards in place.

Are there any good style guides or best-practice guides for web application development that we can use to keep our code under control?

Sure, we could write them ourselves. But the reality is that with lots to do and very few staff, we're not going to bother. We need something off the shelf that we can tinker with rather than start from scratch.


What we're not looking for here is basic code formatting rules like "whether to use tabs or spaces" or "where to put line breaks" — we can control this by standardising our IDEs.

What we are looking for are rules for code and markup. For example:

  • What HTML markup should be used for headers, tables, sidebars, buttons, etc.
  • When to add new CSS styles, and what to name them
  • When IDs should be allocated to HTML elements, and what to name them
  • How Javascript functions should be declared and called
  • How to pick an appropriate URL for given page or AJAX call
  • When to use each HTTP method, ie POST vs GET vs PUT etc
  • How to name server-side methods (Java, in our case)
  • How to throw and handle errors and exceptions in a consistent way

etc, etc.

share|improve this question

1 Answer

up vote 2 down vote accepted

Start here, then fork it for your own use.

Isobar - Front-end Code Standards & Best Practices

share|improve this answer
And for Javascript, here: google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml – Ciaran Jun 24 '11 at 2:33
I disagree with these two rules: Use px unit to define font size (em allows the user to apply his personal preferences), border-bottom with text-decoration: none for underlines on links (text-decoration is the intended way, so I stick with it. But I'm not a designer...). The rest is very sound advice, IMO. – Treb Jun 24 '11 at 8:17
Indeed the Isobar and Google Style Guides are a very good starting point for us. And it's nice to see people giving away these things at no charge! – gutch Jun 28 '11 at 5:31
@Treb I agree that those two rules are pretty weird... especially the underline one because they don't even follow it themselves on that page! The nice thing is that I can probably keep 80% of the things in these guides, and simply delete what I disagree with. – gutch Jun 28 '11 at 5:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.