Content deleted Content added
→General characteristics: amendend a slight error |
m Disambiguating links to Pearson (link changed to Pearson PLC) using DisamAssist. |
||
Line 231:
In many contexts, a callable may have [[side-effect (computer science)|side effect]] behavior such as modifying passed or global data, reading from or writing to a [[peripheral device]], accessing a [[computer file|file]], halting the program or the machine, or temporarily pausing program execution.
Side effects are considered undesireble by [[Robert C. Martin]], who is known for promoting design principles. Martin argues that side effects can result in [[sequential coupling|temporal coupling]] or order dependencies.<ref name="clean code">{{cite book |last1=Martin |first1=Robert C. |title=Clean Code: A Handbook of Agile Software Craftsmanship |date=Aug 1, 2008 |publisher=[[Pearson PLC|Pearson]] |isbn=9780132350884 |edition=1 |url=https://www.oreilly.com/library/view/clean-code-a/9780136083238/ |access-date=19 May 2024}}</ref>
In strictly [[functional programming]] languages such as [[Haskell (programming language)|Haskell]], a function can have no [[Side effect (computer science)|side effects]], which means it cannot change the state of the program. Functions always return the same result for the same input. Such languages typically only support functions that return a value, since there is no value in a function that has neither return value nor side effect.
|