Why does Racket put the operator first?
Every expression is (function arg1 arg2 …), including arithmetic. The parentheses make evaluation order explicit, so there is no precedence to memorise.
(+ 1 2) ; 3
(+ 2 (* 3 4)) ; 14
(* (+ 2 3) 4) ; 20In an infix language, knowing that 2 + 3 * 4 is 14 rather than 20 requires you to have memorised a precedence table. In Racket the structure is visible.
#Read inside out
Find the innermost complete parentheses, evaluate it, replace it with its value, repeat:
(+ 2 (* 3 4))
(+ 2 12)
14That is literally how Racket evaluates. Once you read this way, deep nesting stops being intimidating.
#Operators take any number of arguments
(+ 1 2 3 4 5) ; 15
(- 10 3 2) ; 5 — subtracts both, left to right
(max 4 8 15 16) ; 16An infix + is binary by definition. A prefix one is just a function, so it can take as many arguments as you like.
#Let the editor manage parentheses
DrRacket highlights matching pairs and re-indents on Tab. Press Tab constantly. Nobody counts brackets by hand — the indentation is what you read.
#The deeper reason
Because code has the same shape as data — both are lists — a Racket program can construct and transform other programs. That is what macros are, and it is why Racket is used to build languages. The uniform syntax is what makes it possible.