Coding Style. Using Operator vs Function Call

By Xah Lee. Date: . Last updated: .

Operators and Syntactic Shortcuts vs Function Call

but now i prefer full function names. even sometimes prefer

Because,

(* lots operators *)
Graphics3D[
 Replace[Map[(Tube /@ Subsets[Tuples@Transpose@{#, # + 1}, {2}] &),
   CoordinateBoundsArray@Table[{0, 3}, 3], {-2}],
  v_List :> ((With[{xx = # . #}, If[xx < 0.00001, #, #/xx]]) &)@
    v, {-2}], ViewVector -> {-.5, -.2, -1}]
(* less operators, more function call syntax *)
Graphics3D[
 Replace[Map[
Function[x,
Map[ Tube, Subsets[Tuples[Transpose[{x, x + 1}]], {2}]]
 ] ,
   CoordinateBoundsArray[Table[{0, 3}, 3]], {-2}],
  v_List :>
Function[x, (With[{y = x . x}, If[y < 0.00001, x, x/y]]) ] [v],
{-2}], ViewVector -> {-.5, -.2, -1}]

But operators are necessary

with operators, we have

x = (-b + √(b^2 - 4 * a * c) ) / (2 * a)

in pure functional form, we have

assign(x, div( plus(-b, sqrt( plus( power(b, 2), neg(times(4, a, c))))), times(2, a)))

so, isn't operators much easier to read.

so, why should you prefer function form?

i think it comes down to, how frequent are the operation, and how standardized is it.

for arithmetics, + - * / and assignment =, they are universal, you should use the operator form.

now, in Wolfram language, arguably, also the forms mentioned on this page.

Programing Language Operators