8000 Javadoc by Yuri69420 · Pull Request #7531 · libgdx/libgdx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Javadoc #7531

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 43 commits into
base: master
Choose a base branch
from
Open

Javadoc #7531

wants to merge 43 commits into from

Conversation

Yuri69420
10000 Copy link

Pull request of javadocs I have added

Copy link
Contributor
@Frosty-J Frosty-J left a comment

Choose a reason for hiding this comment

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

Sometimes, less is more. Especially in tests, where the reader should already be familiar with the application lifecycle. Some of this is already documented...

@Yuri69420
Copy link
Author

I have added these to help our teacher what's happening, because we asked for t 10000 heir help and they were just lost. So I understand that less might be better but I believe that it is a bit more clearer with such comments.

Copy link
Contributor
@Berstanio Berstanio left a comment

Choose a reason for hiding this comment

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

I think some of the javadoc additions are fine, also the override annotations.

However, javadoc on override methods is in my opinion counter-productive. If there is something special to note, it should be noted in the interface.

There are also a lot of inline comments that I would consider unnecessary

public abstract class AbstractGraphics implements Graphics {

/** Delegates to {@link #getDeltaTime()} for the actual time calculation.
Copy link
Contributor

Choose a reason for hiding this comment

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

If a method already has javadocs on the super method, it doesn't need new javadocs.

root.align(Align.left | Align.top);
stage.addActor(root);
root.setFillParent(true); // Make the table fill the entire stage
root.align(Align.left | Align.top); // Align the table's contents to the top-left
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a lot of comments like this, where the code is 100% self explanatory.

Deletion of javadoc because super method already does
Copy link
Member
@tommyettinger tommyettinger left a comment

Choose a reason for hiding this comment

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

Sorry to be blunt, but I don't like this at all. There's a lot of important things that are undocumented here, and a lot of unimportant things that are vaguely documented. Tests don't need docs, at all, unless they are part of a public API or you need to tell something to the reader. If the reader needs to know something in a test, they are probably reading the source.

I don't think your teacher will learn anything new about libGDX via these comments. I'm beginning to wonder if I could teach a libGDX class, given that I lack even a Bachelor's degree, but maybe know some things already... Not like a generic Bachelor's degree actually indicates much for job skills. Some might!

public void clear () {
processors.clear();
}

/** Empty the list of processors and implement a new list of processors
Copy link
Member

Choose a reason for hiding this comment

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

OK... this would be a big review.

This line isn't even right. Like, the only part that's correct is that it empties the... well, not a list... of processors. And like the rest of the PR, there's no benefit to @param processors, we can see that immediately already. It might help to know it takes 0 or more InputProcessor items as varargs or in an array! Just knowing its name doesn't tell me that.

public void addProcessor (InputProcessor processor) {
if (processor == null) throw new NullPointerException("processor cannot be null");
processors.add(processor);
}

/** Remove a processor from the list of processors
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to know it's removed by identity, not by value.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think any of the tests need JavaDocs. They aren't exposed to users to call... Who would be reading them? Why wouldn't they be reading the source?

23D3 Copy link
Author

Choose a reason for hiding this comment

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

I feel it's much easier to read the code and understand it with comments and javadocs instead of looking for the source

@Frosty-J
Copy link
Contributor

I expect Tommy will still be caught up on the "list" wording for the InputProcessors and Berstanio on documenting overrides (anyone viewing tests should know what ApplicationListener#resize is... if they don't, it is easy to find out with any decent IDE).

I'm still not a fan of some of the wording. "This test uses libGDX"... well duh. "false else" is a strange order, probably best rewrite the whole comment.

@Frosty-J
Copy link
Contributor

It would be best to leave code changes out of this pull request, but I wouldn't mind the following minor changes to DragNDropTest (as much as it's low-priority to do anything about, and the sort of thing that would've been faster for me to change myself than write this comment):

  • BufferedImage image is unused. I'm not sure what its intended purpose was. It can probably be removed.
  • Align.left | Align.top can be simplified to Align.topLeft. It's not the only instance of this in the tests, e.g. SoundTest used Align.center | Align.top.
  • Personal opinion: ScreenUtils.clear(1, 0, 0, 1) is horrible on the eyes. I would prefer something more neutral such as ScreenUtils.clear(Color.GRAY).
  • Contrary to what this pull request's Javadocs suggest, the resize, resume, pause, and dispose events do not need to be implemented. They can be safely removed as we're not implementsing anything.
  • Although, it could be nice to implement ScreenViewport or some other solution for when filepaths are too long to fit in 640px.
  • "GLWF Drop" has a typo.

Align.left | Align.top can be simplified to Align.topLeft. 
ScreenUtils.clear(1, 0, 0, 1) is horrible on the eyes. I would prefer something more neutral such as ScreenUtils.clear(Color.GRAY).
@Yuri69420 Yuri69420 requested a review from Frosty-J December 4, 2024 13:13
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.

7 participants
0