Every programmer is a poet
Usage
-
The README contained everything I needed to easily use the program:
-
The program compiles/runs without errors:
Worked after fixing the Makefile2
-
The program worked as advertised:
Style
-
The code is cleaning divided into modules and multiple files:
the interface and alorithm were tied together and all defined in
main.cpp
(it doesn't appear thatstory.cpp
is being used). I would like to see a clearly defined module respoinsible for loading the story file into a data structure (could also be responsible for writing finished story to a file), another one repsonsible for taking a story structure and input list and generating a complete story, and another one defining the user interface. -
Variable and function names are meaningful:
variables were named well, but there were no fuctions at all.
-
Comments are used where appropriate:
no comments, but none were needed. While separate modules would have made things more organized, the code was fairly easy to understand as is.
Philosophy
-
The program most closely follows the
ed-like
interface pattern:To fully implement this interface the program should accept a story file name as a command line argument. I think it might also make sense to read words from standard input if a stream is provided. Perhaps in a simple yaml format to declare each word as a noun/verb/etc.
-
This choice of pattern is a good one for this application:
-
This program follows the Rule of Silence and Least Surprise:
Why force output files to end in .txt? I would have expected some appropriate use of standard input
-
This program follows the Rules of Modularity and Composition:
Given the interactive nature the program wouldn't work well in a pipeline or script. For this application it might not seem like that would be useful, but I think with a few relatively simple changes a non-interactive mode could be implemented. Who knows what uses someone else might find for the program if it were just a bit easier to use as part of a larger application?
-
This program follows the Rules of Representation and Simplicity:
The stories are stored in a separate text file, which is good, but the code can handle 6 and only 6 stories. The one-record-per-line is a limiting format for this type of data, cookie-jar format would probably be better.