Screen Shot 2014-01-07 at 4.46.16 PM
Chocolat is an ambitious programmer’s text editor, but it falls short (at least right now) in lots of little ways. E.g. integrating web-based documentation is a nice touch, but what about jQuery?

I discovered Chocolat by accident a month or so back. I can’t exactly remember how I learned about it — I saw a reference to it when reading the documentation of another product I use (I think it might have been Ulysses III) and so I gave it a spin. There was — and remains — a terrible problem with the way Chocolat identifies symbols in Javascript files, and I got into a bit of an argument with one of the developers on github over it, and set it aside. The thing is, Chocolat is an opinionated piece of software, and the downside of that is that one might not like all the opinions. E.g. in their FAQ is the question “will you add a minimap?” the answer to which is “Never!” That said, I like most of Chocolat’s opinions.

Well, there’s a new MacHeist “nano” bundle out and it’s particularly interesting for developers since it includes Hype (the would-be HTML5-based Flash replacement), Chocolat (a new programmer’s text editor which has a lot of potential), and — if some unknown number of people buy the bundle — PaintCode. I should mention that I bought the bundle for PaintCode and then realized it wasn’t actually included. Grrr. Oh well, Chocolat for $20 is actually a pretty good deal.

Here’s what differentiates Chocolat from my two favorite text editors (BBEdit and Sublime) right now:

Chocolat's symbol map is great when it works.
Chocolat’s symbol map is great when it works.
Chocolat tries to show a "symbol map" of your source file, but can't cope with code modules wrapped in anonymous functions (which unfortunately means most well-written Javascript library code). Note the empty rectangle where symbols should be.
Sadly, Chocolat can’t cope with code modules wrapped in anonymous functions (which unfortunately means most well-written Javascript library code). Apparently there are no functions in this source file.
  • Chocolat displays a symbol map (i.e. a list of object and function definitions you can use for quickly navigating source files) — the map is nice, but functionally it’s inferior to BBEdit (which can find symbols declared inside anonymous functions). Espresso remains the best in this respect, since it not only finds all the symbols you could ask for, it displays a nice symbol map too.

Screen Shot 2014-01-07 at 5.03.38 PM

  • Rather than giving you the choice of viewing two files side-by-side or one file, Chocolat lets you look at as many files as you care to side-by-side simply by selecting them.
  • Chocolat attempts to autocomplete Javascript (and does a pretty good job of it, including inferring the expected types for function parameters, and allowing you to tab around auto-inserted method calls TextMate-style). The only downside is that only works on currently open files. I imagine it’s even better with Obj-C (but haven’t tried).

Screen Shot 2014-01-07 at 5.07.14 PM

  • Chocolat attempts to integrate Safari (complete with debugging tools) by displaying it side-by-side with your code. This works pretty well.
  • Chocolat attempts to provide integrated documentation (e.g. select queryGetSelectorAll in a Javascript file and hit Command-Shift-J and it will look it up on MDN and show the documentation side-by-side with your code.
  • Chocolat does not attempt to integrate source control (git, hg, svn, p4, etc.) — I actually like this because I don’t want my text editor to do source control.

 

8 errors. Thanks.
8 errors. Um, ok. Thanks, I guess.

 

  • Chocolat is scriptable via Node.js. (Sublime is scriptable via Python, which is awesome too, but doesn’t happen to be the language I code in every day.) So far the available “mixins” seem pretty primitive (e.g. the jshint mixin tells me that there are “12 errors” in a file, but gives me no clue where or what they are).

For a while I thought Chocolat was a bit sluggish, so I started checking for signs of bloat. I did a quick comparison and BBEdit is actually the leanest of the three editors at 26MB on disk; Sublime 2 is 27MB, Sublime 3 is 28MB, and Chocolat is 34MB. Espresso, incidentally, is 18MB. But it turns out that the problem is I was using a “slow monitor” (i.e. my third monitor which is hooked up using one of those USB dongles). After comparing Chocolat, BBEdit, and Sublime on this display I concluded that BBEdit is even more awesome than I realized (because it appears to do minimal screen updates when scrolling), Chocolat is not bad at all, and Sublime is actually the worst. Again — avoid using USB-powered displays for editing text and you won’t care.

So here’s how it looks right now: Chocolat has the potential to become my favorite text editor since it’s heavily based on Javascript which means anything it doesn’t do well right now I can probably fix if I care to. BBEdit is the most polished, but the hardest to customize. Sublime remains — of course — the coolest, although given that Chocolat has support for both side-by-side editing, supports TextMate themes and snippets, and has “vim mode” it might take that crown, at least on Mac OS X.

But, Chocolat’s multi-file search is far inferior to BBEdit’s (it’s about on par with Sublime’s), its Regex support is also signficantly inferior to BBEdit’s, and it has no diff support (whereas BBEdit is my preferred tool for resolving differences between source files) — although I’m perfectly happy to use BBEdit as a dedicated diff front end, and do my text editing elsewhere.

Chocolat ★★★★★ is $49 normally, currently available as part of Macheist Nanobundle 4 ($20).

I may review some of the other apps in the bundle later. In particular I have strong — mostly negative — opinions of Hype and Intensity Pro.