exercism/c

Use of macros in "Series" isn't clear, consideration for removal?

Closed this issue · 2 comments

In the Series exercise, there are a few macros defined that are never used:

#define MAX_INPUT_TEXT_LENGTH (8)
#define MAX_SERIES_RESULTS (MAX_INPUT_TEXT_LENGTH)
#define MAX_SERIES_LENGTH (5)

I've tried checking out a few community solutions, and I haven't seen them being used. Personally, I tried reading the comments in the header multiple time to make sense, but I was never able to understand the use of these macros.

When the number of series (strlen(input_text) - substring_length + 1), as well as the size of each string (substring_length + 1) (both of which will have to be calculated to check for edge-cases mentioned later in the test in the beginning of the function) is already known, wouldn't it be better to consider their removal?

From the top of my head, after looking at the exercise meta file, I would say these directives are used only as a way to provide information to the student about the expectations.

The student is then free to either use them or not as they need.

I agree with @wolf99. I'm going to close this for now. @Ashvith10 if you disagree feel free to reopen this and continue the conversation.