Three engineers and three accountants
Three engineers and three accountants are traveling by train to a conference. At the station, the three accountants each buy tickets and watch as the three engineers buy only a single ticket.
"How are three people going to travel on only one ticket?" asks an accountant. "Watch and you'll see," answers an engineer. They all board the train. The accountants take their respective seats but all three engineers cram into a restroom and close the door behind them.
Shortly after the train has departed, the conductor comes around collecting tickets. He knocks on the restroom door and says, "Ticket, please." The door opens just a crack and a single arm emerges with a ticket in hand. The conductor takes it and moves on.
The accountants saw this and agreed it was quite a clever idea. So after the conference, the accountants decide to copy the engineers on the return trip and save some money (being clever with money, and all). When they get to the station they buy a single ticket for the return trip.
To their astonishment, the engineers don't buy a ticket at all. "How are you going to travel without a ticket?" says one perplexed accountant. "Watch and you'll see," answers an engineer. When they board the train the three accountants cram into a restroom and the three engineers cram into another one nearby. The train departs.
Shortly afterward, one of the engineers leaves his restroom and walks over to the restroom where the accountants are hiding. He knocks on the door and says, "Ticket, please."
Common Downfalls of JavaScript
I have heard over the years that people say that JavaScript is not a powerful language and I just laugh. People say that it is only good for menus and form validation and the rest should just be left alone. I will admit that JavaScript is limited in what it can do, but I will never go as far saying that JavaScript is not a powerful language.
JavaScript has some downfalls that I have run into. JavaScript can not handle large nested loops in a timely fashion without freezing the browser. JavaScript can not write to databases or store information permanently. JavaScript can not be relied on since it can be turned off. Also there are some other minor issues that I do not feel like going into!
But there are ways around all of the downfalls. You can better structure loops so you do not need so many iterations. You can mix in a server side language or use active X if you are only planning on using IE. You can use no script tags to hide information on the page.
JavaScript can be powerful and I was told that I was wasting my time developing Artificial Intelligence games. I developed a series of games online that use planned out algorithms to solve the best possible move. Yes the algorithms can be improved, but they give the average person a run for their money. All of the skeptics finally admitted that it is possible to make games without flash or applets.
One example of a game: Reversi
JavaScript game programming is a great way to learn programming and I will write about basics of developing a JavaScript game in the future.
Eric Pascarello HTML/JavaScript moderator at JavaRanch.com