Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve Example documentation. #610

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
firetrqck wants to merge 9 commits into HypixelDev:master
base: master
Choose a base branch
Loading
from firetrqck:better-comment-examples

Conversation

@firetrqck
Copy link

@firetrqck firetrqck commented Aug 7, 2023

I felt the urge to make the comments more concise, and in some cases more specific 😅

Copy link

@Picsou993 Picsou993 left a comment

Choose a reason for hiding this comment

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

Original messages are already accurate and concise information. It's also not needed to be restrictive in the comment when the restriction is not something done in the code.

/*
* We'll be fetching the guild's stats using its ID for this example, but guilds can
* also be looked up using their name, or one of their members' Minecraft UUIDs.
* also be looked up by their name, or one of their member's Minecraft UUIDs.
Copy link

@Picsou993 Picsou993 Aug 8, 2023

Choose a reason for hiding this comment

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

Original message is correct.

Copy link
Author

@firetrqck firetrqck Aug 8, 2023

Choose a reason for hiding this comment

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

They have the same meaning but the edit is more grammatically correct and imo roles off the tongue easier.

Copy link

@jerryxfu jerryxfu Aug 8, 2023

Choose a reason for hiding this comment

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

The correct way to say it is, I believe, to drop the comma after "name" and use members' instead of member's

We'll be fetching the guild's stats by its ID for this example, but guilds can
also be looked up using their name or one of their members' Minecraft UUIDs.

Copy link
Contributor

@TheNullicorn TheNullicorn Aug 8, 2023

Choose a reason for hiding this comment

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

"members" should definitely be plural, since the alternative would be "one of their member". As for "members'" vs "members's", I think it's just a matter of style, but the former is normally preferred (Firefox's spellcheck highlights the latter, if that counts for anything).

Copy link
Author

@firetrqck firetrqck Aug 8, 2023

Choose a reason for hiding this comment

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

fixed

Comment on lines 130 to 131
* This might print out upto 125 seperate usernames, so you may want to comment the following line out if you're
* focusing on other info.
Copy link

@Picsou993 Picsou993 Aug 8, 2023

Choose a reason for hiding this comment

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

This 125 members limitation is only an in-game limitation, the endpoint could technically returns more members if there was more players in the guild.

Copy link
Author

@firetrqck firetrqck Aug 8, 2023
edited
Loading

Choose a reason for hiding this comment

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

is this better in reflected with cefffd2?

*
* We call `.get()` at the end so that we can use the reply in the same thread.
* The downside is that the current thread freezes (or "blocks") until the API responds.
* The downside is that this is synchronous operation.
Copy link

@Picsou993 Picsou993 Aug 8, 2023

Choose a reason for hiding this comment

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

Original message should be kept as we are here losing the fact that the performances are dependant of the API response time.

Copy link
Author

@firetrqck firetrqck Aug 8, 2023

Choose a reason for hiding this comment

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

The current thread being blocked until something happening (in this case the API responding) is the definition of synchronous operation(which dependent the time the API takes to respond is how long the thread takes to be unblocked hence the performance being dependent on api response time)

Copy link
Contributor

@TheNullicorn TheNullicorn Aug 8, 2023

Choose a reason for hiding this comment

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

The Hypixel API is very accessible, so it often attracts a lot of new developers, which I catered these examples toward. From a newbie's perspective, I worry that "synchronous" might send them down a rabbit hole that makes their learning curve feel a lot steeper. Words like "blocks" and "thread" are there so that those who understand those concepts get the gist.

125 is a in game limit on how many people can join a guild in hypixel, the endpoint can theoretically return infinite.
@firetrqck firetrqck changed the title (削除) Better comment API usage examples (削除ここまで) (追記) Improve Example documentation. (追記ここまで) Aug 8, 2023
Copy link
Author

firetrqck commented Aug 8, 2023
edited
Loading

I also added a bit to the README..

Information includes pet rarity, rarity colors, wheter a player posses that pet, and more!
- An example of getting player information can be found in [GetPlayerExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPlayerExample.java)

Information includes their: UUID, network level(exact), rank, mc version, and more!
Copy link

@jerryxfu jerryxfu Aug 8, 2023

Choose a reason for hiding this comment

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

Response data include the player's UUID, network level, rank, client version [<- confirm that], and more!

Copy link
Author

@firetrqck firetrqck Aug 8, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor

@TheNullicorn TheNullicorn left a comment

Choose a reason for hiding this comment

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

Hey! I wrote GetGuildExample, so I left some clarification in the conversations for this PR.

*
* We call `.get()` at the end so that we can use the reply in the same thread.
* The downside is that the current thread freezes (or "blocks") until the API responds.
* The downside is that this is synchronous operation.
Copy link
Contributor

@TheNullicorn TheNullicorn Aug 8, 2023

Choose a reason for hiding this comment

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

The Hypixel API is very accessible, so it often attracts a lot of new developers, which I catered these examples toward. From a newbie's perspective, I worry that "synchronous" might send them down a rabbit hole that makes their learning curve feel a lot steeper. Words like "blocks" and "thread" are there so that those who understand those concepts get the gist.

/*
* We'll be fetching the guild's stats using its ID for this example, but guilds can
* also be looked up using their name, or one of their members' Minecraft UUIDs.
* also be looked up by their name, or one of their member's Minecraft UUIDs.
Copy link
Contributor

@TheNullicorn TheNullicorn Aug 8, 2023

Choose a reason for hiding this comment

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

"members" should definitely be plural, since the alternative would be "one of their member". As for "members'" vs "members's", I think it's just a matter of style, but the former is normally preferred (Firefox's spellcheck highlights the latter, if that counts for anything).

Copy link
Author

@TheNullicorn as to "members' " vs "members's", I was unaware of the 1st being a convention, and so corrected it and addressed synchronous vs thread blocking in d4f220d, is this language better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

4 more reviewers

@TheNullicorn TheNullicorn TheNullicorn left review comments

@Picsou993 Picsou993 Picsou993 requested changes

@jerryxfu jerryxfu jerryxfu requested changes

@John-Fries-J John-Fries-J John-Fries-J approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /