Announcing bindinator.js

Grant will get you one month of Adobe Creative Cloud with an annual commitment
I love Adobe and its products, despite their eccentric UIs, awful installers, and the mystery that is Bridge. The fact is Adobe knows its shit and does it better than anyone else. However, while for many years I considered myself a "power user" of Photoshop and competent enough with Illustrator, the capabilities of Photoshop have long outstripped my needs, and Adobe's marketing team has done a remarkable job of alienating me with pricing shenanigans.
My first experience with Adobe Software was learning to use Illustrator 88 in a production environment — mainly tracing logos. I was introduced to Barneyscan (the program that became Photoshop) when the multimedia startup I joined acquired a Barneyscan Slide Scanner. We soon discovered that Barneyscan was actually a very capable graphics program that was better for handling 24-bit color images such as scanned photographs than anything else on the market.
Then Fractal Painter and Color Studio came out and, briefly, it was a three horse race. When Photoshop introduced, in quick succession, a better implementation of Painter's layers and editable text layers, the competition fell by the wayside. Other competitors, e.g. Macromedia's ill-fated xRes, the amazing Live Picture, and Microsoft's Expression Studio, came and went.
Despite its many virtues, I couldn't justify buying my own copy of Photoshop until it started being bundled with scanners. I literally paid $500 for a scanner and didn't use the scanner in order to get Photoshop 4. Adobe's upgrade pricing led to my upgrading Photoshop as each new version came out until Adobe got me to upgrade to Creative Suite for not much more than the cost of just upgrading Photoshop, but then made further upgrades horribly expensive (and also made skipping versions very expensive). My last CS purchase was CS4 Web Pro academic (I was working for a University at the time) just after Adobe announced that anyone buying CS4 would receive a free CS5 upgrade.
Over the years, Adobe's other applications rose and fell in my esteem. I used Premiere for years, and once found After Effects to be an unbeatable combination of power and usability — I haven't touched either in years, and Apple's $50 Motion does everything I need. (Indeed, I don't have any use for Final Cut Pro, either.)
Now Adobe is essentially offering us three options: pay $50/month to get access to all Adobe software, pay $20/month to get access to Photoshop (both require one year commitments, it's higher if you go month-to-month), or somehow get academic pricing for $20/month to get everything. The plans also come with 100GB of cloud storage (which would cost you $10/month on its own from Dropbox — of course Dropbox's 100GB is a lot more flexible).
So for me, that means it's time to kiss Adobe good-bye. (Except for Adobe Ideas of course — I love Adobe Ideas.)
Alternatives to Adobe's key products
- Photoshop: Acorn (Mac), Photoline (Mac/Windows), Pixelmator (Mac), Paintshop Pro (Windows), Painter (Mac/Windows)
- Illustrator: Inkscape (Mac/Windows/Linux), iDraw (Mac), CorelDRAW (Windows), Intaglio (Mac), Lineform (Mac), Artboard (Mac), ZeusDraw (Mac), EasyDraw (Mac)
- Dreamweaver: a good text editor (e.g. BBEdit (Mac), Sublime Text (Mac/Windows), Vim) or web-centric IDE (e.g. Webstorm (Mac/Windows), Coda(Mac))
- Fireworks: no direct replacements that I know of, but UI-oriented graphics apps like Sketch (Mac) seem like replacements to me.
- InDesign: Pages (Mac), TeX or Latex (Mac/Windows
</style>
<div>
<!-- markup goes here -->
</div>
<script>
</script> All the parts are optional. E.g. a component need not have any actual
When a component is loaded, the HTML is rendered into DOM nodes, the script is converted into the body of a function, and the style sheet is inserted into the document head. When a component is instanced, the DOM elements are cloned and the factory function is executed in a private context.
Debugging
Bindinator is designed to have an incredibly short debug cycle, to add as little cognitive overhead as possible, and work well with debugging tools.To put it another way, it's designed not to slow down the debug cycle you'd have if you weren't using it. Bindinator requires no transpilation, templating languages, parallel DOM implementations, it's designed to leverage your existing knowledge of the browser's behavior rather than subvert and complicate it, and if you inspect or debug code written with bindinator you'll discover the markup and code you wrote where you expect to. You'll be able to see what's going on by looking at the DOM.
Maintenance
If you're productive, write reusable (and hence DRY) code, and your code is easier to debug, your codebase is likely to be maintainable.Scale
Bindinator is designed to make code scalable:Code reuse is easy because views are cleanly separated from business logic.
Code is smaller because bindinator is small, bindinator code is small, and code reuse leads to less code being written, served, and executed.
Bindinator is designed for asynchrony, making optimization processes (like finessing when things are served, when they are loaded, and so forth) easy to employ without worrying about breaking stuff.
Core Concepts
Bindinator's core concepts are event and data binding (built on the observation that data-binding is really just event-binding, assuming that changes to bound objects generate events) and object registration (named objects with properties accessed by path).Bindinator provides a bunch of convenient toTargets — DOM properties to which you might want to write a value, in particular value, text, attr, style, class, and so forth. In most cases bindings are self-explanatory, e.g.
data-bind="style(fontFamily)=userPrefs.uiFont"
There are fewer fromTargets (value, text, and checked) which update bound properties based on user changes — for more complex cases you can always bind to methods by name and path.
Components are simply snippets of web content that get inserted the way you'd want and expect them to, with some syntax sugar for allowing each snippet to be bound to a uniquely named instance object.
And, finally, b8r provides a small number of convenience methods (which it needs to do what it does) to make it easier to work with ajax (json, jsonp), the DOM, and events.
The Future
I'm still working on implementing literate programming (allowing the programmer to mix documentation, examples, and tests into source code), providing b8r-specific lint tools, building out the standard control library (although mostly vanilla HTML elements work just fine), and adding more tests in general. I'm tracking progress publicly using Trello.