3 ms·
Simple, because most developers are not computer scientists i.e. no formal training in finite automata, computability, complexity, nondeterminism, regular expre
by super_mario 15y ago
Simple, 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 is foreign to most and good ones intuit their way into implementing one perhaps (just guessing here).
- bradfa 15y agoIt'd be interesting to poll programmers who have computer science degrees, electrical engineering degrees, and are self taught to understand the percentage of each who understands state machines, even just at a basic level. I'll wager electrical engineers understand state machines more often than the other two categories. Stage machines are rather useful in designing hardware.
- Roboprog 15y agoIndeed. It gets so tiresome looking at yet another 500 line subroutine with else-if after else-if snaking down page after page. That said, I managed to get through my BSCS without taking the "Finite State Automata" class. I had to pick up table driven methods later, first just fetching values out of a "table", then later generalizing to code-blocks/functions. At least one way of conceptualizing and implementing a state machine can be simply summed up for the newb: * Where am I? * What just happened? * What do I do next because of it? Generate an enum for each of the first 2, and put code references into some kind of "sparsely populated" 2-D array, and you're off to the races. TMTOWTDI, but this approach goes a long way towards demystifying the topic.
- Nelson69 15y agoCouldn'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.
- RegEx 15y agoNo, he couldn't just say that, otherwise he wouldn't be able to list cool sounding intro to computation terms.
- cbs 15y ago>most developers use fairly explicitly defined state machines [...] 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.