elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Captain's Log instructions should nudge the student towards the erlang call requirement.

Open zorn opened this issue 2 years ago • 4 comments

https://github.com/exercism/elixir/blob/be6101a052f015a8fd74e2fe233d0bb1af1b0543/exercises/concept/captains-log/.docs/instructions.md?plain=1#L44-L53

I solved this early on with the following but then was dumbfounded why the test would be specifically looking for an ArgumentError. When I attempted to add guards I got FunctionClauseError which of course did not match.

  def format_stardate(stardate) do
    Float.round(stardate, 1) |> Float.to_string()
  end

Suggestion

I suggest we add a line to the instructions hinting that solving this using an erlang call is a requirement.

zorn avatar Sep 23 '22 15:09 zorn

Hi @zorn, frightfully sorry for the long response time. We already have hints in place that suggest to use an Erlang function, and also this is an exercise about Erlang interop, so I don't know if we need to change the instructions. What do you think about it?

jiegillet avatar Oct 25 '22 13:10 jiegillet

I'll be transparent and share I work on the exercises in a local editor environment, and it never even occurred to me to look for a file called HINTS.md. I always just opened the README file and work from there.

That said, I find misalignment in that the tests for task four are checking "does not accept integers" and asserting that behavior by looking for ArgumentError. There is nothing in the task instructions to suggest this as a specification.

If you removed the HINTS file, assuming it is optional content, and just read the tasks and tests I feel it was confusing, at least for me. 🤷‍♂️

zorn avatar Oct 25 '22 14:10 zorn

Right, I stumbled onto your videos yesterday, I think it would have been useful to know about the hints for the AST one ;) Great job on the videos BTW!

The concept exercises are optimized for the online editor, and the hints are part of that, but I see where you're coming from. OK, let me look into this and come back to you.

jiegillet avatar Oct 26 '22 00:10 jiegillet

Sounds good. Obviously, my feedback is one signal so take it into consideration with the others. Good luck!

zorn avatar Oct 26 '22 03:10 zorn

Hi @zorn, I've thought about this, and I don't see anything wrong with being a more explicit in the main instructions. We could probably simply add a line

Implement the `format_stardate/1` function that will take a floating point number and return a string with the number rounded to a single decimal place. 
The implementation should use an Erlang function.

What do you think? Would you like to help implementing that change?

jiegillet avatar Nov 03 '22 14:11 jiegillet

Sure. I'll make a PR over the weekend.

zorn avatar Nov 04 '22 00:11 zorn

Awesome. We should probably do the same for task 3.

jiegillet avatar Nov 04 '22 13:11 jiegillet

Awesome. We should probably do the same for task 3.

The thing is, the tests for task 3 do not currently validate a specific Erlang implementation. What threw me originally was that the tests for task 4 were looking for assert_raise ArgumentError

zorn avatar Nov 09 '22 17:11 zorn