

Announcing the first release of batman.js - nciagra
http://batmanjs.org/2011/08/23/i-am-the-batman.html

======
bprater
From the site: "It gives us great pleasure to finally announce the release of
batman.js to the JavaScript community today. This release represents the first
code dump of something we’ve been working hard on at Shopify for a long time,
so we’re very excited to get it into your hands and see what you do with it."

I got zero value out of this lead.

When you launch a product like this, please tell us why we'd want to use this.
As developers, we don't have a bunch of time to parse your project notes.
"It's like XXX, but offers these advantages..." At this moment, I don't know
what batman.js is actually useful for!

~~~
nciagra
Sure, I'll break it down: batman.js is a JavaScript framework for rich
JavaScript applications. It's designed to make development as fast and as
painless as possible for developers and designers while giving them lots of
power.

We designed everything around a number of primary goals such as convention
over configuration, HTML-based views, and the principle of least surprise.
This is something we're using at Shopify in our future projects, so it's
meeting those goals while coming out of real work.

If you want more info, the features page (<http://batmanjs.org/features.html>)
has a list of everything we're trying to do, and the examples page
(<http://batmanjs.org/examples.html>) has a few usage examples. There's still
only a couple, but I'm working as quickly as possible to build out the
gallery.

And of course, let me know if there's anything else I can answer about the
framework. I hope that helped clear it up a bit, though!

~~~
sirclueless
"batman.js is a JavaScript framework for rich JavaScript applications. It's
designed to make development as fast and as painless as possible for
developers and designers while giving them lots of power."

That sounds like a pitch I would give a non-techie manager or client. Someone
who's been around computers enough to know that javascript is the thingie that
makes web pages do stuff.

Your target audience is developers, yes? We can take it. The first thing in
your pitch should be how it helps, not "We'll save you lots of time, we
promise. Trust us!"

~~~
marknutter
Man, tough audience.

------
akavlie
This sounds more or less like Backbone.js. How does it compare to that?

The name is amusing, but a bit silly --

"What are you guys using for all of your cool AJAXy stuff?"

"Batman."

------
timothya
I'd like to see some examples in JavaScript, instead of CoffeeScript. Since at
this point only a smaller subset of developers use CoffeeScript, I think it
might be overall useful to more people if the provided examples used plain
JavaScript (that, and CoffeeScript developers tend to understand JavaScript
already, and may already be used to converting one to the other).

~~~
goodside
The subtext is that you should learn CoffeeScript. It's an alternative syntax,
not a new language.

They wrote you a nice library and are giving it away under an MIT license. You
don't get to pick the style they use to write the examples. That's like going
to a science lecture and walking up to the speaker afterwards to say, "Hey, I
think you have some great theories, but you really should lose that Australian
accent of yours. Most scientists aren't from Australia, you know."

~~~
masterzora
_They wrote you a nice library and are giving it away under an MIT license.
You don't get to pick the style they use to write the examples._

This is a response to something nobody's saying.

Obviously if they write it they get to choose pretty much everything about it.
Nobody is disputing such a thing.

However, if one of the goals in releasing this is to be maximally useful,
isn't the fact that raw Javascript is more readily understandable to more
people a good thing to point out? Especially since it's highly likely that the
team actually has the ability to do normal JS just as easily.

If they disagree with such a goal, though, they can feel free to do whatever
they want.

~~~
goodside
Nobody who knows CoffeeScript needs to be informed that JavaScript is more
mainstream.

~~~
masterzora
Perhaps not, but that doesn't necessarily imply that the use of CoffeeScript-
only examples was a calculated move to reach the audience they wanted instead
of whatever came to mind first. It's worth at least reminding them that JS
examples might be more useful to more people and letting them decide
consciously whether they care.

~~~
MatthewPhillips
They use coffeescript's class inheritance. Here's the JS that compiles down
to:

<http://jashkenas.github.com/coffee-script/#classes>

If they showed JS examples it would instantly turn everyone off. Trust me, you
do NOT want to use this with JS.

------
chrisbroadfoot
It says it's for JavaScript, but I don't even know what language the code
example is in. What _is_ this?!

    
    
        # Create our application and namespace.
        class Alfred extends Batman.App
          @global yes
          @root 'todos#index'
    
    
        # Define the principle Todo model with `body` and `isDone` attributes, and tell it to persist itself using Local Storage.
        class Alfred.Todo extends Batman.Model
          @global yes # global exposes this class on the global object, so you can access `Todo` directly.
    
          @persist Batman.LocalStorage
          @encode 'body', 'isDone'
    
          body: ''
          isDone: false

~~~
frisco
CoffeeScript

~~~
chrisbroadfoot
Right, I just read the comments below. There's no mention of CoffeeScript
anywhere.

CoffeeScript is _not_ JavaScript. If it's a JavaScript framework, please give
code examples in JavaScript.

~~~
sunchild
CoffeeScript compiles to Javascript. Batman.js can _most certainly_ be a
Javascript framework and give examples in CoffeeScript. Many people prefer
CoffeeScript for a variety of reasons, including readability.

Also, you aren't entitled to dictate instructions to other people who are
giving you the benefit of their hard work. It's rude and obnoxious.

~~~
mcantor
Maybe the guy you're replying to edited his post, but "If it's a JavaScript
framework, please give code examples in JavaScript"--to me--reads as a rather
polite request, rather than a dictum as you suggested.

~~~
pbreit
But there are other problems with the comment.

 _There's no mention of CoffeeScript anywhere_

It's in the 2nd paragraph of the docs. Not prominent, but somewhere.

 _CoffeeScript is not JavaScript_

Technically true, I suppose, but they are beyond related.

 _If it's a JavaScript framework_

Maybe it's a CoffeeScript framework? My sense is that at the very least, the
use of CoffeeScript is an important aspect of the project.

------
nciagra
Hey guys, happy to take any questions you have about the framework, either
here or in IRC. We're on freenode in #batmanjs

------
paulocal
PLEASE:

body{ color: #000000; }

Thankkk you!

Other than that, looks cool! Definitely will be trying it out in my projects
and reporting back!

~~~
nicklovescode
p { color:#222; } will do

~~~
ktusznio
Changed that, thanks.

------
jackdempsey
hey Nick,

Great to see it released! One thing I always find helpful is a
comparison/discussion of where it fits with others in this realm.

congrats, Jack

~~~
pspeter3
I agree, especially how it compares to express.js which seems to currently
dominate app design for node.

------
stdbrouw
The templating layer looks eerily similar to Zope Page Templates / TAL (see
<http://chameleon.repoze.org/>). Old-skool, baby! :-)

Anyway, it's like the love child of Backbone.js and jQuery Mobile, and perhaps
more intuitive than both. I'll definitely play with it some tomorrow to see
whether it holds up to its promise.

------
southpolesteve
This seems like a horrible way to do things. I really don't want to throw a
ton of loop logic (data-foreach?) and other data attributes in my HTML.

I think all of the JS MVC frameworks will be short lived. Someone (hopefully)
will develop with a real soup to nuts solution that will make writing a front
end heavy app simple. In Rails, I can see it being as easy as
"act_as_front_end" somewhere, and the app automatically serves up your JSON to
a generated frontend that mirrors your Rails app. I know that would be a hard
thing to make, but this is where things should converge.

------
kpozin
I suspect DC Comics and/or Warner Bros may be getting in touch soon.

------
jashkenas
Although we had a great talk about it at JSConf, I don't remember if Shopify
is using it in production yet ... Which bits of Shopify is it currently
powering?

~~~
nciagra
A number of Shopify future products are being/have been built from the ground
up using batman.js :)

~~~
transition
Much like the description of the framework i think people are looking for a
more specific answer to this question. I'm starting to think you are a super
hero yourself. Captain Vague we'll call you.

~~~
Pickels
I mostly try a framework to see what it can do. Looking at the documentation
it seems like they are good enough to get me started.

Not sure what all these negative comments are doing here. Feels like half the
people are asking for somebody to hold their penis and the other half is
crying because they can't read Coffee-Script.

------
exogen
This looks fun. We (at BigDoor) have built some of these same pieces using
Knockout (<http://knockoutjs.com/>) as a starting point. I'll be trying this
out for comparison in some prototypes for sure.

~~~
Pickels
I also use knockout.js for a project and batman.js looks like it has some
similarities but it seems to be filling some holes that knockout.js leaves you
to fill your self.

~~~
exogen
Which, I think, is not a huge deal with Knockout, just a difference. In our
case we're using it for widgets included on other people's sites, so it's not
a conventional web "application" with "pages" (I don't think we'd use the
routing bits of batman.js at all, for instance).

------
dholowiski
<http://xkcd.com/851/>

------
smoody
What are your target supported browsers/versions?

~~~
ktusznio
We're targeting Chrome, Safari 4+, Firefox 3+, and IE 7+ for compatibility,
although some of those require you to include es5shim.

More details in the readme here:
<http://github.com/Shopify/batman/blob/master/README.md>

------
dmboyd
Awesome, now to think of a small project to try it out.

