ALL
JavaScript finite state machine
Finite state machine is a very useful design model, it can be used to simulate many events in the world.In short, finite state machine has three features:Number of states is finiteAt any moment, one object can only be in one stateIn some condition, it will transfer from one state to another stateIn JavaScript, finite state machine can be applied in many places. For example, one menu element on a webpage. When the mouse hovers on the menu, the menu will show up, while the mouse moves away, the menu will hide. If we use a state machine, there are two states(show and hide), the mouse will trigger...
11,875 0 JAVASCRIPT STATE FINITE STATE MACHINE
Coder or Clown?
That’s the challenge.Sit down with someone you’ve never met and try to work out if they are a coder or a clown.I don’t mean to insult anyone, of course, and I’m the first to acknowledge the years of training and effort that goes into being a professional clown.But some coders, oh boy.Like the time I interviewed a recent graduate. I’ll call her Ada. Full of sympathy for the novice programmer I started with a gentle warm-up, a soft-ball question to break the ice.I asked Ada to write some code, on paper, that would print the word “hello†ten times. A...