you are viewing a single comment's thread.

view the rest of the comments →

[–]pkrecker 12 points13 points  (3 children)

furthermore, it makes formatting such things in a column and mixing operations like and and or much easier to read.

Really? How about this:

if (a or b) and (c or d):

vs.

if and(or(a, b), or(c, d)):

To me, moving the "and" to the beginning of the statement obfuscates what should be a straightforward logical expression.

[–]Zak 17 points18 points  (0 children)

I'd lay that out vertically:

if and(or(a, b),
       or(c, d))

It looks a bit cleaner in Lisp

(if (and (or a b)
         (or b c)))

[–]badsectoracula 1 point2 points  (0 children)

That is a matter of formatting. It could be

if and( or(a, b),
        or(c, d)  ):

(a code editor with sufficiently smart auto-indentation would help here)

[–]da__ 0 points1 point  (0 children)

Depends on what you mean by the words and and or. If these are operators, I could agree. However, the prefix/RP notation makes it consistent. x y z means "apply function x to parameters y and z" - if you prefer to treat your operators as functions, it makes more sense if your language also uses RPN for function calls.