-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nucleotide-count: poorly described and forces implementation #842
Comments
This should definitely be better documented in the README. I agree, this is not a complex exercise. Currently it appears quite far along in the exercise evolution, and I can understand why the exercise could prove disappointing. In the Exercism reboot it appears much earlier, being unlocked by the third exercise. As an exercise for someone newer to Go I think, with better documentation, it is suitable as-is. If it were to appear later in the track, we could look into changing type Histogram struct {
A, C, G, T int
} This might free up the possibilities for implementation, and perhaps even provide a basis for exploring concurrency, which is something we need more exercises to do. Thanks @shaleh for highlighting this. Your audit as you go through the track is really helpful. 😃 |
There is value in highlighting where Go may not be a great fit? You would not want to do this in C either, but may be value in trying it in C and then Perl just to see why. I'm still uncomfortable using Go for JSON manipulation or any sort of string ops because it can be done faster (for me) in other languages. That being said we have a whole bunch of similar exercises that are basic string munging and/or character mapping. One of the changes in Excercism v2 (nextercism) is that users will no longer be forced into completing the same exercise over and over under slightly different circumstances. Instead we will have a core group of exercises unlocking other exercises that are not necessary for moving forward in the track (#835). Hopefully this will limit a sort of boredom of repetitive exercises. Contribution to #830 is a good way to keep track of the redundancies so we can keep them out of the core track. @shaleh your feedback there and like (@robphoenix said) auditing the exercises are fantastically helpful thanks! |
With one small change to the tests the developer is freed to come up with different internals.
Right now,
Poof. Suddenly the developer can cache results, use a smaller data structure, etc. Since this came later in the series I (incorrectly) assumed that we were expected to write something a little more interesting. I had actually coded this:
This demonstrates the advantage of Go or C over Python and Ruby. This code will be a good deal faster and use significantly less memory plus have the data stored in a way to utilize localization and caches instead of spread out in a linked list. If I know the counts will be under 2^16 I could even store the counts in a single I agree more go routines would be great in the exercises. This is not one of them. The fastest way to get the counts is to walk the list once, filling a data structure. Walking that list 4 times in 4 threads is not going to help. |
This was already addressed in instructions.append.md and in the stub file. |
This is all the README says about the interface:
Running the tests we discover we have to create a
DNA
and aHistogram
.DNA
has to haveCount
andCounts
both of which can error.But the test is really exact in what it wants.
DNA
has to be a type synonym forstring
.Histogram
is expected to be a synonym for a map. This means the developer cannot make any stab at efficiency. This is just define a map, loop over the string, stuff the map, return. Blah and ho-hum. The whole thing ends up being a bunch of Go boiler plate for what is essentially perl/ruby/python stuff a hash code.The text was updated successfully, but these errors were encountered: