Closed hachi8833 closed 7 years ago
I haven't decided about this yet. ?
and !
is useful when people use it correctly, but this may also create more confusion when someone miss-use/forget to use them.
However, I don't know what the impact to Ruby developers would be if we don't implement this.
Yes, that's what I worry about a bit.
Looks like trailing ?
might be pretty good for developers to indicate the method returns boolean shortly, while the usage of trailing !
is widely inconsistent.
This might be a language design and coding-style matter. I'd just say that we should not determine this too early. Gimme some time.
I think trailing ?
methods might be a good idea which indicates methods which returns boolean
type (and definitely the convention in Ruby Lang). However, I think bang methods (trailing with !
) are not necessarily need to be implemented in Goby Lang.
Although bang methods does warn developer that it have side-effect, but there are too many case of side-effects which might have a great chance to be misused. For example, I have a bad time misusing ActiveRecord#save!
and ActiveRecord#save
in Rails. (Maybe it just me lacking Rails programming experience XD)
Implementing the trailing ?
first looks good.
We can decide adopting !
or not later.
Result: Already supported trailing ?
and not going to support !
.
I should've noticed that
String#include
I implemented yesterday has no?
because I couldn't do that on the current implementation.I imagine treating
?
and!
for method names like Ruby would make the parser more complicated.Thus I suppose treating
?
and!
is a future issue, or is to cut out from specification.