Giter Club home page Giter Club logo

Comments (13)

kytrinyx avatar kytrinyx commented on July 23, 2024 1

We can extend the README by adding a HINTS.md file in the exercise directory.

from rust.

IanWhitney avatar IanWhitney commented on July 23, 2024

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.

kytrinyx avatar kytrinyx commented on July 23, 2024

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.

ijanos avatar ijanos commented on July 23, 2024

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.

IanWhitney avatar IanWhitney commented on July 23, 2024

Let's try the HINTS.md approach in an early exercise and see how it looks.

from rust.

ijanos avatar ijanos commented on July 23, 2024

I'm fine with this.

Would the HINTS file contain anything else?

from rust.

kytrinyx avatar kytrinyx commented on July 23, 2024

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.

ijanos avatar ijanos commented on July 23, 2024

Yeah, that would be nice.

from rust.

tpitale avatar tpitale commented on July 23, 2024

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.

jonasbb avatar jonasbb commented on July 23, 2024

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.

IanWhitney avatar IanWhitney commented on July 23, 2024

I think stub files with signatures are great. Thanks! I'm also bugged by the compiler failing due to ignored tests.

from rust.

ijanos avatar ijanos commented on July 23, 2024

I'm in favor of a at least an empty src/lib.rs making the directory and the file is busywork.

from rust.

IanWhitney avatar IanWhitney commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.