8 ms·
How Batman.js can Help you Build Apps
- ktusznio 15y agoBefore 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 15y agoIt 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 15y agowell, 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 15y agoWhile 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.)
- asolove 15y agoNo, jQuery.extend copies properties. It is not the same as CoffeeScript's extend, which uses prototypal inheritance as well as copying static properties.
- DanielRibeiro 15y agoExtends is compiled into JS. You can add it to Batman: var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; Batman.extends = __extends
- deleted 15y ago[deleted]
- wavephorm 15y agoThere 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 15y agoPerhaps, 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?”
- Aqwis 15y agoHow is calling it "batman.js" not a trademark violation?
- faitswulff 15y ago1) It is not a confusingly similar service or product and 2) I doubt DC Comics cares
- gerggerg 15y ago1) 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_Province https://secure.wikimedia.org/wikipedia/en/wiki/Batman_Provin...
- dreamdu5t 15y agoTrademarks 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 15y agoWell 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.
- gerggerg 15y agoNo 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 15y agoMy team's core language is named after a surrealist British comedy troupe ;-) http://en.wikipedia.org/wiki/Monty_Python http://en.wikipedia.org/wiki/Monty_Python
- encoderer 15y agoSeriously? I think many here are thankful they're not working wherever it is you work.
- kveykva 15y agoI 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 15y agoTemplates 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 15y agoThe 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 15y agoKnockout 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.
- knotty66 15y agoAlso Batman has Rails style generators that create a familiar directory structure and a built in server. They're both really neat.
- encoderer 15y agoIf 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.
- pointyhat 15y agobatman -> 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.
- ethank 15y agoSo is there a good grid comparing batman.js with backbone and knockout.js?
- dickeytk 15y agoIt 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 15y agoYeah, 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 15y agoI 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.
- erichocean 15y agoIn 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.)
- AugenAuf 15y agoCool 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.