It’s a good idea.Â Namespaces are helpful and clarify things.Â It purports to make things “object-oriented,” which I find a kind of unfortunate claim.Â There’s a brand of “object orientation” which basically is nothing but procedural programming which uses classes and/or objects as namespaces — where an object of a given class has no purpose other than as a place to hang a bunch of conceptually related methods.Â Or where certain classes are never instantiated at all and just serve as namespaces for their various methods.Â You see bits of this even in respectable object oriented languages, e.g. a Math class which exists only to put the sqrt() method.Â But it’s kinda lame, as far as object orientedness goes.Â And it’s mega-lame if you’re doing it all the time.Â (Mega-lame as far as OO goodness is concerned.Â Namespaces are still better than no namespaces, though.)
The other thing that seemed odd about this article was that as far as I can tell, what he’s proposing isn’t actually valid JSON.Â JSON is supposed to be a data serialization language, like YAML. If you check the spec, you’ll notice function objects are not there.Â So what the author is writing about is not strictly speaking even JSON.Â And it’s definitely not there to do what JSON is supposed to do — serialize objects for transmission from one place to another.
So it’s a nifty thing, a good idea, but not really very object-oriented at all, and not really JSON at all.