Code Positivity
Topic · Markdown · JSON · original wiki page
This page provides some insights into what it means to try and write code in a positive way, with the least negation as possible.
Overview
Code negation is (usually) using not (in SQF/SQS) or ! (in both SQF/SQS and Enforce Script); all in all, it is about searching for the opposite of what one wants. Examples:
| SQF | Enforce Script |
|---|---|
|
|
Research (ref: https://www.researchgate.net/publication/10733819_Effects_of_Negation_and_Situational_Presence_on_the_Accessibility_of_Text_Information) has (ref: https://www.researchgate.net/publication/221438570_Some_Issues_on_Detecting_Negation_from_Text) shown (ref: https://medium.com/@Cuadraman/why-to-stop-writting-negavite-code-af5ffb17195) that negation in general (not just in code but also in reading, teaching etc) makes processing sentences more difficult for the human brain, making its message less impactful (although not in all cases (ref: https://www.psychologicalscience.org/news/releases/true-or-false-how-our-brain-processes-negative-statements.html)).
Examples
| Do | Don't |
|---|---|
|
|
|
|
Counter Examples
As most if not all rules of development, this rule is a rule of thumb that is not to be enforced at all cost.
| Don't | Do |
|---|---|
|
|
|
|