|
5 | 5 |
|
6 | 6 | <h1>CS 1331 Java Style Guide</h1>
|
7 | 7 |
|
8 |
| -<p>This document summarizes and in some cases clarifies Sun/Oracle's |
9 |
| -<a href="http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html">Java Code Conventions</a> |
10 |
| -(and in some places copies it directly) and the Checkstyle checks specified in |
11 |
| -<a href="resources/cs1331-checkstyle.xml">cs1331-checkstyle.xml</a>. |
12 |
| -The Checkstyle web site also documents each of its standard checks here: <a href="http://checkstyle.sourceforge.net/availablechecks.html">http://checkstyle.sourceforge.net/availablechecks.html</a></p> |
| 8 | +<p>Style is very important when writing code. Often code is not judged simply |
| 9 | +base on how effectively it performs a specific function, but also how easily it |
| 10 | +can be understood by a human reader. While rules of style vary, it is important |
| 11 | +to be able to learn to write code which conforms to a given standard.</p> |
| 12 | + |
| 13 | +<p>In this class, the style rules that you are asked to follow are crystallized |
| 14 | +into an automated tool, called |
| 15 | +<a href="http://checkstyle.sourceforge.net">Checkstyle</a>. This tool is |
| 16 | +configurable to check for a large number of different stylistic errors. |
| 17 | +Additional details about how to run checkstyle on your code can be found <a href="checkstyle.html">here.</a></p> |
| 18 | + |
13 | 19 | <p>The file you need to run Checkstyle:</p>
|
14 | 20 | <ul class="simple">
|
15 | 21 | <li><a href="resources/checkstyle-6.2.1.jar">checkstyle-6.2.1.jar</a></li>
|
16 | 22 | <!--<li>New Version: <a href="resources/checkstyle1331v2.jar">checkstyle1331v2.jar</a></li>-->
|
17 | 23 | </ul>
|
18 |
| -Run checkstyle on your Java files like so: |
| 24 | +<p>In the simplest case, run checkstyle on your Java files like so: |
19 | 25 | <pre>java -jar checkstyle-6.2.1.jar MyJavaFile.java</pre>
|
| 26 | +For more advanced options (which will be necessary in later portions of the |
| 27 | +semester), check out the <a href="checkstyle.html">options available</a> for |
| 28 | +running checkstyle.</p> |
| 29 | + |
| 30 | +<p>The rest of this document summarizes and in some cases clarifies Sun/Oracle's |
| 31 | +<a href="http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html">Java Code Conventions</a> |
| 32 | +(and in some places copies it directly) and the Checkstyle checks specified in |
| 33 | +<a href="resources/cs1331-checkstyle.xml">cs1331-checkstyle.xml</a>. |
| 34 | +The Checkstyle web site also documents each of its standard checks here: <a href="http://checkstyle.sourceforge.net/checks.html">http://checkstyle.sourceforge.net/checks.html</a></p> |
20 | 35 | <div class="section" id="names">
|
21 | 36 | <h1>Names</h1>
|
22 | 37 | <ul>
|
|
0 commit comments