and do some other stuff too, sometimes

September 20, 2014 — 2:14 AM UTC

So, to get it out of the way: there is a fairly large segment of the Java community whose reaction to a Java-style singleton object is to hold their nose and go fleeing in the opposite direction, pausing only to git blame to know who to come back for and settle accounts with later. I know this because we all have Singleton Haters Club cards and the meeting is at the corner bar every Tuesday evening. But this post is largely in spite of that.

The topic of singleton initialization came up today. There are a lot of bad ways to initialize a singleton and I got to see a couple of them up close and personal today; that there are ostensibly principal-level Java developers who haven’t internalized Effective Java is a surprise but nobody’s perfect. Anyway, without further ado, lemme give you the wrongest (vaguely working) way to do it that I can think of.

My name's Ed, and I run a little devops consultancy; my thing is making other developers better and making the systems I oversee smarter, faster, and more reliable.

But I'm a human first. So I'm more interested in that. Tech is part of but not all of my life, and I'd rather talk to you about books or music or video games than about code or rapid deployment. I sometimes write about those things when they're interesting, but I'm much more into the questions of how we as technologists can be better citizens and contributors to society.

Some friends and I also do some goofy video stuff, which you can find on Twitch and YouTube.