-
Notifications
You must be signed in to change notification settings - Fork 520
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
Are stub lib.rs
files a good idea?
#200
Comments
Summoning @kytrinyx to see if she has thoughts. |
Looking for that exercise where you consciously decided not to add a stub file... ah, it was #178. It was not for the exact same reason as described in here (here: "it restricts the solution" and in #178 "it reduces learning since coming up with the right signature should be part of the learning process"). In React at #191 I chose to include the stub file since:
In Triangle I was also going to bring up that we might choose not to include a stub file. So it may sound like a dissatisfying answer, but we may have to decide case by case
This becomes a little unfortunate - we could instead remove the trait from the stub file and place a |
Looking back through previous discussions, having a stub file in
Number 1: Can be nice, in some cases, and to proscriptive in others. Number 2: Eh. People can type Number 3: Huge. Not being able to run tests until you at least have I don't know of a way to solve the test-running problem without also introducing the problems that come with proscriptive function signatures. The only option I can think of, and it's not a great one, is to comment out the tests. We'd have to change our CI so that it uncomments the tests before running, though. |
I happen to know that the C++ track uses conditional compilation: https://github.com/exercism/xcpp/blob/master/leap/leap_test.cpp#L10 So, maybe we could have the same instead of using ignore? We do have conditional compilation: https://doc.rust-lang.org/book/conditional-compilation.html But the problem is it may be harder to understand. |
I personally prefer including a
I found it supremely annoying, especially since you can't |
Conditional Compilation does solve the main problem I want to solve, yes. In [features]
unimplemented = []
testable = [] In the tests #[cfg(feature = "unimplemented")]
fn test_a_thing() {
// test
} One option would be to have the students replace Or maybe there's a better way. |
My two cents as someone currently following the track: having to |
@DuBistKomisch That's a fair point.
That seems like it could potentially be a good compromise (as long as there's no compile error that would throw CI off). |
CI creates/overwrites lib.rs with the example anyways, so no problems there. |
@IanWhitney why did you close this? Consensus doesn't appear to have been reached and the exercises still contain various approaches when it comes to placeholder src/lib.rs files. I inadvertently opened a duplicate ticket (#269) because I missed this one. I'll close mine if you think this should be reopened. |
Initially suggested in #117, we've been adding these stub
lib.rs
files to most of our recent exercises. I'm still not sold on them, and I wanted to see what other people think.In the current Maintaining a Language Track document it is suggested that we:
Which I fully agree with. And I think that stub files also push people towards specific solutions.
Take, for example, Space Age. The test API is generic enough
There's more than one way to solve this.
But then the stub file tells students to use Traits. Which they do. I don't think I've seen a solution that removed the Trait.
In Triangle, a possible stub file would be:
Which leaves the student with very little to do. The design of the code has already been done. Students are not likely to take this stub and write a solution that uses Enums, Traits or Boxes. Solutions using those approaches are interesting to write and discuss.
The text was updated successfully, but these errors were encountered: