Dear Larry Ellison,

It has come to my attention that James Gosling now works for you. It is my recommendation that you remedy this situation immediately. As justification I present the following Java snippet:

Object obj = new Object(); 
// ...
if (obj != null) {


Do you really want someone working for you at Oracle who designs a language where you must use a binary operator to check whether a reference is null? Consider the obvious alternative:

Object obj = new Object();
if (obj) {


Don't you agree that this is more Zen-like? Me, too. I'm so glad you're in charge now.

That is all.

Best wishes,



Salt Mazes

When I was a [nerdy] little kid, I would draw elaborate mazes over whatever size paper I was given. So, I dig this:




1 out of 3 papers on computer forensics research seems to be about advanced techniques for carving fragmented jpegs from unallocated space.

I am sure that there have been cases where that one hard-to-reassemble jpeg was the key to cracking the case and sending the bad guy to jail for life. However, I feel equally sure that in the vast majority of cases, the problem is not how to recover that one screwy jpeg, but what to do with the hundreds of thousands of jpegs recovered with a simple header/footer search.

Trevor's work on C4P has probably done more for investigators than all the work done on fragmented jpeg carving combined. Of course, research is research, and there is nothing wrong with finding better ways to recover fragmented jpegs. There is something right, though, about applying research to solve pressing problems.

Path overflow

Speaking of linkedin, I came across this article today about the evils of MAX_PATH in eDiscovery:


This article is spot-on for its audience. Practitioners honestly struggle with this in the eDiscovery industry. It'd be funny if it weren't so pathetic. In a day, a good programmer could write a tool to copy files around correctly and deal with long paths and timestamps, and then live off shareware sales for a year.

LinkedIn Lies

LinkedIn is fantastically useful and a great tool—making it easy to stay connected to colleagues, clients, and associates is a killer app. But, geez, the folks who abuse it for shameless self-promotion. I think it'd help if personal profile descriptions were length-limited, so they don't resemble press releases, and if the groups app had filtering and ranking abilities, to eliminate the incessant astroturfing. It'd be great if those of us on the cluetrain could tune out the senseless souls who haven't yet boarded.



I hates it.


git rebase

A very nice introduction to git rebase:


Down the rabbit hole

Show me a developer who never goes down the rabbit hole, and I'll show you a quiche-eater. Yes, it's important to be disciplined and not get constantly lost in depth-first-search coding, but... it's also important to have fun from time-to-time.

One thing I love about git is its support for going down the rabbit hole. You're working on trunk, having fun, writing up a mess of code, and then you realize, gee, it would be Good to checkin, and start climbing out of the hole... but it would be Bad to commit to my trunk, and my working directory is dirty. git stash to the rescue:

cat > ~/bin/rabbit_hole.sh
git stash
git checkout -b $1
git stash apply

git stash essentially creates a private, temporary branch of your dirty working directory, and then resets your working directory. Once this is done, you can create a new branch that's clean, and then use git stash to apply your changes back to the working directory. Now you can commit to the side-branch and work your way out of the hole.

The one danger with git stash that I've run into is if you do not apply your changes, you can build up a long stack of old crap. So, don't do that.


In the field

  • Maj. Gen. Michael T. Flynn's Fixing Intel, a report—and directive—on how to reform military intelligence efforts in Afghanistan
  • Atul  Gawande's musings on how a government health care extension service, inspired by the USDA's extension system, could help improve health care and control costs
  • Also in the New Yorker, Fen Montaigne wrote about warming in Antartica, the threat it poses to Adélie penguins, and Dr. Bill Fraser, 58, an ecologist who has devoted his life to field surveys of Antartica
Sensors, analytics, streaming, and visualization are hot topics these days. The naïve model for how the world will work in the future is that instruments will capture data and stream it to data centers. Some of it will be filtered out; the rest will be stored and crunched repeatedly (at great energy cost) in vast data centers. Data mining algorithms will pick out the interesting bits, make a nice pie chart on your screen and those of your fellow REMFs, and advise you to buy 1,000 shares of Acme Corp so you can profit from the trend (never mind that if information is so cheap to come by, arbitrage will be obsolete), and you can go back to watching Lost. It'll be like 1999, when we all had internet businesses that idly filled our bank accounts while we sat on our patios on Tahoe and sipped Chardonnay. 4 Hour Workweek, here we come!

Realistically, the centralized model will result in yet another warehouse. If there is any value to be had in collecting all this data, it will only be in forwarding it to those few in the field who are doing the real work, who already know the truth intuitively but need data for winning arguments, and providing them with the tools to analyze the data and find collaborators.


If worse is better, does that mean awful is best?

A few more thoughts on Alex's post, which is still reverberating around the blogosphere.
  1. View source was necessary, but not sufficient. Simplicity, in the form of a single level of abstraction, was also necessary. JavaScript, CSS, namespaces, microformats and whatnot add indirection and abstraction, and hence power, but... being confronted with multiple concerns from the get-go is not a good way to learn something new.
  2. HTML5 removes support for some old, old, old tags, and instead requires folks to use CSS for styling their web pages. CSS is undoubtedly the right way to format html. But for Microsoft Word users, maybe 5% of whom know how to use style sheets, will requiring the use of a whole 'nother standard—and a level of indirection—just to italicize or embolden a word be a barrier to entry? Um, yes.
  3. To the casual observer, HTML5 appears to be what we here in our nation's capital like to call a Charlie Foxtrot. Will all the contention and confusion hinder adoption? Um, yes.
  4. There's probably a reason why php is so popular, even if it is incredibly awful. Just like how BASIC, with its GOTOs, was popular.
There is a virtue in directness, and it is a low barrier to entry for newbs. Yes, it leads to awful source. That's why the narrative of every decent beginner's programming book is essentially a gradual increase in the use and understanding of abstraction. When folks have a dozen <font> tags they have to change, that's when you introduce CSS.


A dynamic languages canard

It was a nice zinger several years back, it's lingered on for the last few years, and, in 2010, it's tiresome and needs to die. The latest occurrence is in Alex Russell's otherwise-excellent post, "View Source is Good? Discuss.":

"This is a stark contrast with other types of development, notably those that impose a compilation step on development, in which the process of seeing what [was] done requires an intermediate action."

If you read the tubes, you'll see this idea repeated, that a big advantage dynamic languages have over static languages is that they simply remove the compilation step and you end up being more productive as a programmer. Some latency gets eased out of the system and you can remain in that wondrous state of "flow" (man, I hate that word; psychologists, is there a better word for focused attention than "flow"? I'd really like to use it if there is one. I hate it almost as much as "energy" when used to describe emotional states and/or personal vigor, e.g. "this room has so much negative energy", "yoga fills me with positive energy"... really? how many joules worth? you have a keen sense for and the ability to exploit ionization? Maybe you should give Prof. Xavier a call. But I digress...).

In 2010, if compilation is slowing you down, it's not the language's fault: it's your's. Your build sucks, or your program's architecture sucks, or maybe your libraries suck, or your tooling sucks. Go watch the Go video. Install ccache. Learn how header files and the preprocessor works. Heck, sure, go off into rubyland and not deal with it; but assign the blame appropriately.

  • Python: rocks!
  • C++: also rocks!
(Does that blow your mind? That just happened!)

Is typing "make test" really all that different from having to reload page source?


Howto git to a tabula rasa

git reset --hard undoes any changes to tracked files in your working directory and restores them to their versions at head of the branch. However, it doesn't remove untracked files from the working directory. For that you need git clean -x -d -f. To blow away all the cruft in your working directory and restore it to a pristine state, you need to do both.

cat > ~/bin/gitnuke
git reset --hard
git clean -x -d -f


Reflection and Serialization

It is fun writing C++ again, but it is no fun writing serialization code in a language that lacks reflection. Being able to treat a nice, concrete object as a map and just iterate over fields is a huge win. The success of RoR's ActiveRecord ORM, and its followers, make this statement boringly inarguable.

I need to dig more into Go's capabilities in this regard, tho' I don't see reflection right off the bat. For a lot of things, you don't even need runtime reflection. Most (but not all) template metaprogramming in C++ is just sizeof() pyrotechnics to enable some limited reflection.


Howto build Boost libraries without installing headers

Here we go...

./bjam --stagedir=/place/to/put/a/lib/dir --with-lib_I_want_to_build link=static variant=release threading=single stage

Of course, you can make the properties what you want. Bjam will place the libraries within a 'lib' sub-directory of the stage dir you specify. Do a normal bootstrap; there doesn't seem to be a need to use --with-library=foo when running bootstrap.sh or to specify any prefix or lib dirs.


Memo to Boost

No one--no one--likes Boost Jam. Did you really have to get rid of configure and make?

Many of the Boost libraries are brilliant. It would be hard to live without Boost. It is not always easy living with Boost, however. Some of the libraries seem like grad student projects (which they almost certainly are, but the problem is that they seem like it) and the development structure is too much of a walled garden.

Build systems tend to be a domain where worse is better. I avoid makefiles like the plague, but I'd prefer to hack lightly on a makefile in order to do what I want rather than learn the syntax and structure of the latest Martian build system in order to do something simple, like build and install the libraries I want without copying thousands of header files.