Code Scavenger’s Chronicles

venting steam….

Archive for August 2008

Neat vs Filth

without comments

Dang..every time I look at the guice code, keep finding neat little nuggets lying around – the operative word being “neat”. For instance, look at ToStringBuilder. What?? A Builder for toStrings? Who would have thought of that? Well, Crazy Bob Lee did!

Here’s the usage from a consumer class.

public String toString() {
return new ToStringBuilder(Binding.class)
.add(“key”, key)
.add(“provider”, internalFactory)
.add(“scope”, scope)
.add(“source”, source)
.toString();
}

Isn’t that neat? People at the Big G are thoughtful enough to make writing toString() structured and a breeze at the same time.

Where does this ‘neatness’ come from? Why is it that any code that you see at work (read our day jobs – not all of us work at google) tends to be so horrific & predictable that a page down while inspecting code doesn’t miss much worth the traversed screen space? Why is it that so-called innovative and path-breaking software (mind you; such stuff is even patented) is built on humongous mountains of code filth?

Nope – I don’t have answers to these questions. Do you?

PS : Mind you, I do have a *solution* to the problem; but not an *answer* to the question ;) – Maybe I’ll write an article with answers when I am feeling more upbeat about the work that I get to do. Who knows?

Written by shakhan

August 19, 2008 at 4:28 pm

Posted in code

Tagged with ,

ECMAScript property resolution

without comments

Hummm…And I thought I knew property resolution in Javascript.

Read this and decide for yourself.

Everyday is a real humbling experience!

Written by shakhan

August 18, 2008 at 6:57 pm

Posted in code

Tagged with ,

WFH full time

without comments

Got some full time WFH feelers recently. Trying to figure out what it would mean:-
> Less CYA
> More coding
> Less time spent on conflict resolution
> Nil face-time with manager-types
> No drinking coffee in empty conf rooms

And I’m not even considering all the time left for my family yet. Sounds like music to my ears.

Now, if only I can land one of those. :)

Written by shakhan

August 15, 2008 at 12:12 pm

Posted in rest

Tagged with

Workers on the Web! Ahoy!

without comments

The WebWorkers draft spec is out.

Looks like Gears is going to dominate the browser related W3C recommendations & standards for some time to come. :)

Written by shakhan

August 7, 2008 at 12:13 pm

Posted in code

Tagged with

Accessibility in Web 2.0 apps

without comments

In case you are interested in implementing accessibility in Web 2.0 apps; I would recommend taking a look at AxsJAX. There is a nice tute available here. It’s creators gave a talk at Google I/O this July which can be found here.

And for the theoretically inclined, here is the W3C roadmap for ARIA.

Oh, and what did this do for me? Well…I have yet to make a accessible web2.0 app…however, I did start using XPather. There’s always a silver-lining ;)

Written by shakhan

August 6, 2008 at 6:46 pm

Posted in code

Tagged with