Wednesday, February 20, 2008

Cowtown Classic Project I: Codebounce Applet

The first "Forgotten Project" (see Forgotten CTC Projects) to be refurbished is a simple applet called CodeBounce. It's one from class of things ("those goddamn useless applets") that many web surfers in late 90s considered a major annoyance. Had it been deployed by hordes of home page designers, it might have been infamous. It was not, for better or worse. :-)

Applet (which can also be run as a command-line application, via "java Bounce") is simple eye candy, displaying hard-coded number of elastic bouncing balls, bumping into each other and so forth.

Now, there is nothing spectacular here, just 600 lines of trivially simple position and velocity calculation code sprinkled with AWT code. But it is kind of amazing that it still works as well (or poorly) as the day it was written, come to think of that. At the time JDK 1.1 was already mature, and that was the platform on which it was tested, although browsers still only or mostly supported 1.0.2. And runs just as expected on JDK 1.6, including adapting to resized main window (well, as I said, as well as it ever did). It was also cool that even when Java still did run slowly back then, as interpreted language, applet was plenty fast on an antiquated Pentium 66 mhz PC and Netscape browser.

At the time I had done at least 3 other apps in Java (NetReaper, Fractalizer/Fractlet and JiveTerm a.k.a SafeTerm, and this is by far the simplest. But I kind of like that -- writing Java apps and applets was refreshing: after having to write thousands of lines of C code to get anything to show on a window, 600 lines of code for this puppy seemed very compact indeed (although not nearly as compact as those 100 line basic programs in C-64, but close enough, and much prettier).

So that's the part explaining "what". But more importantly, why? Why was it written? CodeBounce project page talks a bit about this. Basically, I wrote it as a proof-of-concept, trying to figure out some simple animation, to be used as an Easter Egg for a well-known and widely used commercial application. In the end, things worked bit differently: easter egg(s) were added (go Phoenix team!), but this particular idea wasn't used. It was simpler to use static graphics and straight-forward linear shuffling. But writing the thing did help in many other ways -- I hadn't used Java for almost a year at that point (having had to work on C, C++); but going back felt like home. So I was even more motivated to find a company that did use Java. I did, and got hired there (company's name nowadays even reflects their use of Java; that's the only hint I'll give). But that's another story for another day.

Oh, and as to the Easter Eggs: sad thing is I don't even know how many (or any?!) users know about these particular ones. Many people are familiar with the "martian guy with laser gun". But I doubt many have seen the "shuffling web form components". It was still cool to have added my own "footprint on concrete", so to speak. Besides, there's at least one other cool Easter Egg in there, which adds "eyes that follow mouse pointer" in there, that I didn't write but knew about, and which probably is as little known as ones I worked on.

blog comments powered by Disqus

Sponsored By


Related Blogs

(by Author (topics))

Powered By

About me

  • I am known as Cowtowncoder
  • Contact me at@yahoo.com
Check my profile to learn more.