Skip to content
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

[go/nucleotide-count] add mentoring notes #2315

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bernot-dev
Copy link
Contributor

Add mentoring notes for Nucleotide Count exercise.

@github-actions github-actions bot added track/go Go track type/mentor-notes Mentor notes labels Jan 20, 2024
@bernot-dev
Copy link
Contributor Author

@IsaacG PTAL

Copy link
Member

@IsaacG IsaacG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought language tags needed to be all lowercase to work. Is that incorrect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it's titlecase in the language file GitHub points to. Or maybe it's not case sensitive?

tracks/go/exercises/nucleotide-count/mentoring.md Outdated Show resolved Hide resolved
}
```

### Common Suggestions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{...}`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the Histogram

When your define a Histogram type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One sentence per line please. Even in lists.

@SleeplessByte SleeplessByte changed the title add mentoring notes for go/nucleotide-count [go/nucleotide-count] add mentoring notes Feb 16, 2024
@SleeplessByte
Copy link
Member

@IsaacG can you give this a second look after the changes?
@exercism/go maybe you want to give your opinion as well?

@IsaacG
Copy link
Member

IsaacG commented Feb 16, 2024

  1. This still has multiple sentences per line which needs correcting.
  2. A Go maintainer should look at this before it is merged. I'm not a Go maintainer.
  3. This mostly looks like showcasing and walking through an example, not so much discussion points for mentors to raise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track/go Go track type/mentor-notes Mentor notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants