So we can talk here. The Go file is delivered as:
package reverse
func Reverse(input string) string {
panic("Please implement the Reverse function")
}
While what we get with Ruby for the same exercise is:
=begin
Write your code for the 'Reverse String' exercise in this file. Make the tests in
`reverse_string_test.rb` pass.
To get started with TDD, see the `README.md` file in your
`ruby/reverse-string` directory.
=end
Now that is easy to see.
Then I would see your suggestion of:
module Reverser
def self.reverse(word)
end
end
This is communicating way too much information, and infers that choices
were made. For example, why would use we use module here? Why would we
not have instead:
class Reverser
def self.reverse(collection)
new(collection).to_s
end
# Solve the exercise using the "given" method above, leaving it as is
end
In some ways, this is helpful, but it does bias the learner in ways that
may not be appropriate. If this is a practice exercise, why would we
care how they solve it?
In the learning side, there are things that we do want them to practice,
but then again, it is too easy to influence their solution, and even in
ways that is hard to predict.
Still, with out the code suggested, the learner does not need to write
any code at all to successfully run the tests and be told “Uninitialized
Reverser”, which is telling them the minimum thing that they really need
to do to move forward to solve this successfully.
It leaves their choice to reach for module Reverser
, or
class Reverser
or even something else.
I would not want to unduly influence their choices, or seemingly dictate
solutions.
Other tracks are different than Ruby. For example, Go has a very much
"Do not worry about communication through style, our go_fmt
tool will
communicate that for you, and take your personal subtle communication
out of the picture as much as we can.
C and some other languages very much benefit from having scaffolding
provided for you, at least for the first few exercises, so that you see
what that looks like, and then after that it is up to you to provide the
needed.
You showed your suggested improvement, it removes the comments.
Are the comments a problem?
Why are they gone?