Comments (13)
We can extend the README by adding a HINTS.md
file in the exercise directory.
from rust.
I'm entirely on the fence. And I think whichever way we go there's going to be a group of students that don't like it.
For me, I like not having the signature. I'm entirely new to Rust and static typing and I've found that I like puzzling out what I have to implement by looking at the tests. But that might just be me!
As for parallel letter frequency
, I think the API could be improved. I find the current implementation to be hard to parse. Again, that might just be me.
from rust.
I'm also on the fence. In the Go track we've provided stub files early on, and then we phase them out after the first few. For the most part reverse engineering function signatures doesn't seem to be difficult in Go, though, and I don't have experience with Rust, so I can't speak to how much busywork that adds here.
from rust.
Take a look at the output of cargo test
if I run an exercise with empty source file and another one with an empty function with a wrong type signature:
https://gist.github.com/ijanos/59644c68af57e38d5fd81ba6b1baee27
Now compare it to the output once you get the type signature right:
https://gist.github.com/ijanos/53cb04393b6c4e80e5ecbcd908bae0c2
Interpreting the errors is definitely not hard but it can be intimidating at first and mildly annoying if someone doesn't get the types right at the first try.
I think extending the README is a good middle ground to this issue. People still have the option to figure out the function signature while others can just copy paste it and start solving the real exercise.
from rust.
Let's try the HINTS.md
approach in an early exercise and see how it looks.
from rust.
I'm fine with this.
Would the HINTS file contain anything else?
from rust.
It's going to show up as part of the README, so maybe a sentence explaining that this is the expected function signature?
from rust.
Yeah, that would be nice.
from rust.
I agree with @IanWhitney in that it's helpful/fun to puzzle out the function signatures (and struct/impl too).
I think it's very useful, but I think it should be made explicit. I think exercises to teach about writing the signatures may be a good approach.
Until those exercises get created, though … I think having hints in certain exercises would be a good approach. Possibly in the test file itself. There were very few where I was 😖
from rust.
I spent lots of time this weekend to work on this track. I found it really annoying to figure out which functions the test cases do expect. It also conflicts with the way how it is intended to fix the tests. You cannot ignore all the tests marked with ignore, because it results in build errors. So you need to inspect all test cases anyway.
Even then, it is easy to overlook some function and then you see only the huge errors created by marco expansion.
Therefore, I am in strong favor of providing function signatures. I would even put them into a stub src/lib.rs
file. (Also I found it annoying to always run mkdir src; touch src/lib.rs
. Why is the file not just created?)
I found the Forth exercise to be a pleasant surprise to already contain a lib.rs
file. Slightly less convenient, but still better than the rest is the Robot Name exercise which contains these information in the test file.
Whatever this discussion will result in, I think the Forth and Robot Name exercises should follow the same pattern than the rest. It does not really make sense for those middle and late exercises to introduce function signatures.
Would you consider merging stub files with function signatures, if I create a pull request for them?
from rust.
I think stub files with signatures are great. Thanks! I'm also bugged by the compiler failing due to ignored tests.
from rust.
I'm in favor of a at least an empty src/lib.rs making the directory and the file is busywork.
from rust.
Now that we're starting to add src/lib.rs
stub files, I'm going to close this issue. Thanks for the suggestion, @ijanos !
from rust.
Related Issues (20)
- Improve example solution testing scripts
- CamelCase test unintentionally removed from acronym exercise HOT 2
- Building a training set of tags for rust HOT 25
- Tests fail with no output HOT 15
- Tests don't pass when sending Cargo.toml with optional dependency HOT 1
- Remove all util functions from test files HOT 4
- Test in CI that stubs don't generate clippy warnings HOT 1
- Move more CI tests to rust tooling
- Concepts for this track are not displayed HOT 1
- word-count: change interface from u32 to usize
- test type_override fails even when correct solution is made in macros lesson HOT 1
- Performance issue about the Isogram problem approach HOT 1
- Add test that templates match generated test suite HOT 5
- One of two-bucket's test case is wrong HOT 3
- Improve exercise order
- new test case for Phone Number HOT 2
- Wrong source link in the exercise `Reverse String` HOT 2
- protein-translation: adds extra codons without mentioning them in instructions HOT 2
- protein-translation: slightly confusing setup HOT 7
- grep exercise fails with implementation using clap on the grader HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.