[go/nucleotide-count] add mentoring notes#2315
[go/nucleotide-count] add mentoring notes#2315bernot-dev wants to merge 2 commits intoexercism:mainfrom
Conversation
|
@IsaacG PTAL |
IsaacG
left a comment
There was a problem hiding this comment.
Note I'm not a Go track maintainer
| Using a map is probably the most idiomatic solution to this problem, especially since the Histogram type basically must be a map. Using a switch is about 4 times faster over the provided test cases because it does not require hashing. | ||
|
|
||
| #### Map Example | ||
| ```Go |
There was a problem hiding this comment.
I thought language tags needed to be all lowercase to work. Is that incorrect?
There was a problem hiding this comment.
It looks like it's titlecase in the language file GitHub points to. Or maybe it's not case sensitive?
| } | ||
| ``` | ||
|
|
||
| ### Common Suggestions |
There was a problem hiding this comment.
I think the parser needs a newline after headers. At least I believe that's the convention in other markdown files.
| ``` | ||
|
|
||
| ### Common Suggestions | ||
| - When you have a type definition for the Histogram, you can use it like the underlying type. For instance, you can `make(Histogram, 4)` or instantiate a literal `Histogram{...}`. |
There was a problem hiding this comment.
for the Histogram
When your define a Histogram type?
There was a problem hiding this comment.
I was trying to be consistent with the specific language of Type Definitions, but that probably doesn't matter as much as it seemed like it might at the time I wrote that.
| ### Common Suggestions | ||
| - When you have a type definition for the Histogram, you can use it like the underlying type. For instance, you can `make(Histogram, 4)` or instantiate a literal `Histogram{...}`. | ||
| - If you know exactly how many elements will be in a map, it makes sense to set the capacity. | ||
| - Using numeric literals (e.g. `65` for A) throughout the code to represent letters is **not** reasonable. Instead, use rune literals (e.g. `'A'`), rune literals cast to bytes (e.g. `byte('A')`), or define constants (e.g. `const A = byte('A')`). All of these can be handled at compile time and will not impact runtime performance. |
There was a problem hiding this comment.
One sentence per line please. Even in lists.
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
|
@IsaacG can you give this a second look after the changes? |
|
Add mentoring notes for Nucleotide Count exercise.