Function (computer programming): Difference between revisions

Content deleted Content added
Small Basic: Fixed typo
Tags: canned edit summary Mobile edit Mobile app edit Android app edit
Line 215:
 
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 temporal coupling or order dependencies.
 
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.