
How Batman.js can Help you Build Apps - joshuacc
http://www.shopify.com/technology/4080092-how-batman-can-help-you-build-apps
======
ktusznio
Before anyone gets too upset: both Batman.js and the code examples are written
in Coffeescript. If you wish, you may write Batman apps in js, since Batman
compiles to native js.

Calling it Batman.coffee just didn't sound as cool.

~~~
MatthewPhillips
It would be very unpleasant to write a Batman app in js since it's dependent
on CoffeeScript's "extends" capability (which _can_ be recreated in js, but
would be unpleasant as most frameworks handle this sort of thing for you). Of
course this can be fixed if they decide to provide a Batman.extend() method.

Looks very nice! I'm certainly excited to try this out on mobile, as it sounds
pretty perfect for that. I'd rather wait for pushState support as I dislike
hangbangs. Looking at the source, it would likely be easy to create alternate
storage adapters, which is something I'm interested in.

~~~
roopeshv
well, you can use jQuery.extend(whateverBatman, *methods) if you want to
extend it. (i don't do much JS, but I know just enough to write really bad
code)

~~~
rahrens
While similarly named, these functions actually do quite different things.

jQuery.extend is a function which copies references to properties out of later
objects into the first argument.

CoffeeScript's extends is a language keyword which creates inheritance
relationships in CoffeeScript's built in object model. (Which is similar but
not identical to the object model in Backbone.js.)

------
gerggerg
No matter how good it gets. I'm going to have a really hard time seriously
recommending my team go with _batman_.js for our next project.

~~~
arctangent
My team's core language is named after a surrealist British comedy troupe ;-)

<http://en.wikipedia.org/wiki/Monty_Python>

~~~
kalid
I think that language would've had difficulty if it was called montypython :).

Batman.js, unfortunately, only evokes one image.

~~~
angelbob
So you're saying it needs a half-man-half-bat logo to make sure it can evoke
more than one image? :-P

~~~
inportb
I think it needs a man-wielding-a-bludgeon logo.

------
erichocean
In a former life, I helped out on the SproutCore project. It's good to see
things like Batman.js taking up the challenge of a tightly-integrated MVC
framework.

(I'm still bummed SproutCore didn't take off, but there's little I can do to
change things now.)

------
encoderer
If you're wary of having to troll annotated CoffeeScript source to discover
some features and figure things out, then hold off a bit. Batman was open-
sourced just a month ago. Docs are not there yet.

But I'm very happy with it. It makes some mundane things pretty delightful.
Some of the best parts of it, IMO, are a powerful view tier and terse template
style. A super easy macro for creating routes and reverse routes. A promising
Filter type, that Github indicates is being improved.

Also, you don't need to use NPM to install it. If you're looking to just use
it on the client side (I'm using it w/ Python and PHP), just clone the repo.

------
ethank
So is there a good grid comparing batman.js with backbone and knockout.js?

~~~
dickeytk
It appears to me (in my 1 minute look at the site) that it's a server-side
framework. backbone and knockout are client-side

EDIT: I think what I just said is incorrect since the article makes a backbone
comparison

~~~
encoderer
Yeah, it's a client side framework. Though it seems like they're going to be
rolling out a server as well -- though I'm sure it will not be required. That
is, you'll be able to use Batman with any server you want.

~~~
knotty66
I think it's cool that you will be able to use the same language -
CoffeeScript - and even the same objects on both client and server side.

But the server side stuff is optional. At the moment you can persist to HTML5
localStorage or REST.

------
kveykva
I have a difficult time finding things that differentiate Batman.js from
Knockout.js

edit - Further research shows RESTful persistence is the highlight difference
and Batman.js is a bit cleaner.

~~~
encoderer
Templates in Batman (eg, your HTML files) are a lot cleaner.

Batman is a great choice if you're using CoffeeScript.

On the other hand, Knockout has way better docs. Batman will get there
eventually. But right now it's still pretty rough going.

I've been using batman for a bit now, really loving it.

Looking forward to the event system rewrite that they're working on now to
close out some open issues.

~~~
dugmartin
The templating in knockout is getting a lot cleaner with 1.3 which is in beta.
There are now if, with and foreach bindings that use the inner HTML as the
template instead of having to write the template as a separate script block.

~~~
knotty66
Knockout is also probably being included in ASP.NET MVC 4 - it's in the beta -
which should help it gain traction especially amongst beleaguered Silverlight
developers thanks to it's familiar MVVM / data binding structure.

------
AugenAuf
Cool stuff.I'm keen on creating apps though I'm only a novice in programming
but that doesn't prevent me from making complex and profitable apps.I'm using
snappii.com and consider this service to be the most flexible concerning
design opportunities among its competitors.

------
Aqwis
How is calling it "batman.js" not a trademark violation?

~~~
faitswulff
1) It is not a confusingly similar service or product

and

2) I doubt DC Comics cares

~~~
gerggerg
1) It is confusing. Batman is neither a common word nor name. Without reading
about it you could easily mistake it for a product of the DC comics web team.

2) I'm sure they care about their trademark being devalued through
unauthorized uses.

The real defense batman.js has is that the library is named after a turkish
provence:
[https://secure.wikimedia.org/wikipedia/en/wiki/Batman_Provin...](https://secure.wikimedia.org/wikipedia/en/wiki/Batman_Province)

~~~
dreamdu5t
Trademarks have no application outside of _trade_. If they're not selling
batman.js or seeking to confuse buyers of Batman merchandise, there is no
trademark violation. Especially considering this is a web development
framework, which isn't even remotely related to Batman media.

~~~
gerggerg
Well we both know it's a very large grey area. But while I agree that the
combination of the words bat and man alone could in someway be construed as
non associated with the comic star, using code examples like:

batWatch = Batman currentCrimeReport: Batman address: Batman number: "123"
street: "Easy St" city: "Gotham"

\- and -

jokerSimulator.get("why so serious") #=> "WHY SO SERIOUS, HA HA HA!"

kind of destroys the ambiguity.

Don't get me wrong, I think the technology behind batman.js is interesting and
useful. I just think it's rather unfortunate that they chose a name with such
strong pre-conceptions and that is so childish.

~~~
mhansen
It doesn't matter if it's associated with the comic star, it only matters if
it's in the same area as the trademark.

------
wavephorm
There are so many [yourlibrary]js.org microframeworks out there, and their
feature sets are mostly equivalent, and largely unnecessary for small
projects, that it ultimately becomes impossible to get behind any of them.

~~~
raganwald
Perhaps, instead of asking yourself how this could help you with something you
already do competently, you might try asking yourself “What does this make
possible that was previously painful?”

------
pointyhat
batman -> coffeescript -> javascript. I don't get it.

Too many layers of abstraction.

I'm having serious trouble with even jQuery (with IE7,8 for example) on some
of the stuff I'm working on, particularly on older machines.

