Blog

Thursday, August 25, 2011

Continuous integration and dependency management

Unless you're using Maven or Ivy to manage dependencies on external jars, you're not doing continuous integration.

You have to keep up with new releases of external tools or you will lose support (blog and forum posts are more likely to address issues with recent releases). But worse, you will end up boxed in if you need some additional component that only works with a newer release. And there will always be newer releases, so while you could argue that there might be a component that requires and older release, the likelihood of something cool, modern and worthwhile being tied to an old release of a shared lib is pretty remote.

Big Bang integration is a pain. So do continuous integration and manage your deps.

Wednesday, August 10, 2011

Knowing is not acting

I know, I know. Doesn't mean I do the right thing.

Many times I have felt puzzled and even miffed when someone smart invents something that I think is obvious. "I coulda done that!"

But the fact is, I didn't.

Knowing is not doing.

Tuesday, May 03, 2011

Programming while stupid

A significant benefit of test-driven development (TDD) is that you don't need to work very hard. Now turn that idea around: when you cannot work at your full capacity, you can still be productive and produce well designed, working code.

TDD reduces cognitive load by encouraging small steps and by capturing the precise requirements for a piece of code in the test's assertions. Typically, that allows us to devote more of our energy to other important matters like clear design, intention-revealing code and delivering value to the customer.

But what if you're tired? What if you're just not at your best? It happens; we're human! Sleep deprivation makes us stupid. So does stress.

How are we supposed to program while stupid?

Maybe you have a teething baby. Maybe you got into an accident on the way to work. Maybe the office is absolute Bedlam today. Maybe you're hung over. (Note: I have never experienced this latter phenomenon, though I believe I may have read about it in books.)

The rhythm and structure of TDD provide enough support that you can still be productive. Granted, those "extra cycles" will not be available to perform the higher level functions we mentioned, such as keeping an eye on the broader design of the code. But at least you'll be able to function. You will be able to program - without embarrassing yourself.

Contrast this with situations in which intense focus and concentration are an absolute requirement for producing any code at all.

Before I learned to TDD, I would keep large chunks of infrastructure in my head. Needless to say, such a volatile storage mechanism had to be treated with great care. An overheard conversation or a phone call could cause enough of a distraction that I would lose track of what I was trying so desperately to keep aloft. I'd get frustrated and angry. Back in my wilder youth, I'd often call out loudly for peace and QUIET!!

And what about the morning after a colicky baby all-nighter? You've made it in to work. You want to sling some code. You have a moral and ethical obligation to do something useful to earn your pay. But keep a complex design, a lofty edifice, a convoluted algorithm in what remains of your battered brain? Not gonna happen.

So don't even try. Take baby steps, write the asserts first, be modest and methodical and your work-ethic conscience is assuaged.

I still don't enjoy distractions, and having learned a lot more about neuropsychology over the decades, I decry the misplaced affinity for multitasking that some people seem to think is a necessary part of modern life. But I can happily walk away from a red test, knowing that I can pick up at any time and, by continuing to take baby steps, finish what I was doing.

Interruptions are more tolerable with TDD. A trance-like focus is no longer a basic prerequisite for programming.

And TDD cures hangovers.

Sunday, April 10, 2011

How to Integrate Jenkins monitoring into Eclipse

Install the Hudson/Jenkins Mylyn integrator to see build status in Eclipse.
  1. Add this update site to your Eclipse: http://download.eclipse.org/mylyn/releases/latest/ It's still in "incubation" so it seems it's not available in the regular download site yet.
  2. Under Mylyn Integrations, select and install "Mylyn Builds Connector: Hudson/Jenkins (Incubation)"
  3. Once it's finished installing, use Window > Show View > Other... to select the Mylyn Build window
  4. Select the blue cylinder representing "Add new build server" from the task bar.
  5. Enter the info for the Hudson/Jenkins server and voila!
It's pretty nifty, too. Not only do you see build results, but you can view test results in the regular Eclipse JUnit view, examine the build's console output, view the changes for that build – in short, see pretty much all you see in the regular Jenkins web UI, but laid out in better (?!) and integrated nicely with Eclipse. Recommended.

For more info, see the Mylyn site.

Friday, April 08, 2011

Bookmarklets break MobileMe sync

Bookmarks weren't syncing between my iOS devices and my desktop machines, but I managed to find a solid description of the bug and a good workaround. In short, do not add bookmarklets on your devices. Instead, add them on the Mac and let them sync across. The message I was getting on the Mac side was "You need to replace your Bookmark Information on MobileMe" with two buttons: Fix Later and Replace.

The problem ostensibly lies with improper URL encoding of bookmarklets on the iOS side, which results in "corrupt" data in the cloud. The devices don't know or complain about this, but Mac OS does.

What I did was to delete all but my most useful bookmarklets on my Mac, then sync just the bookmarks. Everything works again!

Thanks to this discussion, the fix was pretty simple.

Note the dates on those postings. Sigh. I am so sick of MobileMe sync bugs!

Twitter Updates

Facebook

Blog Archive