[C] Missing boilerplate for resistor-color-duo

As reported by @Naavin in Resistor Color Duo - #7 by Naavin

I’m looking through the c repo, most other examples seem to have the functions and the required typedef in the header file. Apologies if this is intended behavior.

Inconsistency in headers provided · Issue #740 · exercism/c · GitHub appears to be related.

I see that there was a lot of discussion about this being intentional, but I think it’s a bit strange that resistor_color has an empty typedef:

#ifndef RESISTOR_COLOR_H
#define RESISTOR_COLOR_H

typedef enum {

} resistor_band_t;

#endif

And resistor-color-duo and resistor-color-trio don’t have anything.

Having to necessarily look at the tests to figure out the interface is strange coming from other tracks, but I see why it’s done in C. I think even if nothing is added to this exercise, there should be a comment mentioning that having no boilerplate is intentional and figuring out the types is part of the exercise.

2 Likes

Makes sense to me.