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

casecmp_to Godot API doc not clear #4096

Closed
CitrusWire opened this issue Sep 30, 2020 · 3 comments · Fixed by godotengine/godot#42434
Closed

casecmp_to Godot API doc not clear #4096

CitrusWire opened this issue Sep 30, 2020 · 3 comments · Fixed by godotengine/godot#42434
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@CitrusWire
Copy link

Your Godot version:
n/a

Issue description:

int casecmp_to ( String to )

Performs a case-sensitive comparison to another string. Returns -1 if less than, +1 if greater than, or 0 if equal.

This makes no sense (I'm assuming it's a Computer Science thing for sorting). How is a string comparison going to return "greater" and "less than"? In every other language I've used, when you do a string comparison the results are either pass or fail.

URL to the documentation page:
https://docs.godotengine.org/en/latest/classes/class_string.html

@CitrusWire CitrusWire added the bug label Sep 30, 2020
@Calinou Calinou added enhancement and removed bug labels Sep 30, 2020
@Calinou
Copy link
Member

Calinou commented Sep 30, 2020

In every other language I've used, when you do a string comparison the results are either pass or fail.

Use the == operator for that 🙂

@CitrusWire
Copy link
Author

@Calinou - Maybe, but that's not what this doc suggests.

I opened it as a bug because the purpose of documentation is to clearly explain something to a user. If the current doc is confusing a user then it's faulty == bug. :-)

@Calinou
Copy link
Member

Calinou commented Sep 30, 2020

If the current doc is confusing a user then it's faulty == bug. :-)

We only use the bug label for incorrect or outdated information, not missing information. Here, the documentation isn't stating anything incorrect; it's just vague.

It would be nice if we could add an "open source code" button next to each method so advanced users can fill in the gaps themselves, but doing so using GitHub search is difficult.

@Calinou Calinou added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Sep 30, 2020
Calinou added a commit to Calinou/godot that referenced this issue Sep 30, 2020
akien-mga pushed a commit to akien-mga/godot that referenced this issue Oct 1, 2020
MarcusElg pushed a commit to MarcusElg/godot that referenced this issue Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants