[whatwg] Side effects free scripts

Alexey Feldgendler alexey at feldgendler.ru
Sun May 28 22:47:57 PDT 2006


On Mon, 29 May 2006 08:31:06 +0700, Andrew Fedoniouk <news at terrainformatica.com> wrote:

>>> Ok, here you make it clear that with side effects you only mean visible
>>> side effects?

>> No, all side effects in the mathematical sense. The script is not allowed
>> to alter the state of the world in any way.

>   Code which is not altering the state of the world cannot produce anything
>   useful (work) for that world.

The only useful result of a side effects free script is its return value. That is, in fact, the very purpose for which CSS expression() exists. It's MEANT to be side effects free, but is systematically abused.

By the way, there are even some optimizations for expression() handling possible when the scripts are forced to have no side effects -- it's possible to avoid repeated invocations of the script when it's known that the state of the world has not changed.


-- 
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com


More information about the whatwg mailing list