The difference is a space after the method name, not a way to structure your if-else.
fac (x-1) * x
parsed as fac((x-1) * x)
. Basically, if the name of the method is followed by a space (or any token that is not an opening bracket), ruby ββassumes that you are calling the method without parentheses. Therefore, it interprets the parentheses around x-1
as a grouping, and not part of the syntax of a method call.
source share