Home Worlds: Controlling the Scope of Side Effects Worlds: Controlling the Scope of Side Effects by Alessandro Warth and Alan Kay, 2008. The state of an imperative program -â€” e.g., the values stored in global and local variables, objectsâ€™ instance variables, and arraysâ€”changes as its statements are executed. These changes, or side effects, are visible globally: when one part of the program modiï¬es an object, every other part that holds a reference to the same object (either directly or indirectly) is also affected. This paper introduces worlds, a language construct that reiï¬es the notion of program state, and enables programmers to control the scope of side effects. We investigate this idea as an extension of JavaScript, and provide examples that illustrate some of the interesting idioms that it makes possible. This introduces a new programming construct that's just the kind I love: they stimulate the imagination and provide simple and strong dynamic invariants to make programs easy to reason about. Comment viewing options Flat list - collapsed Flat list - expanded Threaded list - collapsed Threaded list - expanded Date - newest first Date - oldest first Select your preferred way to display the comments and click "Save settings" to activate your changes.