Repository navigation
twelve-days: add to track - #239
Conversation
|
Hi @FridaTveit! Thanks for your work implementing this exercise :) First off, let's get your branch passing the CI build. Click here to see the build logs. Near the top, I spot the following message: Our first clue! This suggests that you'll need to update (If you're wondering why you need to edit the |
|
The problems key can get removed... It is deprecated. All necessary information is in the exercises key, and afaik the problems key isn't even read anymore. When I'm back at my laptop I'll lookup the corresponding upstream issue. |
|
@FridaTveit this needs a merge with master now, but it shouldn't be too painful! |
| "slug": "twelve-days", | ||
| "difficulty": 1, | ||
| "topics": [] | ||
| } |
There was a problem hiding this comment.
Oops, indents in this file seem a little wonky; please see if you can tweak them to be consistent with the existing content!
There was a problem hiding this comment.
That's strange, it's not wonky when I open it...
There was a problem hiding this comment.
mixture of tabs and spaces?
There was a problem hiding this comment.
Thanks, that was it! :)
| String expectedVerseTwelve = "On the twelfth day of Christmas my true love gave to me, " + | ||
| "twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, " + | ||
| "eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " + | ||
| "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; |
There was a problem hiding this comment.
Hmm, is the final newline an intrinsic part of these verses? In my mind that's a verse separator, so I'd not necessarily expect it to be included when requesting an individual verse. I do think the double newline separators make sense when printing out more than one verse though. What do you think, @FridaTveit?
There was a problem hiding this comment.
I didn't have the newline there originally, but I changed it when I saw that the exercise in other languages had the newline at the end of every verse. I think it's because if you copy a line of the song from the description, you get the newline as well.
There was a problem hiding this comment.
Ah, that makes sense r.e. the description of the problem. Thanks!
| "On the twelfth day of Christmas my true love gave to me, twelve Drummers Drumming, " + | ||
| "eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, " + | ||
| "seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " + | ||
| "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; |
There was a problem hiding this comment.
It seems like a "gotcha" that this test string ends in a single newline, but the test string for testMultipleVerses ends in a double newline. I could imagine that this might confuse implementors a little bit! Do you think it would be possible to make them consistent (as above, I would lean towards no trailing newlines in either case, but I think consistency of some kind here is more important than the actual choice we make)?
There was a problem hiding this comment.
There's no double newline in this one, because there's no double newline at the end of the song in the description. Personally, I don't think the multiple verses should end in a double newline. However, in the implementation of twelve days in other languages the multiple verses end in a double newline. So I'm happy to change the multiple verses to end with a single newline if you're happy with my implementation not being exactly the same as in other languages. I wasn't sure how important it was to be consistent with other implementations...
There was a problem hiding this comment.
I would say; let's break with the other tracks here for the sake of consistency in our own track. I'll add a further note below in response to @jtigger's comments regarding cross-track checks :)
|
I can't help but comment on the quality of the intent and review, here. @FridaTveit, it's exactly things like looking at how the same exercise is implemented in other tracks that make for a cohesive experience on Exercism; excellent instincts. And @stkent, your attention to detail is something that pays dividends every time someone types The specific topics may seem like nitpicks at times, but these are the ingredients of the programmer's UX. We want the challenge of designing the solution to be the singular focus of practitioners; your focusing on getting all the other bits "right" is what makes that happen. Thank you, both! 🙏 |
|
@jtigger thank you for the kind words! I agree wholeheartedly that referencing implementations in other tracks as @FridaTveit did is a great way to seed our own implementations. However, I also like to look at them as inspiration and make sure I ask "can we do better?". In this particular instance, I think that double newline in the entire song is something the Java track can do better than other tracks (for the same reasons I originally stated); whether or not it's a big enough issue to submit upstream, I'm not sure.
|
|
Edit to the above: @FridaTveit this looks ready for merge as soon as the final trailing newline is chopped off the multiple verses output, so that both it and the entire song end in a single newline 🏆 |
|
Lovely, thanks! A great addition to the track; let's get this merged! |
@stkent, I couldn't agree more. |
No description provided.