May 24, 2009

Javascript Classes, Interfaces & Inheritance

I've been writing a lot of javascript where I work. I found it hard to get everyone up to speed with prototypal inheritance, ways of faking classical inheritance, etc. So I started writing a framework which would allow easy to use, elegant syntax for writing a javascript class along with interfaces and multiple inheritance.

This framework is now published on google code as "javascript-classes". There will be lots more to come under that project, using the class framework as a base.

My goal is to implement the "ideal" MVC framework.

February 24, 2009

Why are you Green?

Today somebody said to me, "Even if you, and 50 of your friends are environmentally friendly, that's not going to make a difference."

Is it just me, or is that one of the most naive statements someone could make?

So I said to them, "You're very correct. But that's not the point."

The point of being "environmentally friendly" has nothing to do with changing the world as an individual.

The point is to raise awareness. To show people who don't understand, that there's something wrong.

The point is to show people that we all need to participate in this motion to reduce consumption and waste.

The point is that we don't get another chance. This is our only earth. Our only home. We all share it. Is there something I'm missing?

Why not do your part to help our home last at least a little longer?

October 16, 2008

CSS Floating Made Easy May Cause Complications!

So today at Vendasta, we had a meeting to deal with outstanding bugs with our, soon to be released for testing, website: StepRep.

Within this meeting we went through each bug and decided who should deal with what. One of the bug was the fact that the browser began to “bog” down after hundreds of entries were loaded into the page’s dom.

This bug was assigned to me, seeing as I wrote the majority of the javascript for this site, it appeared to be simply overloading the page with too many event handlers, etc.

I figured this was an obvious and unavoidable problem for this sprint.

What happens is, once there are hundreds of entries loaded into the page, it becomes virtually unusable. Scrolling is delayed to the point that if you were to fling the mouse wheel up and down several times or even drag the scrollbar, you would be waiting for the browser to catch up for 5+ seconds. Unacceptable!

I pondered some solutions having to do with hiding unseen elements on the page, (apparently, only the number of elements visible to the user cause performance issues), or pagination, etc.

While searching Google to see if anyone else had found performance degradation upon displaying upwards of a thousand dom elements, I found nothing. Realizing I was scrolling through nearly a hundred Google results, I became curious how many elements were on that page.

In the FireBug console I ran document.getElementsByTagName( ‘*’ ).length, with a little over 2000 dom elements as well, the lag shown in our site couldn’t have anything to do with the number of dom elements.

Was It possible that it had something to do with the number of graphics on the page or the way the YUI Grids / YUI Buttons were built?

I removed CSS until the site remained usable despite the enormous number of entries displayed. Then, I narrowed it down to one stylesheet, then, to one line in one stylesheet.

The culprit: overflow: auto;

This property at first sight appeared to be a life saver! In this context it was used to force parents of floated elements to continue to wrap their children. This meant no more <br class="clearer" />’s!

Just a little note: Unless you plan to have a small number of elements with the overflow property set to auto applied to them, Firefox may cause a very poor end-user experience!

September 12, 2008

New! (with Teams.)

New Job. New Language. New People. New Everything! (w/ Teams.)

Well! I started at VendAsta on the 8th of this month! And its been really good! No problem getting used to everything; just how I thought it would be, actually!

Right now, we’re releasing the new VendAsta website! Thats it! The end of the sprint. Well I’ve only been here for a quarter of it; but I’m sure it was good throughout. I got to dig right in and play around in Python with django as well!

They practice strict Scrum for their Agile Development approach, its really interesting being so involved! Very different from the usual, “You’re on your own!”.