Q:

How to avoid event handler get called when no namespace is defined

Assume a bunch of event handler like this:
$('.foo').on('bar.foo', function(e) {...})

They are intended only get called for bar.foo events. Unfortunately they are also called for bar events, triggered by external plugins and libs I don't know.
The simplest approach would be:
$('.foo').on('bar.foo', function(e) {
  if (!e.namespace) return
  ...
})

But the problem is that there are a lot of event handlers. Is there any other possibility to prevent the calling of those event handlers for bar.foo when only bar is triggered?
Edit: Renaming the bar event is not a solution in this case.

A:

Event namespaces are mostly intended as helpers to easily unbind specific anonymous callbacks. 
$( body ).on( 'click', function() {
    console.log( 'Default click on body' );
});

$( body ).on( 'click.myCustomPluginNamespace', function() {
    console.log( 'Custom plugin click on body' );
});

// On plugin cleanup, to leave the default binding intact.
$( body ).off( 'click.myCustomPluginNamespace' );

Without that you would need to save references to your custom listener functions, which is:

Tedious to write
Not very garbage collector friendly as those will still remain in memory when listener is unregistered.

