Expression-oriented Programming Language - Criticism

Criticism

Critics, including language designers, blame expression-orientation for an entire class of programming mistake wherein a programmer introduces an assignment expression where they meant to test for equality. For example, the designers of Ada and Java were so worried about this type of mistake, they restricted control expressions to those that evaluate strictly to the boolean data type. The designers of Python had similar worries but took the alternative strategy of implementing assignment as a statement rather than an expression, thus prohibiting assignment from nesting inside of any other statement or expression.

However, notation provokes such errors, not semantics. From the perspective of expression-orientation, the choice of assignment notation made by C-style languages, the equals sign, =, can be considered a poor choice due to the equals sign's similarity to, and hazardously small typing distance from the notation C-style languages choose for the equality operator, ==, make it an occasion for error. The expression-ness of assignment is not the root cause. Other language families make different notational choices for assignment that do not have this problem, such as variableexpression in APL, variable <- expression in OCaml, S, and R, variable := expression in ALGOL 68 and Standard ML, or (setq variable expression) in Lisp and Scheme. Furthermore, many expression-oriented languages are also functional languages. In these languages, assignment is either rare, or, in the case of purely functional languages, impossible.

Read more about this topic:  Expression-oriented Programming Language

Famous quotes containing the word criticism:

    However intense my experience, I am conscious of the presence and criticism of a part of me, which, as it were, is not a part of me, but a spectator, sharing no experience, but taking note of it, and that is no more I than it is you. When the play, it may be the tragedy, of life is over, the spectator goes his way. It was a kind of fiction, a work of the imagination only, so far as he was concerned.
    Henry David Thoreau (1817–1862)

    ...I wasn’t at all prepared for the avalanche of criticism that overwhelmed me. You would have thought I had murdered someone, and perhaps I had, but only to give her successor a chance to live. It was a very sad business indeed to be made to feel that my success depended solely, or at least in large part, on a head of hair.
    Mary Pickford (1893–1979)

    Like speaks to like only; labor to labor, philosophy to philosophy, criticism to criticism, poetry to poetry. Literature speaks how much still to the past, how little to the future, how much to the East, how little to the West.
    Henry David Thoreau (1817–1862)