There’s “no such method” to my madness, man…


So you’re writing a web application and it, like, needs to run on one of the many mobile devices invading society these days. You need to invoke a function or a method that doesn’t exist on the class you’re dealing with. You won’t know the name or arguments of the function until the Jaavscript begins executing on the mobile device. Hi, I’m Cliff. You’re here because you can’t predict your functions and methods in advance of coding your application. I’m here because I wanted to post a really quick tip for those of you dealing with crazy Javascript on a modern browser.

Ruby, Python, Groovy, and even Objective-C have a menas of catching and interpreting functions or methods that have not yet been defined. It’s one of those new cool-kid programming tricks that these languages employ which allow developers to define programming languages that take the shape of the problem they are trying to solve. (See write-ups on BDD, and DSL to understand further.) Javascript, historically, has lacked such features. Notice I say historically… I’ve been studying just such a feature enabled by a magic method called __noSuchMethod_. I’ll be spending the next few days understanding its feasibility and limitations on a mobile web browser. That along with the Java to Javascript bridge feature in Android. Check it out and you can thank me later…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s