In the hardware definition language, I create a finite state machine (FSM: a little computer entity that carries out a set of tasks, step by step). It has too many states, I am informed by Dr. Smith. It should have six states, as shown in the diagram on the white board, not ten.
"I based mine on the ones that were already written," I explain. This project has been around for a few years and there's a lot of old code floating around. Anyway, some of the six states require multiple steps to implement, hence the extra states.
"Oh, well, I didn't like those," Dr. Smith says.
Okay. I can see that my next task will be to rewrite all the old finite state machines. But how? Glad you asked I get a long description about how to break the FSM into multiple processes so that it will execute faster, be easier to maintain and modify, and not have more than six states. By now I am looking pretty dazed, which he must interpret as my being unhappy that my initial design was a reject (I'm not. I'd rather learn how to write good code than have my bad code let slide. This is a lack of sleep combined with hypoglycemia sort of daze.) and he launches into the lecture about modular design and on and on.
At last I am released to eat a granola bar and rewrite the FSM. Crunch. I do. It's modular all right: the main module consists only of declarations for the three sub-modules. Ha! Modular! I send the file to the printer in his office and let him know that I finished it. "I haven't tried to compile it yet or anything."
Ten minutes later he carries the printout into the lab. "You know, there's such a thing as going to extremes."
308 words | June 3, 2004 08:51 PM | Rocket science