Replies: 4 comments 1 reply
-
Another potential "pro" for this is you can easily find functions that return boolean in your code — you just type This is also looks more compact to write A con maybe is some people can confuse it and something |
Beta Was this translation helpful? Give feedback.
-
This would conflict with a nullable type hint syntax that may be added in the future (such as |
Beta Was this translation helpful? Give feedback.
-
This would conflict with the most common syntax languages use for short-circuiting null checks, preventing gdscript from adopting it in the future, e.g.
(Rust uses similar syntax for coalescing error types.) In general, identifiers should allow the fewest number of lower ascii characters possible, to leave the door open for future syntax changes without breaking compatibility. If you want something like a question mark in a variable name, the ideal would be to pull a question mark from upper unicode and use that instead, and insist that identifiers allow printable upper unicode characters in them. |
Beta Was this translation helpful? Give feedback.
-
I would have no issue with calling a method |
Beta Was this translation helpful? Give feedback.
-
For example Ruby has this feature
https://ruby-doc.org/core-2.7.0/Array.html#method-i-all-3F
That is this can be used in functions that return bool.
Now GDScript codestyle suggests using
is_
..but I can see the problem with
is
— this is a English grammar sensitive wordI mean if we name the function like
is_all_methods_called()
, shouldn't it be named likeare_all_methods_called()
?Beta Was this translation helpful? Give feedback.
All reactions