Javascript: All grown up!

October 8th, 2006

Remember the days when Javascript was just a way to get things to move around on the page, and had to be coded completely separately for each browser? I'm amazed at how far the language has come. Now we've got closures, prototypal inheritance, and associative arrays, but without the usual slowdowns and complexity that usually result from extending a language. I just find it amazing that the language has truly improved over time, instead of becoming mired in bloat. Well done.

Javascript object literal namespacing

July 6th, 2006

The latest best practices in javascript recommend that object literal notation be used to create a namespace feature of sorts. Object literal notation is ridiculously easy to use and gives a great deal of power to the developer. Here is an example-laden crash course.

Read full entry »


June 13th, 2006

As I watch my browser fill with extensions which enhance web pages by adding scripts (Greasemonkey, Platypus, Cocomment, ), I wonder whether some sites may start fighting back. Perhaps Google may detect Platypus removing a text ad, and add a page script to re-insert the ad. Will scripts begin to battle, wage wars of privilege, namespace, obfuscation, and timing? Will the javascript sandbox become a bloody battlefield, littered with object literals, new troops parachuting in via JSON headers and asynchronous XML HTTP requests? Will the DOM tree be hung with broken and battered functions? I envision closures spawning closures, surveiling the digital landscape, emerging from their window.setTimeout bunkers to strike again...

Arbitrary code execution – why?

May 4th, 2006

I find the current state of affairs in programming deplorable. As it is, a single tiny system program with an unchecked buffer size can often be exploited by an attacker to execute arbitrary code on the system. (Let that sink in for a second.) Your operating system (whatever it is) is so fragile that a single coding error, a typo, could allow anyone to do anything they wanted to on your machine. That's unacceptable. And all too common.

Read full entry »

Studying what is instinctual

December 14th, 2005

I'm taking a quick break from studying for my CS 152 final. I'm currently on the Chapter 14 study guide, dealing with OOD. Now, this is something I find completely instinctual. Heck, I nearly reinvented it on my TI-89 graphing calculator, using BASIC. Then someone told me about Java, an OO language, and I just wanted to smack myself.

I've never thought about how a class hierarchy is designed -- when I go to make one, it just falls into order magically. I have gut reaction to improperly designed code. Unfortunately, I have to explain how it works on an exam, and my own description won't cut it. It has to match the book's description, which means I essentially have to memorize a specific description of something I know by heart. Bleagh.

I agree that being forced to think about something you've been doing unconsciously can be a good thing -- I don't dispute that. It teach you things you missed, and expose flaws in your subconscious reasoning. But when I'm forced to regurgitate formulaic descriptions, that's when I object.