CS357 Spring 2020 Haskell Coding Standard

Failure to follow the coding standards as outlined may result in grade penalties on the assignment(s) in which coding standards were violated, up to and not exceeding 25% of the total maximum grade of that assignment.

Exceptions to this standard may be made on a per-assignment or per-question basis as necessary to encourage your learning, all exceptions will be explicitly stated. Failure to follow directive and/or instructions in regard to any part of an assignment (e.g. using functions or code patterns explicitly restricted, or failing to use functions or patterns explicitly required) is not a coding standards violation and deductions for failure to follow instructions are not limited to 25% of the total maximum grade for that assignment.

Filetype:

Unless otherwise specified, Haskell homeworks must be turned in as valid Haskell files. All Haskell files must have the .hs filetype, occasionally you may be required to submit code in Literate Haskell (.lhs).

Unless otherwise specified, assignments must be turned in as a single file covering all required statements and definitions.

Naming:

Function names may be in camelCase or road_kill_case/snake_case, as long as the function names are adequately descriptive and one case formatting is used throughout the code.

Exception: mandatory function names (i.e. you are required to write the function "foo_bar") must be used as given even when they differ from the case style used throughout your code, your choice of case is allowed to differ from that of mandatory symbols.

Indentation:

All multi-line code must be logically indented and should aid the readability of the code, no determinations will be made on whether a line should be broken into multiple lines unless you are writing only single-line code to avoid properly indenting your code.

Indentation may be achieved by either tabs or spaces, do not mix the two for indentation purposes unless you decide to alternate in-line or by-line, regardless: consistency is required unless you are using emacs.

Commenting/Non-executable code:

Comments may be either single line via double dash (--) or multi-line via start ({-) and end (-}) tags. Comments interrupting a line of code should be avoided unless necessary for code clarification. Large blocks of commented-out or otherwise unused code should not be submitted as part of an assignment: if you are unable to complete some portion of assignment but would like to submit what you have for partial credit you must ensure that what you have is functional helper methods with comments indicating their intended use.

One or more comments at the top of each file turned in must contain your name (Last, First) and UNM Net ID.

Haskell Specific Items

Code submitted will use explicit type signatures, these aid in reading as well as writing code.

Helper methods used in only one function must be defined using "let ... in ..." syntax, or "where" sytax, and not written at top level.

Updates:

Updates to this file will be made as necessary on a per-assignment basis, it is your responsibility to ensure you follow coding standards and to check that you are in adherence prior to submitting an assignment. Resubmissions more than 24 hours after the due date of an assignment to bring a submitted and ungraded file into compliance may be penalized in accordance with the existing late penalty, resubmissions of already-graded assignments may only be accepted and regraded under demonstrated extenuating circumstances.

The last update to this file was: 2020-04-03