Content deleted Content added
→Examples: added OCaml |
Marked page issues as discussed in the page Talk section "Article problems!". Added tags about problems relating to a lack of citations, synthesis of materials, and notabillty problems of the article itself. Guidelines for when they should be removed are in the talk page! Also noted failed verification on the first inline citation, which does not argue what the page text argues. Tags: Visual edit Mobile edit Mobile web edit |
||
Line 1:
{{Programming paradigms}}
{{Notability|date=July 2022}}
An '''expression-oriented programming language''' is a [[programming language]] in which every (or nearly every) construction is an [[expression (computer science)|expression]] and thus yields a value. The typical exceptions are [[macro (computer science)|macro]] definitions, [[preprocessor]] commands, and [[declaration (computer programming)|declarations]], which expression-oriented languages often treat as [[statement (computer science)|statements]].
Line 8 ⟶ 9:
==Criticism and prevention==
{{Synthesis|date=July 2022}}
{{See also|Assignment (computer science)#Assignment versus equality|Relational operator#Confusion with assignment operators}}
Critics, including language designers,<ref>[https://www.oracle.com/java/technologies/javase/codeconventions-programmingpractices.html#547 Java Code Conventions "10.4 Variable Assignments"]</ref>{{Failed verification}} blame expression-orientation for an entire class of [[software bug|programming mistakes]] wherein a programmer accidentally codes an [[assignment (computer science)|assignment]] ''expression'', which replaces a variable with an expression rather than testing it for [[equality (relational operator)|equality]] with that expression.
The designers of [[Ada (programming language)|Ada]] and [[Java (programming language)|Java]] prevent this type of mistake by restricting [[conditional (computer programming)|control expressions]] to those that evaluate strictly to the [[boolean data type]].<ref>[https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.9 The Java Language Specification, Java SE 8 Edition "14.9 The if Statement"]</ref><ref>[https://www.adaic.org/learn/materials/intro/part4/ Introducing Ada]</ref>
Line 18 ⟶ 20:
==Examples==
{{Unreferenced|date=July 2022}}
{{Expand section|date=February 2018}}
*[[ALGOL 68]]
|