This is a common naming pattern in Ruby, used to designate
Bool values. This would make prepending
is to function names unnecessary.
Thus, functions like
isempty would become
empty? which would pair nicely with existing
x |> empty? && do_stuff() would be very nice. But I find that
empty?(x) affects readability.
A significant difference from Ruby is that parentheses around arguments in Ruby are optional. And the guidelines recommend that they are not added to methods that take 0 arguments, both when defining and when invoking the methods.
But Ruby is strongly OOP focused, so code looks like
But since Julia leans towards a FP syntax, we’d end up with
Bottom line, OOP dot invocation of 0 argument methods returning
booleans looks great with
?. For FP it hinders readability.
However, if Julia would fully implement the pipe operator to be usable everywhere (by supporting piping to methods taking multiple arguments) then methods ending in
? could promote writing beautiful piped code.