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

Added the mentoring.md file to Pig Latin exercise #2343

Closed
wants to merge 12 commits into from
Closed

Added the mentoring.md file to Pig Latin exercise #2343

wants to merge 12 commits into from

Conversation

thomasantony12
Copy link
Contributor

The mentoring.md file has been added to provide a comprehensive guide for mentors assisting students with the Pig Latin exercise. This document includes clear instructions, detailed explanations of the translation rules, step-by-step implementation guidance, and example code to ensure that mentors can effectively support students in understanding and solving the problem.

@github-actions github-actions bot added the track/python Python track label Jun 4, 2024
@IsaacG
Copy link
Member

IsaacG commented Jun 4, 2024

Mentoring notes should assume the mentor is familiar with the exercise already. The instructions should reside in the instructions, and not be duplicated in the mentoring notes. The mentoring notes should focus on common areas of improvement, not on how the exercise should be completed.

Copy link
Contributor Author

@thomasantony12 thomasantony12 left a comment

Choose a reason for hiding this comment

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

Changes are made. check it out.

## Common Areas of Improvement
When mentoring students on the Pig Latin exercise, it's essential to focus on common areas where they might struggle. Here are some key points to keep in mind:

1. Understanding the Rules Clearly
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't have anything to do wit Pig Latin. Mentoring typically occurs after the solution passes the tests. If the tests pass, presumably the solution is implemented correctly and all edge cases have been accounted for.

I would recommend mentoring this exercise a couple of times then reviewing some common themes that come up in the mentoring discussions. I wouldn't expect that mentors need to call out edge cases when the tests already enforce those.

- Rule Comprehension: Ensure that students fully understand each of the Pig Latin translation rules before diving into coding. Misunderstanding the rules often leads to incorrect implementations.
- Edge Cases: Highlight the importance of edge cases such as words starting with "xr" or "yt", and those containing "qu".
2. String Manipulation Skills
- Splitting and Joining Strings: Students should be comfortable using functions to split sentences into words and join words back into sentences.
Copy link
Member

Choose a reason for hiding this comment

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

If the solution passes tests, this is presumably not something that the mentor needs to bring up.

2. String Manipulation Skills
- Splitting and Joining Strings: Students should be comfortable using functions to split sentences into words and join words back into sentences.
- String Slicing: Emphasize the importance of correctly slicing strings to rearrange parts of the word as per the rules.
- Prefix Checking: Encourage using built-in string functions like starts with to simplify rule checks.
Copy link
Member

Choose a reason for hiding this comment

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

s/starts with/str.startswith()/

- String Slicing: Emphasize the importance of correctly slicing strings to rearrange parts of the word as per the rules.
- Prefix Checking: Encourage using built-in string functions like starts with to simplify rule checks.
3. Iterating Over Strings
- Looping Over Characters: Ensure students understand how to iterate over characters in a string, especially when finding the first vowel or handling specific patterns.
Copy link
Member

Choose a reason for hiding this comment

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

Regex solutions don't necessarily involve this. This sounds like a description of an implementation, not a common talking point.

- Prefix Checking: Encourage using built-in string functions like starts with to simplify rule checks.
3. Iterating Over Strings
- Looping Over Characters: Ensure students understand how to iterate over characters in a string, especially when finding the first vowel or handling specific patterns.
- Range-based Loops: Encourage using range-based loops or list comprehensions for readability and efficiency.
Copy link
Member

Choose a reason for hiding this comment

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

Range-based loops are generally not the best approach for most iteration.

3. Iterating Over Strings
- Looping Over Characters: Ensure students understand how to iterate over characters in a string, especially when finding the first vowel or handling specific patterns.
- Range-based Loops: Encourage using range-based loops or list comprehensions for readability and efficiency.
4. Condition Handling
Copy link
Member

Choose a reason for hiding this comment

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

Is there any specific examples in Pig Latin where this applies? The second point sounds pretty generic and not specific to this exercise.

4. Condition Handling
- Simplifying Conditions: Help students learn to simplify complex conditions using logical operators and short-circuit evaluation to make their code more readable.
- Avoiding Nested Conditions: Suggest breaking down nested conditions into simpler, well-named functions to improve clarity.
5. Code Readability and Maintenance
Copy link
Member

Choose a reason for hiding this comment

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

Pig Latin notes should provide Pig Latin advice, not generic code advice.


- Avoid complex, deeply nested logic.
- Reduce the number of special cases by generalizing logic. For instance, the first vowel in the word can potentially be handled the same, regardless of whether it is at the start of the word or not.
- Prefer if/else chains.
Copy link
Member

Choose a reason for hiding this comment

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

Prefer if/else chains over ...?

- Before: Using manual loops for operations that can be handled by built-in functions.
- Improvement: Introduce functions like split, join, starts with, and slicing techniques to simplify their code.

3. Comprehensive Testing:
Copy link
Member

Choose a reason for hiding this comment

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

Exercism provides the tests. Students are not expected to write tests.

Changed some grammatical mistakes
@github-actions github-actions bot added the type/mentor-notes Mentor notes label Jun 7, 2024
Update mentoring.md
@thomasantony12
Copy link
Contributor Author

Based on your suggestions, I have redone the file. check the changes and let me know if any other updates are needed. Thank you.

@@ -37,8 +37,8 @@ def is_armstrong_number(number):
# With a generator expression passed to sum
total = sum(digit ** count for digit in digits)
```
Students are often unaware of [generator expressions][pep-289] and that they can be passed directly to functions that accept iterables.
The first line uses a comprehension to build a `list` for `sum()` to iterate through.
Students are often unaware of [generator expressions][pep-289] and that they can be passed directly to functions that accept iteration.
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentionally part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry about that. I committed to the main branch. it was a mistake.

```
def translate(text):
return ' '.join([pig(word) for word in text.split(' ')])
def pig(word):
Copy link
Member

Choose a reason for hiding this comment

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

Functions should be separated by two blank lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay.

return pig(word[1:] + word[0])
```

Exercise solved using two `for` loops.
Copy link
Member

Choose a reason for hiding this comment

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

Generally mentoring notes have a single reasonable solution. Is there something significant about the second solution that warrants two solutions? The number of for statements isn't very descriptive of what's special about the second solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, I will remove the 2nd solution.

return word + "ay"
```

Prefer to use the first approach. Using multiple `for` loops in your code can sometimes lead to readability issues and inefficiencies. Remember that readability and maintainability are crucial.
Copy link
Member

Choose a reason for hiding this comment

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

Exercism markdown should have one sentence per line.

Mentoring notes shouldn't be telling mentors what solution students should use. There are a lot of approaches which are valid. There is no one correct approach.

Are there common talking points you've returned to when mentoring this exercise? That's what mentoring notes should contain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay.


2. Also students may unfamiliar with `set()`:

The `set()` function is a powerful data structure in Python.
Copy link
Member

Choose a reason for hiding this comment

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

Mentors should be familiar with set. There is no need to explain what set() is to mentors. This point says "consider set" but doesn't explain why set is useful here or how it helps solve this exercise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I will be adding that

@thomasantony12
Copy link
Contributor Author

I will create a new pull request for the changes I made. I am closing this PR because I accidentally added 2 other files which are not for this PR.

@thomasantony12 thomasantony12 closed this by deleting the head repository Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track/python Python track type/mentor-notes Mentor notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants