Blog Archives

A simple explanation of “new” in Javascript.

There is a major feature of Javascript that is sorely misunderstood–the “new” keyword. Using the “new” keyword when declaring a variable will assign it’s value to the state of “this” upon completion of the function. Not using “new” will simply assign it’s value to the return value, or ‘undefined’ if nothing was returned. I wrote a simple example below to illustrate the effects of using the new keyword.

Peint – Event-based canvas drawing, yay!

I did a bunch of work on Peint today, refactoring it to something that I might actually consider good enough to release. On that note; Peint enters alpha as of now!

Peint – Painting to canvas made easy!

As I mentioned in my previous post, I have been working on a graphics rendering library for the html5 canvas element. Peint is an attempt to make using canvas easier and more flexible, while introducing event-based programming. You include only core library and then use Peint.require(‘yourscript’, callback) to asynchronously load extra modules and execute the callback code once the module is ready. Using this method, http requests are made smaller and occur after page load, so execution appears near instant–no waiting for 100+ kb of code to download before the system starts setting itself up. :)

On canvas, and how to use it well.

All day I have been working on a graphics library for html5′s canvas element, and I’ve come to the conclusion that it is not particularly easy to use “as-is” in more involved applications.

Firefox – Two brackets and a number from being perfect.

I’ve always been an avid supporter of web standards, so I was glad to here that Gecko 1.9, the layout engine used in the Firefox 3 beta, passes the Acid2 test, but I found the future version of Firefox is still lacking one single thing that I feel holds it back rather significantly from being what it could be. That features is the RSS Updates counter that Safari has had for pretty much ever. How long will it take before Mozilla catches on that Firefox’s lack of this simple feature is a deal-breaker for many people? I guess I’ll have to continue using two browsers until Mozilla catches up.

YSlow? – That’s what I’d like to know!

So I stumbled upon a neat little plugin for the Firebug plugin I’ve been using with Firefox for awhile now. It’s called YSlow and what it does is analyze various aspects of your pageload and compares it to Yahoo’s Exceptional Performance criteria and gives each aspect a letter grade rating. Nerd Culture was an F yesterday–Now it’s averaging between D to B for me, depending on the page. I reduced the total page load of the homepage from 784 KB to 345 KB, less than half what it was before! Even better; Primed Cache was reduced from 440 KB to 18 KB! Why was my server set up so that the users would download images they already have in their browser’s cache? >.>