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

Update api.lua #403

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

Update api.lua #403

wants to merge 2 commits into from

Conversation

IAmMythoRED
Copy link
Contributor

Added GetUser(userid or username) and GetUserName Functions which can be added into the player module later on if needed...

Added GetUser(userid or username) and GetUserName Functions which can be added into the player module later on if needed...
@IAmMythoRED IAmMythoRED marked this pull request as draft January 1, 2024 14:36
@IAmMythoRED IAmMythoRED marked this pull request as ready for review January 1, 2024 14:36
Copy link
Collaborator

@gdevillele gdevillele left a comment

Choose a reason for hiding this comment

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

thank you for your contribution!

I understand how this can be useful, but the complex inter-dependence between getUser, getUserId and getUserName is not pretty, and will make this code difficult to evolve and maintain.
I'd like to help make things simpler.

  • Can we agree that getUser should not depend on any other function?
  • getUserId and getUserName could simply be "easy-to-use functions", that would use getUser internally.

This would make the code easy to read and understand for a new-comer and also easier to maintain, as the whole logic would be in a single function (getUser).

Let me know what you think of this :)

@IAmMythoRED
Copy link
Contributor Author

So simplifying the code by having getUser as the main function, with getUserId and getUserName as easy-to-use helper functions right? Sounds like a good approach

@gdevillele
Copy link
Collaborator

So simplifying the code by having getUser as the main function, with getUserId and getUserName as easy-to-use helper functions right? Sounds like a good approach

@IAmMythoRED correct. I think it would be acceptable :)

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