-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exercise ResistorColor is confusing or too difficult #840
Comments
Hello. Thanks for opening an issue on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed. That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there. Note: If this issue has been pre-approved, please link back to this issue on the forum thread and a maintainer or staff member will reopen it. |
@jhaand the last test doesn't require you to return an array of values from the heap. The tests communicate this by not Can you help me understand why creating the |
@ryanplusplus I've experienced the same with other students in this exercise. Quite a few were asking how to solve the last test, others returned a pointer to a local variable asking why they got an error, a third group dynamically allocated the array with |
I don't think this is a bad thing? Researching how others have solved a common problem is a valid part of software engineering. I'll agree that having the signature could make this easier, but students need to learn it t some point. With the concepts part of the C track not yet in place we don't have a good way of teaching new things aside from, "here's something new, have a go at it". Or to put it another way, students will need to face each hurdle at some point. Having said that I would be interested in any proposals of an alternative |
I would expect to use an application to determine the actual resistor value. By testing the actual bands of a resistor. If you add the multiplier colors, that wouldn't be so hard. A test of:
would make a lot more sense and lie closely to an actual application. |
This is essentially what the later resister color exercises do. This first exercise starts with single color input so as not to require passing in multiple args, e.g. as an array. The later exercises then build with that aspect. |
The test with |
I looked up other peoples solutions in a private window in order to get an idea of what was required. I think that Exercism shouldn't require such an approach. |
That's exactly what
Possibly two options to help with this:
Both of these options would need to be implemented in the problem-specifications repo first before they could be updated here. |
I don't see a problem with this. Technically students can find the solutions online and just copy-paste all of them if they wanted to. If students want to learn a language rather than learn how to copy-paste or learn how to be spoon-fed, they need to put in at least some research |
The static array solution could go in a Resistor Color II problem. |
Maybe it helps if I explain the way I solved this exercise. I just finished this exercise as C newbie with very little experience in languages that force you to do manual memory management.
I think the Exercise is fine on it's own, the amount of research I had to do is what I expect from a track without a syllabus. Would I expect it so early in the track? No, I'd propose to move the exercise a bit more to the back. But then again, I'm a C newbie so not sure if there are easier exercises to put there that don't force you to learn about memory management. |
Thanks for the feedback. I think moving the exercise a little later is a good balance. Given that we don't have concept exercises, someone working through the track is going to have to do a bit of research to get past this, but pushing it a bit later is an easy change. |
Please have a look at this proposed change: This bumps the difficulty from 1 to 3 and moves it to the end of the exercises with the same difficulty rating. |
I solved it in the same manner as @fapdash did. The solution @ryanplusplus proposes looks good to me. |
Just a small idea: What if would split the line TEST_ASSERT_EQUAL_INT_ARRAY(expected, colors(), ARRAY_LENGTH(expected)); into two lines: const resistor_band_t *actual = colors():
TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, ARRAY_LENGTH(expected)); That would make it more obvious to beginners that The very tiny downside is that this would enforce a pointer to |
Or create an earlier unit test that simply tests that |
@emaphis That won't work because before test can run and print a helpful message you will get a compiler error if you choose the wrong return type. |
@siebenschlaefe Ok. But if the student fixes unit test compile errors systematically from top to bottom, the will run into the `ColorsMustReturn APointerToAnArray or whatever earlier on. |
We don't have these "hint-like" unit tests anywhere else in the track, so I'm not sure if that's the way to go. |
Yes it would, the purpose of the line to highlight api type errors is not very explicit though. Maybe if you include a comment:
Students would know that line is a hint instead of a implementation artefact. |
@siebenschlaefer, I like your suggestion. I'll update my PR to include those changes. @emaphis I think it will probably be clear enough without explicitly noting that the line should compile. We can revisit if we continue to have issues. |
* Move resistor color to later in the track and bump the difficulty Addresses #840 * Make the return value more clear
Hi,
For the C track I found the last test of this exercise very confusing.
It was very easy to map the mnemonics to an enum for the first 3 tests.
https://exercism.org/tracks/c/exercises/resistor-color
But the last test has no signature for the colors() function. And the solution requires to return an array of values on the heap. (static array) I find these quite advanced topics for an easy assignment without any hints.
Which invites people to look up solutions.
It would actually have been easier for me to calculate the resistor value based on 4 random colors.
The text was updated successfully, but these errors were encountered: