Recently a colleague asked me why I’m so against using singletons… why do I think they’re so bad. The answer is quite simple… when you use a singleton you’re essentially saying that your object accepts this dependency and only this dependency, it will take no substitutes. Since the dependency isn’t substitutable, it’s difficult to swap [...]
Archive for the ‘Thoughts’ Category
Code Comments: The Lowest Form of Communication
Recently I’ve been working with lots and lots of legacy code written by lots and lots of people who have been separated by lots and lots of distance between them. As a side effect, a lot of the code has comments that either explain what is going on, rationale behind doing it, and sometimes even [...]
Google Adds Result Ranking
I was doing some random searching for jQuery when I noticed that google added some kind of new reddit like ranking system to SERPs. Although I like the idea, I’m wondering how they’re protecting such a system from underhanded SEOs? It’d be trivial to write a bot to promote SERPs all day long, but of [...]
Why Do We Continue To Implement Bad Features?
While I was reading through my RSS feeds today I came across a post by David Walsh describing how to make a link to set the current page as the users home page (bad feature) with the remark: The unfortunate part about creating websites for customers is that no matter what recommendation I make, if [...]
Where Is Java Going to Go From Here?
Ever since I attended the NFJS Gateway Symposium almost 2 years ago, I’ve been hearing the same theme over and over: Java is the new COBOL. Everywhere you go, you can’t seem to avoid hearing this. An ex-coworker commented when I ran into him at Agile 2007: “I’m surprised you guys aren’t using JRuby.” Two [...]
What It Takes to Get In the TDD Mentality
Uncle Bob recently made an interesting post on TDD and test generators, and I couldn’t agree more! I’ve always despised test generators myself, mostly for the same reasons Martin makes. In my opinion, desiring to use a test generator on fresh code is an attempt to cut corners and bypass testing, which really is counterproductive. [...]
Using AOP for Measuring Elapsed Time
Recently I’ve been knee deep in some legacy code doing a fair bit of refactoring, and one of the patterns I keep coming across is processes that need their elapsed time measured. You know what I’m talking about… a procedural mess shock full of primitive obsession all over, something like the following (except imagine that [...]
JRuby, Groovy, and Other Dynamic Languages On the JVM
Lately (thanks to Spring) I’ve been toying with dynamic languages a little bit running on top of java. I haven’t delved into JRuby on Rails yet, but I have been using them as scripted beans injected into java classes, largely in a way that exposes an application API to either a scripted environment, or to [...]
Accidental DSL
Something kind of funny happened on a project that I am currently wrapping up at work. We had been doing acceptance testing with fitnesse, and written many custom fixtures that were specific to the domain problem (DoFixture is great for this). Further, there were quite a few RowEntryFixtures, SubsetFixtures, and RowFixtures that provided quick and [...]
A Tale of Two Teams
As anyone who reads this blog knows, I’m an extreme programming enthusiast. I love pair programming, test driven development, and the constant communication with customers. it’s one of the reasons I took up a job at my current employer, because it is an “Extreme Programming Shop.” However, for awhile now I’ve heard a bit of [...]

