Code Style Guidelines

Processing Style Guidelines

Your code should be well formatted and easy to understand and read. Use comments where they will be helpful to you and to me. You have flexibility to choose your own formatting conventions. They should be applied consistently.

Header Comments
Every program you write should contain a header comment that describes the program and includes other important information.  It must include the following information:

  • The assignment number and name
  • Your name
  • Your UNM e-mail address
  • The class number and name
  • The date the assignment was submitted
  • A short description of your program

For example:

/*****************************************
 * Small Assignment 2: Processing and Turtle Geometry
 * Name:    Rudy Gurule
 * E-mail:  rgurule@unm.edu
 * Course:      CS491, Computational Fabrication
 * Submitted:    2/5/2022
 *
 * This program includes several different features.
* To plot a polar plot, press the p key.
* To draw a circle with a turtle, press the t key.
* To draw a flower, press the f key.
* To draw a cool turtle path, press the c key.
***********************************************/

Grasshopper Style Guidelines

Use the “Scribble” tool in Grasshopper to create text. You can find the tool under Params –> Util, or by double clicking on the Grasshopper canvas and typing “Scribble”. See the image below.

The comment should include al of the same information listed above (course information, name, email, etc.). If you want to give your comment some color, select the top level Edit menu and then select Group. This will create a colored box around your scribble. See below for an example.

Python Style Guidelines

TBD