码迷,mamicode.com
首页 > 其他好文 > 详细

Side effect (computer science)

时间:2018-01-15 18:42:37      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:ssi   mat   func   network   use   nbsp   red   stand   odi   

In computer science, a function or expression is said to have a side effect if it modifies some state outside its scope or has an observable interaction with its calling functions or the outside world besides returning a value. For example, a particular function might modify a global variable or static variable, modify one of its arguments, raise an exception, write data to a display or file, read data, or call other side-effecting functions. In the presence of side effects, a program‘s behaviour may depend on history; that is, the order of evaluation matters. Understanding and debugging a function with side effects requires knowledge about the context and its possible histories.[1][2]

Side effects are the most common way that a program interacts with the outside world (people, filesystems, other computers on networks). But the degree to which side effects are used depends on the programming paradigm. Imperative programming is known for its frequent utilization of side effects.

 

https://en.wikipedia.org/wiki/Side_effect_(computer_science)

Side effect (computer science)

标签:ssi   mat   func   network   use   nbsp   red   stand   odi   

原文地址:https://www.cnblogs.com/feng9exe/p/8289100.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!