Skip to content

no significant changes to the code, I was just experimenting with the Git #1091

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VirdVissy
Copy link

Review the Contributing Guidelines

Before submitting a pull request, verify it meets all requirements in the Contributing Guidelines.

Translations

See the Contributing Guidelines. Verify you've:

  • Tagged the language maintainer
  • Prefixed the title with a language code
    • Example: "ja: Fix ..."

@VirdVissy VirdVissy changed the title no changes to the code, I was js experimenting with the Git no significant changes to the code, I was just experimenting with the Git Jun 14, 2025
Copy link

@dcq01 dcq01 left a comment

Choose a reason for hiding this comment

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

Hi! I'm a grad student working on a research project about using large language models to automate code review. Based on your commit 4a88a17 and the changes in solutions/system_design/social_graph/social_graph_snippets.py, my tool generated this comment:

  1. Check for Valid Friend IDs: In the bfs method, add a check to ensure that friend_id is not None or an empty string before attempting to retrieve the Person object.
  2. Visited IDs Management: Ensure that the initial source is added to visited_ids only after confirming that it is a valid Person object.
  3. Error Handling: Implement try-except blocks in the bfs method to handle unexpected exceptions that may arise during execution.
  4. Testing for BFS Functionality: Create unit tests that cover various scenarios for the bfs method to ensure it correctly identifies whether a path exists between two Person objects based on their friend relationships.
  5. Method Annotations: Add type hints for the bfs method parameters in UserGraphService to improve code readability and maintainability:
  6. def bfs(self, source_id: int, dest_id: int) -> bool:
  7. Logging Instead of Print: Replace print(current_person) with proper logging statements in production code for better control over logging levels and outputs.
  8. Friend IDs Handling: Consider using a set for friend_ids in the Person class if it is not already a set to improve lookup time for checking if a friend has been visited.
  9. Avoid Repeated Lookups: In the bfs method, avoid repeated calls to self.lookup.get_person(friend_id) by storing the result in a variable and checking if it is None before appending it to the queue.
  10. Docstrings: Add docstrings to the classes and methods to describe their purpose, parameters, and return values.

As part of my research, I'm trying to understand how useful these comments are in real-world development. If you have a moment, I'd be super grateful if you could quickly reply to these two yes/no questions:

  1. Does this comment provide suggestions from a dimension you hadn’t considered?
  2. Do you find this comment helpful?

Thanks a lot for your time and feedback! And sorry again if this message is a bother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants