You will use Makefiles so that the graders and assistants can build your projects
from source, and are guided through your test suites.
Test —
You will make test suites for your code.
Thou shalt sayth not "my project works".
Thou shalt sayth "when the test suite is run, the expected behavior is observed."
Coding style —
Your name and date must be in comments at the top of all files. I consider this
your promise to me that this is your own work, or you have explained the source of
the code otherwise.
Use only lower-case in filenames, with exceptions for strong historical precedence: Makefile, README.TXT,
maybe a few others. Never distinguish a file by case, and always refer to the file by the chosen case.
Do not declare variables in the middle of a block. Reject this C99 feature.
A variable's scope and lifetime should be a block, end of story. Coding is hard enough.
Do not use Variable Length Arrays (VLA). Reject this C99 feature.
They turn sizeof from a keyword into a function call, sometimes, and you now have run-time type
errors as well as run-time allocation errors. Coding is hard enough without turning your back on the
compiler's assistance in memory layout and type computation.
You can use // on line comments.
I'm conflicted on the use of zero-length arrays. Harbison and Steele tells me I'm an outlaw,
but I can't seem to care. Your choice.
Comment what isn't obvious. Comment what confused you when you wrote this code.
Comment assumptions on parameters at the top of the function block.
I prefer writing subroutines more basic first, so I don't need forward declarations. I consider
this a huge hint to debuggers about what depends on what. I recommend not doing forward
declarations unnecessarily.
Use header files. Consider them as declaring your API. What's in the .h file explains
what you intend to be the stable functions and types, as opposed to helper functions that
might change.