Now I actually think the code is wrong there, and that should be a pointer, but assuming for a minute it's correct, I must now ask the question: why does the same line of code in two different places have two different comments explaining what it's doing? One comment describes it as "a modifiable pointer" to "the stack" and the other "a non-const pointer" to "the stack object". St_stack stack_pointer = (st_stack*)stack To illustrate the point further, this appears further down: /* Generate a non-const pointer to the stack object */ A better comment might explain why it has to be modifiable. The comment doesn't tell me anything that the code doesn't already say. St_stack * stack_pointer = (st_stack*)stack ![]() ![]() It's generally acceptable to assume that the reader of your code understands the basics of the programming language it's written in.įor example, you have one comment like this: /* Generate a modifiable pointer to the stack */ A lot of the commenting in that example code is completely unnecessary and only clutters up the code.
0 Comments
Leave a Reply. |