We’re rewarding the question askers & reputations are being recalculated! Read more.
2 deleted 23 characters in body
source | link

Indeed, Scala allows this, though there is a convention that is followed: if the method has side-effects, parentheses should be used anyway.

As a compiler writer, I would find the guaranteed presence of parentheses quite convenient; I would always know that is a method call, and I wouldn't have to build in a bifurcation for the odd case.

As a programmer and code reader, the presence of parentheses leaves no doubt that it is a method call, even though no parameters are passed.

WhyThe passing of parameters is not the sole defining characteristic of a method call. Why would I treat a parameter-less method any different from a method that has parameters? To put it another way, the passing of parameters is not the sole defining characteristic of a method call.

Indeed, Scala allows this, though there is a convention that is followed: if the method has side-effects, parentheses should be used anyway.

As a compiler writer, I would find the guaranteed presence of parentheses quite convenient; I would always know that is a method call, and I wouldn't have to build in a bifurcation for the odd case.

As a programmer and code reader, the presence of parentheses leaves no doubt that it is a method call, even though no parameters are passed.

Why would I treat a parameter-less method any different from a method that has parameters? To put it another way, the passing of parameters is not the sole defining characteristic of a method call.

Indeed, Scala allows this, though there is a convention that is followed: if the method has side-effects, parentheses should be used anyway.

As a compiler writer, I would find the guaranteed presence of parentheses quite convenient; I would always know that is a method call, and I wouldn't have to build in a bifurcation for the odd case.

As a programmer and code reader, the presence of parentheses leaves no doubt that it is a method call, even though no parameters are passed.

The passing of parameters is not the sole defining characteristic of a method call. Why would I treat a parameter-less method any different from a method that has parameters?

1
source | link

Indeed, Scala allows this, though there is a convention that is followed: if the method has side-effects, parentheses should be used anyway.

As a compiler writer, I would find the guaranteed presence of parentheses quite convenient; I would always know that is a method call, and I wouldn't have to build in a bifurcation for the odd case.

As a programmer and code reader, the presence of parentheses leaves no doubt that it is a method call, even though no parameters are passed.

Why would I treat a parameter-less method any different from a method that has parameters? To put it another way, the passing of parameters is not the sole defining characteristic of a method call.