The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
4answers
521 views

Does internal state “leak” when it influences externally-visible behavior?

I have a method (in C++) which generates a value based on a parameter and the parameters from previous calls. Calling it more than once with the same parameter may generate different values each time. ...
3
votes
1answer
195 views

How to avoid global state without large function signatures?

So, there are some good answers to this question, namely: Why is Global State so Evil? I have a specific question about the alternatives Mikera proposed as the answer with the second most up-votes. ...
0
votes
2answers
78 views

How to predict a future simulation state

We have a program that combines the simulation of an aircraft system and predefined pedagogical scenarios for trainee pilots to learn how to use this system. When we follow the normal scenario, ...
2
votes
0answers
45 views

Angular UI's $StateProvider [duplicate]

I was thinking of using Angular UI, and specifically its $StateProvider, which makes it easy to create nested views, in my next application. Until now, I have been using vanilla Angular's ngInclude ...
9
votes
4answers
2k views

What is meant by “OOP hides the state”? [closed]

In one of many anti-OOP rants on cat-v.org I found a passage by Joe Armstrong raising several objections against the OOP model, one of which was the following: Objection 4 – Objects have private ...
3
votes
2answers
107 views

System state design composition

Consider the following Java code: public class HumanStateImpl implements HumanState { private boolean alive; private Color skinColor; // getters and setters, other state fields ...
2
votes
2answers
132 views

Why must essential mutable derived data have an inverse function?

I was reading the paper Out of the Tar Pit authored by Ben Moseley and Peter Marks when I came across the following section on page 25 regarding essential mutable derived data: Essential Derived ...
2
votes
2answers
248 views

What is State, Mutable State and Immutable State?

This is a newbie question, but I couldn't find a newbie-proof enough answer on Google. What do people mean when they say 'state' - in programming in general, and in OO programming specifically? ...
0
votes
0answers
73 views

Looking for design pattern to represent shared state in music sequencer

I like to give lots of context, but also to state the basic question up top as concisely as possible. Feel free to read a little or a lot. I'm working on a music sequencer, and have been happy so far ...
1
vote
1answer
126 views

Can we consider a clients interaction with a web server to be stateful if the web server maintains state via session variables or cookies?

A little confused with the notion of stateful/stateless architectures. Forgive me if I'm unclear. Questions: Can we consider a clients interaction with a web server to be stateful if the web server ...
2
votes
2answers
140 views

Can the Jacquard loom be considered stateless?

Can the Jacquard loom, pictured below complete with its chains of paper cards be considered stateless? As far as I can tell I can tell, each operation is not dependant on the previous. Or did it ...
1
vote
3answers
210 views

A pattern to “atomically” update a pair of objects

Is there a standard pattern in OOP to kind of "atomically" update a pair of objects, like a pair of bank accounts on a transaction? I would like to have somehow a single public method exposed that ...
0
votes
1answer
528 views

State design pattern: best implementation for my case?

Me and a mate have a discussion about what would be the best way to implement the pattern state for managing several screens for an application we are developing. We have a ScreenManager (I guess the ...
1
vote
3answers
261 views

“state” or “status”? When should a variable name contain the word “state”, and when should a variable name instead contain the word “status”? [closed]

Reading code and discussions pertaining to code, I often see the words "state" and "status" used interchangeably, but the following tendencies seem to exist: When a variable holds a value intended ...
15
votes
2answers
404 views

Side effect-free interface on top of a stateful library

In an interview with John Hughes where he talks about Erlang and Haskell, he has the following to say about using stateful libraries in Erlang: If I want to use a stateful library, I usually build ...
1
vote
1answer
182 views

How to test issues in a local development environment that can only be introduced by clustering in production?

We recently clustered an application, and it came to light that because of how we're doing SSL offloading via the load balancer in production it didn't work right. I had to mimic this functionality on ...
3
votes
3answers
211 views

Throwing exception from a property when my object state is invalid [duplicate]

I am aware that for the general case, the answer to "should I throw an exception from a property" is "generally don't, but in some special circumstances it is OK to do so". There is a Microsoft ...
8
votes
2answers
622 views

Can *any* program task be expressed without state?

This is a theoretical question, but after many years of programming in what I now realize is "normal" imperative technique, using C++ mainly, I've discovered this other world of functional ...
2
votes
1answer
139 views

State pattern long state class names

I am using state pattern on 28 states in my application. The states are for membership cards that has 7 major states, there are 4 boolean attributes for the membership card that actually affects the ...
0
votes
2answers
142 views

Memento with optional state?

EDIT: As pointed out by Steve Evers and pdr, I am not correctly implementing the Memento pattern, my design is actually State pattern. Menu Program I built a console-based menu program with multiple ...
0
votes
1answer
577 views

Java: How to manage UDP client-server state

I am trying to write a Java application that works similar to MapReduce. There is a server and several workers. Workers may come and go as they please and the membership to the group has a soft-state. ...
14
votes
4answers
1k views

Functional Programming: right ideas about concurrency and state?

FP proponents have claimed that concurrency is easy because their paradigm avoids mutable state. I don't get it. Imagine we're creating a multiplayer dungeon crawl (a roguelike) using FP where we ...
1
vote
1answer
653 views

How to implement session state in a backend web application?

When using a non-MVC service-oriented/Interactor pattern approach to decoupled system architecture, how is session state implemented? I've been thinking of building the frontend of an application ...
2
votes
4answers
239 views

In Scheme, what is formally a program's state?

I think i've understood more or less what a parsed Scheme program looks like (a binary tree with atomic values on the leaves, if i have understood correctly). Can anybody please define to me, or give ...
3
votes
2answers
282 views

What is the preferred way of communicating between applications on the same system?

I'm designing a system that is built on several small applications written in python, some of these will be services and others will be programs that only run during special situations. What I need to ...
3
votes
1answer
484 views

script engine with no global environment (java)

I am curious about how global variables are handled by script engines. I am looking for a script engine that does not preserve the state of global variables upon invocation. Are there such engines out ...
2
votes
1answer
232 views

Validation and Error Generation when using the Data Mapper Pattern

I am working on saving state of an object to a database using the data mapper pattern, but I am looking for suggestions/guidance on the validation and error message generation step (step 4 below). ...
8
votes
7answers
297 views

How does a variable introduce state?

I was reading the "C++ Coding Standards" and this line was there: Variables introduce state, and you should have to deal with as little state as possible, with lifetimes as short as possible. ...
2
votes
2answers
311 views

I don't understand the definition of side effects [duplicate]

Possible Duplicate: What is a “side effect?” I don't understand the wikipedia article on Side Effects: In computer science, a function or expression is said to have a side effect if, in ...
-5
votes
2answers
543 views

Is it possible to implement a completely-stateless multiplayer game?

I'm facing a challenge understanding how to program a web version of a card game that is completely stateless. I create my object graph when the game begins and distribute cards to PlayerA and ...
4
votes
3answers
524 views

Clojure state and persistence

I'm learning Clojure to see if it's something I can leverage at my current job, and more importantly, how I can convince my bosses that Clojure has a 'killer feature' over java that makes it worth the ...
-1
votes
1answer
128 views

Are there any valid ways of eliminating/reducing state?

For definitions and examples of "state", see: http://en.wikipedia.org/wiki/Program_state , http://en.wikipedia.org/wiki/Finite_state_machine , http://en.wikipedia.org/wiki/State_diagram A diagram ...
0
votes
1answer
335 views

Implementing a “state-machine” logic for methods required by an object in C++

What I have: 1 hypothetical object/class + other classes and related methods that gives me functionality. What I want: linking this object to 0 to N methods in realtime on request when an event is ...
7
votes
4answers
458 views

Definition of “state”

What is a good way to define "state", as in state variable or state machine, to a new (previously non) programmer? What are some good ways to explain why this concept is useful for writing software? ...
4
votes
2answers
285 views

Good ways to jump to a particular state in a yielding stateful function?

I'm working on some embedded code using C. Various pieces of functionality need non-blocking stateful functions, which are mostly implemented using a switch on various states. For example, a modem ...
10
votes
1answer
907 views

UI patterns in functional languages

I would like to start fiddling with ClojureScript, but I am puzzled about some points. My problem is what is a good way to deal with state changes coming from user interaction, when you trying to work ...