Closed kytrinyx closed 2 years ago
o-ho, sorry I thought I had replied this. After having looked at the exercise description and JSON data, I think there are two approaches for this exercise
meetup
returns an object of time date
. In this case the test could be something like
test.assertEqual(meetup(2013, 8, "teenth", "Monday"), new date(2013, 8, 19));
have meetup
return a string. In which case the test would be
test.assertEqual(meetup(2013, 8, "teenth", "Monday"), "2013-8-19");
I don't have an opinion on which one is better. The first case is more explicit and automatically guides the student to use the Time
module, which has useful out-of-the-box functionalities to solve the problem.
The second method is less explicit. using Time
is probably still the best idea, but in principle the student is free to implement everything themselves. The extra step date -> string
is fairly trivial so it does not increase complexity itself.
Since this is a medium/hard exercise, how would you feel about going with option two? We can have as hint to check out the Time
module. Once we have concepts we could link both this and ´gigasecondto the
datetime` concept and have gigasecond as prerequisite.
I think I would prefer to use the Time
option, in the sense that reaching for a time object when dealing with datetimes is what I feel like people should do, and so the obfuscation (if one can say that) of comparing against a string seems like it's not helping use the language in an idiomatic way, if that makes sense.
I need to double-check the bit about prerequisites. I think only concept exercises are meant to be prerequisites for practice exercises (but could be wrong; we've changed how all the pieces fit together over the years).
sorry I forgot to answer (again). I think it makes sense, let's go with the explicit Time
module. Do you have all pieces to generate the stub?
I think only concept exercises are meant to be prerequisites for practice exercises
This is also my understanding, but I don't think we need to worry about this, we can add in instructions.append.md
a note as did in the other exercises
Do you have all pieces to generate the stub?
I think I have what I need. I'll generate it, and if something looks off, holler and I can tweak and regenerate.
fixed in #50
Here is a sample entry in the canonical data for the
meetup
problem.The corresponding test for this data in Ruby is:
In C# it's like this:
The exercise doesn't mandate any particular implementation. What would the test look like in Chapel if the solution is idiomatic?
If I have an idea what it needs to look like I can generate the exercise stub.