(New posting on 2016-06-04; originally posted as /archives/4698)
If your business logic starts getting complicated, it might mean that you should use finite state analysis and design. This technique is very popular for the artificial intelligence systems used in video games, and there are a number of finite state machine frameworks out there for Java, but they are all pretty heavyweight.
How does one create a lightweight state machine, and what is finite state analysis anyway? The ACM published a paper called “The Art of the State” by John F. Cigas in 1992.
In the paper Professor Cigas describes how to do finite state analysis, and how to implement your state machines via a loop surrounding a switch statement… that’s it… its that simple.
Please read the paper. If it doesn’t make any sense, then ask me how this is used, and I will show you. Please go to this page to get the PDF: http://portal.acm.org/citation.cfm?id=134541 The technique basically orders complex if-this-or-that-or-this-or-that type logic into the simplest form possible, and its really easy to do.
So let’s go to the history books, as citizens of this country so seldom do. The Pledge of Allegiance started in 1892 as a set piece in a magazine, nothing more, nothing less. It was written by a man named Francis Bellamy in honor of Columbus Day, a holiday that scarcely exists anymore except in terms of department-store sales and parades. The words “under God” were nowhere in it, hardly surprising since Bellamy had been squeezed out of his own church the year before because of his socialist leanings. His granddaughter said he would have hated the addition of the words “under God” to a statement he envisioned uniting a country divided by race, class and, of course, religion.
Those two words went into the pledge nearly 50 years ago, and for the most deplorable reason. It was the height of the Red scare in America, when the lives of those aligned or merely flirting with the Communist Party were destroyed by paranoia, a twisted strain of uber-patriotism and the machinations of Sen. Joseph McCarthy, after whom an entire vein of baseless persecution is now named. Contrary to the current political argument that “under God” is not specifically devout, the push to put it in the pledge was mounted by the Knights of Columbus, a Roman Catholic men’s organization, as an attempt to counter “godless communism.” President Dwight D. Eisenhower signed a bill making this law, saying that the words would help us to “remain humble.”
That doesn’t look like a music video from 1980! And what’s with those missiles? Someone put the music to footage from the movie “Les Chevaliers du ciel“. No humans were harmed in the making of this video.