Earlier quoted context omitted.
I had the same reaction. Almost nothing but FSMs in game AI. Makes me wonder if we need to look beyond FSMs for the next level of intelligence.
About 10 years ago when I was reading a lot about AI game dev I remember reading about Fuzzy State Machines ( http://www.coniserver.net/wiki/index.php/FuSM ) which were seen as an improvement from classical FSM. I think I read it in one of the "AI programming Gems" books.
Why Developers Never Use State Machines
81–90 of 96 posts
Re: Why Developers Never Use State Machines
#82a) Most I speak to had a Z-rate CS education which scraped a bit of OO design in Java and don't know they really exist.
b) Most languages they cut their first code in are about puking data around from SQL to the web which rarely if ever requires an FSM.
c) Someone thumped them over the head with "Windows Workflow for dummies" which is then assumed to be the answer to all stateful problems.
d) It looks hard so they don't bother.
e) "developers" should not be confused with "computer scientists". It's "builders" versus "engineers".
Re: Why Developers Never Use State Machines
#83Re: Why Developers Never Use State Machines
#84Re: Why Developers Never Use State Machines
#85Simple, because most developers are not computer scientists i.e. no formal training in finite automata, computability, complexity, nondeterminism, regular expressions, non regular languages, context free grammars and languages, Turing machines, halting problem and underlying math in general. If they did, trust me they would use state machines without too much reservation where appropriate. But as it is, the concept i…
Couldn't you just say: all developers use state machines, some just aren't sophisticated enough to know it? I'd even say that today, most developers use fairly explicitly defined state machines (like there is even a code entity called "state machine" somewhere.) Every time they fire up a regular expression.
They're not using state machines, in that case it just happens to be an implementation detail of the regular expression library they're using.
Re: Why Developers Never Use State Machines
#86In my experience, why "developers" never use state machines: a) Most I speak to had a Z-rate CS education which scraped a bit of OO design in Java and don't know they really exist. b) Most languages they cut their first code in are about puking data around from SQL to the web which rarely if ever requires an FSM. c) Someone thumped them over the head with "Windows Workflow for dummies" which is then assumed to be the…
Re: Why Developers Never Use State Machines
#87I discovered how state machines can be practical when checking the source code of Spree, the rails e-commerce engine. The checkout-process is a state machine. I'd highly recommend using state machines for multi-step forms. It feels very natural and keeps you sane, I believe it should be a best practice.
>I'd highly recommend using state machines for multi-step forms. It feels very natural and keeps you sane, I believe it should be a best practice. That's interesting. Can you elaborate on it, maybe with an example?
You can check out Spree's state machine for the checkout process here: https://github.com/spree/spree/blob/master/core/app/models/o... (starts at line 83). Notice that the Order model is the state machine.
Re: Why Developers Never Use State Machines
#88This is a stupid statement. Pretty much every code depends on a state (i.e. the content of the heap memory) and is thus a state machine (by its most generic definition). I think he is referring mostly to a finite state machine, though. But even then, you have that quite often somehow in your code (think of global boolean variables).
Well the memory available to the processor for state is finite, too. Thus, every classical computer is a finite state machine. That said, some programs have state that is more finite than others. :-) Deep down, a "state machine-based design" is a mindset of the designer.
Re: Why Developers Never Use State Machines
#89Having used state machines a lot for embedded development, I find that they have one huge drawback: the resulting C code is unreadable, which turns maintenance into a nightmare. SM have a key quality: they are a compact and unambiguous way for specifying a behavior. If your system's behavior is set in stone, it's worth specifying it as a SM and implementing it as one. This SM is also great to include in a spec, stand…
I've been doing embedded development for a few years and I love our state machines, they're a pleasure to work with. Maybe yours just sucked.