Open rbwhitaker opened 2 years ago
The Replicator of D'To challenge will be updated to just use Array.Copy
. I think that is a useful exercise.
I'm still leaning toward keeping the Laws of Freach but maybe still just changing the code to be something that isn't already built in.
I think the challenges that deal with arrays deserve some tweaks. Here are my thoughts on what's there and what maybe needs to be there.
The Replicator of D'To. This one I've never loved, and people have often struggled with it. It isn't the most obvious. That could maybe be fixed by some revision to the description, but I'm just not in love with it, and maybe it deserves significant changes. One of the big complaints I have about this challenge is that there is an
Array.Copy
method that just does this. Up through 5th Edition, I've just conveniently ignored theArray
class, but I don't plan to ignore it in future editions. WithArray.Copy
making an appearance, I think it makes this challenge obsolete.The Laws of Freach. I like the idea of taking
for
-loop code and asking people to rework it into aforeach
loop. I've always liked that part of this challenge. But the code samples this has you rework probably need to be changed, with the addition of theArray
class, sinceMax
andAverage
are (I believe) both methods (or extension methods) of arrays. I think this is conceptually sound, but I think it needs to use different examples in the future. And that probably means changing the samples in the chapter.I also think that this is one of several areas in the book whose first real exposure in code demands dealing with user input as well. That has caused a lot of problems for readers. I think there might be room here for another challenge before these other two that just simply make an array and do something fairly direct with them, like assign specific values to them with zero user input.
660 is related.