|
|
|
|
|
by taspeotis
2516 days ago
|
|
> Every line is documented C Every line? Oh dear [1]: /* Set verbose flag */
verbose++;
...
/* Set advanced flag */
advanced = 1;
...
/* Set expansion level */
expansion = atoi(argv[++i]);
...
/* Initialize game */
init_game(&my_game);
I assume the verbose flag is incremented because there's multiple levels of verbosity, whereas the advanced flag is a boolean, and i is incremented because expansion is not a command line flag (rather, an option). But I wouldn't know that from the comments! Especially useful to know if like, verbosity actually has multiple levels, like -v and -v -v or -v -v -v and so on ... instead of knowing that init_game is ... init'ing the game.Compare all those comments to this [2], which is actually a spectacularly useful comment. Signal to noise ratio! [1] https://github.com/bnordli/rftg/blob/master/src/learner.c [2] https://github.com/bnordli/rftg/blob/master/src/replay.c#L94 |
|