Style Guide for CS 343

The most important role of a set of coding standards is consistency. No group of programmers will ever completely agree on the best way to format code. Should code blocks be indented with tabs? With spaces? How many spaces? Two? Four? Eight? Where should opening braces be placed? The fact is, none of these things really matter that much. What does matter is consistency. It is very inconvenient for a group of people to work together on a shared code base if they don't agree on some set of common standards.


Google HTML/CSS Style Guide

Code submitted for this course must conform to the Google HTML/CSS Style Guide. These styles support clean, readable code that can be efficiently accessed over the Internet.

For each submission, you should have a header that declares (at a minimum), <!DOCTYPE html>, <meta> tags for both charset and author, and a <title>. Although these tags do not visibly appear on your page, they are important for accessibility and internationalization. The general structure should look as follows:

<!DOCTYPE html>
<html lang="en-US">
<head>
  <meta charset="UTF-8">
  <meta name="author" content="Your name here">
  <title>Sample HTML Style</title>
</head>
<body>
...
</body>
</html>

Validators

Unless otherwise specified, your code must pass the W3C Nu HTML Validator. This tool will detect formatting errors and make other suggestions for improving your code.

Your CSS code must pass the W3 Jigsaw CSS Validator. This tool will detect syntax errors in your CSS files to ensure your styles are applied correctly.

All of your code must also pass the WAVE Web Accessability Evaluation tool. This tool detects problems beyond syntax errors, ensuring that your code adheres to recommended practices for usability.



James Madison University logo


© 2011-2024 Michael S. Kirkpatrick.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.