How does this make it confusing? What information do you feel () gives you?
You might say:
foo().bar().baz()
Ah well these are clearly method calls, they have ().
But this is Ruby:
foo.bar.baz
These are clearly method calls too, because in Ruby there’s nothing else they could possibly be. The ()s don’t actually disambiguate anything. Unlike C or Java or some other languages with some notion of bare access to internal fields, there are always and only method calls.
You might say:
Ah well these are clearly method calls, they have ().But this is Ruby:
These are clearly method calls too, because in Ruby there’s nothing else they could possibly be. The ()s don’t actually disambiguate anything. Unlike C or Java or some other languages with some notion of bare access to internal fields, there are always and only method calls.