Darcy ClarkeDevelopment / Design / UX

Toggle Main Navigation

Jun 8, 2011

Failure can be flattering

Posted in "thoughts"

Over a year and a half ago I started a project tentatively named "jHooks". It was supposed to be a very plain Javascript plugin that would allow your applications to implement a light messaging service similar to event binding and triggering. This is also, now, frequently referenced as "Pub/Sub" (Publish / Subscribe). I actually worked really hard to try and figure out the best way to implement such "Javascript Web Hooks" (the term I was using to reference this method at the time).

On and off, over the span of 3 or 4 months, I pondered the best way to create such a, library agnostic, plugin. All that time, all that planning, down the drain as soon as I realized the much simpler solution right before my eyes, pubsub. Paul Irish had been the one to steer me away from the idea of "hooks" and shed some light on this pubsub magic. Alex Sexton & Rebecca Murphey would be two of the many Javascript developers that began to push this kind of loose coupling thinking for their Application architecture around that same time. People like Peter Higgins would then go on to write very elegant implementations, to which I still use today. As you can tell, I was not alone at this point.

So what does this tell me? Well, I had spent all this time thinking I was ahead of the curve when really there where others seeking out the same kind of functionality with much better insight into the proper implementation and mechanics. Should I be upset? No. Should I be discouraged? Of course not. Although my plugin was a failure, it <u>was</u> an attempt. I had made a conscious effort not to share my idea for months when I could have been apart of that bleeding-edge conversation. That said, the solution I was presented with was just what I was looking for, whether or not I had made it myself or been a contributor (which is often something hard for me to wrap my head around, if you know me well).

Stepping back and admitting defeat can be very hard sometimes. The more attached you are to an idea or solution the more stubborn you are to think subjectively compared to objectively. Having a good understanding of when to give up is extremely important and a valuable character trait. Failure can, ultimately, be flattering.

R.I.P "jHooks"

I should note that jHooks was also supposed to run the bound methods synchronously. This was one of the key problems I was trying to solve but which I ultimately gave up on (there are still talks on how this could be accomplished in different Javascript circles). There is a possibility that you could queue / dequeue methods but that would require all functions dequeuing themselves or else the chain will break, not ideal.