Skip to content

Create Simple_Counter_App.py #1016

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

Mustafa-Hassan2001
Copy link

No description provided.

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 e8db7c0 and the changes in Simple_Counter_App.py, my tool generated this comment:

  1. Add error handling around the date parsing to manage potential ValueError exceptions:
  2. try:
  3.    deadline_date = datetime.datetime.strptime(deadline.strip(), "%d.%m.%Y")
    
  4. except ValueError:
  5.    print("Please enter the deadline in the format dd.mm.yyyy")
    
  6.    exit()
    
  7. Check if time_till is negative and handle it appropriately:
  8. if time_till.total_seconds() < 0:
  9.    print(f"The deadline for your goal: {goal} has already passed.")
    
  10. Add a check to ensure that user_input is not empty and contains a colon:
  11. if not user_input or ':' not in user_input:
  12.    print("Invalid input. Please enter your goal with a deadline separated by a colon.")
    
  13.    return
    
  14. Uncomment the line that assigns goal from input_list to ensure it is defined before use:
  15. goal = input_list[0]
  16. Modify the input handling to capture both the goal and the deadline:
  17. goal = input_list[0]
  18. deadline = input_list[1]
  19. Consider directly assigning goal and deadline from the split operation to reduce redundancy:
  20. goal, deadline = user_input.split(":")
  21. Rename time_till to time_remaining_until_deadline for better clarity.
  22. Rename hours_till to hours_until_deadline for consistency.
  23. Correct the typo "remanning" in the print statement to "remaining":
  24. print(f"Dear User! Time remaining for your goal: {goal} is {hours_till} hours")
  25. Optimize the calculation of hours_till by using:
  26. ```python
    
  27. hours_till = time_till.total_seconds() / 3600
    
  28. ```
    

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?
    1. Do you find this comment helpful?

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

@FangyuanXu
Copy link

FangyuanXu commented Jun 25, 2025 via email

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.

3 participants