[cs631apue] snapshot feedback

Jan Schaumann jschauma at stevens.edu
Fri Nov 15 15:52:55 EST 2019


Rather than send you individual feedback, here's
feedback based on all your submissions.  Most of it
applies to all of you anyway:

- remember to include your git log in your final

- your .c files should each include all the standard
  headers it needs itself; don't have e.g. a file
  "myheader.h" that includes <stdio.h> etc.

- remember to protect your own headers against
  double-inclusion via

#infdef MY_HEADER
#define MY_HEADER
stuff goes here

- it's easier to comment out large chunks of code by

#if 0
dozens of lines here

  than by trying to use '/* ... */'.


- remember to remove commented-out code blocks prior
  to final submission

- recall the different feedback I've given you in
  class or in previous assignments; chances are, some
  of it applies to your code here, too.

- remember to remove debugging output (e.g. printf
  statements) prior to final submission; a better
  approach might be to write a debug function that
  only prints messages if the program was compiled with
  e.g. -DDEBUG:

debug(const char *fmt, ...) {
#ifdef DEBUG
	va_list args;
	va_start(args, fmt);
	vprintf(fmt, args);

- remember to use consistent style; if one of you
  writes code one way and the other another, you need
  to find agreement; fortunately, that's really easy
  here, since you have a style guide - use it

- be careful not to mix indentation styles (spaces vs
  tabs); a good code editor should highlight or
  otherwise notify you of mixed spaces

- make sure your files do not have non-Unix EOL; you
  are supposed to be writing code _in the Unix

- remember to support IPv4 and IPv6; be careful to
  avoid needless code duplication

- when supporting ~ directories, do not assume "/home"
  is the home directory; you have to get the correct
  home directory from the struct passwd for the given

- make sure the return type of your function is
  meaningful; if you have a function of type 'bool'
  that always returns true, then that is not useful

...and make sure to always check the return value of
any function that can fail!

Happy Coding!


More information about the cs631apue mailing list