ECE 2524

Introduction to Unix for Engineers

Couldn't resist a review

Usage

  • The README contained everything I needed to easily use the program:

    Perhaps say <insert resistance value in Ohms> since it is common for people to want to enter 10k instead of 10000

  • The program compiles/runs without errors:

    While only a single source file, a Makefile would have been a nice touch.

  • The program worked as advertised:

Style

  • The code is cleaning divided into modules and multiple files:

    while everything is in a single source file, the modules are small enough that this isn't a major disadvantage.

  • Variable and function names are meaningful:

  • Comments are used where appropriate:

    No comments to speak of. While the code is simple enough to not need them, providing some to aid potential developers who may not be familiar with resistor color code value (at least a link to a reference sheet) would be handy.

Philosophy

  • The program most closely follows the filter interface pattern:

    It wouldn't take much more to give the option of reading values from standard input, allowing for a true filter implementation.

  • This choice of pattern is a good one for this application:

  • This program follows the Rule of Silence and Least Surprise:

  • This program follows the Rules of Modularity and Composition:

    there is great potential for a scriptable composable utility here. Just output the three colors on a single line, accept values on lines of standard input, and this could be used in a pipeline, or called by another program with ease

  • This program follows the Rules of Representation and Simplicity:

    all colors and values appear as magic numbers in the code. Moving this data into a data structure or external file would help simplify the conversion algorithm and open up possibilities for a more general purpose value conversion tool.