CS300 Programming

Course Style Guide

The compiler only requires that you use the correct syntax for the programming language. Good

style helps you write code more efficiently and minimize bugs.

Good programming style ensures that source code is easily read and understood

by people.

Frequently a programmer must adapt their personal style for a project. This CS300 Course Style

Guide is heavily influenced by the Google Java Style Guide

(https://google.github.io/styleguide/javaguide.html) , and is designed to help you develop good

habits along with your own personal style. It is organized into the following general sections:

Source Files

Formatting

Naming

Commenting

Miscellaneous

Eclipse Tips

The final section includes tips for using Eclipse to help your code conform to these specifications.

Follow these steps before starting your first assignment!

Source Files

File Name

The source file name is the (case-sensitive) name of the top-level public class or interface that it

contains, plus the .java extension.

File Encoding: UTF-8

Source files are encoded in UTF-8

(https://www.fileformat.info/info/unicode/utf8.htm) . Be careful

when copy/pasting between applications, as some characters may be converted into incompatible

characters ("smart" angled quotes, longer dashes, etc). You may need to find/replace or manually

delete and re-type such characters.

File Organization12/4/23, 11:11 PM

Course Style Guide: COMPSCI300: Programming II (001) FA23

Page 2 of 9

https://canvas.wisc.edu/courses/375321/pages/course-style-guide

Each source file consists of, in order:

First, a file header comment in exactly the following form:

FILE HEADER (INCLUDE IN EVERY FILE) //

//

// Title: (descriptive title of the program making use of this file)

// Course: CS 300 Fall 2023

//

// Author: (your name)

// Email: (your @wisc.edu email address)

// Lecturer: (Hobbes LeGault or Mark Mansi or Mouna Kacem)

//

PAIR PROGRAMMERS COMPLETE THIS SECTION ///

//

// Partner Name: (name of your pair programming partner)

// Partner Email: (email address of your programming partner)

// Partner Lecturer's Name: (name of your partner's lecturer)

//

// VERIFY THE FOLLOWING BY PLACING AN X NEXT TO EACH TRUE STATEMENT:

// ___ Write-up states that pair programming is allowed for this assignment.

// ___ We have both read and understand the course Pair Programming Policy.

// ___ We have registered our team prior to the team registration deadline.

//

/ ALWAYS CREDIT OUTSIDE HELP //

//

// Persons: (identify each by name and describe how they helped)

// Online Sources: (identify each by URL and describe how it helped)

//

///

In the same way you would cite your sources on a paper, you should acknowledge any

assistance you received.

If you did not receive any help of any kind from outside sources, write NONE next to each of

the "OUTSIDE HELP" prompts.

Next, any/all required import statement

你可能感兴趣的:(学习方法)