Breaking Up with IoC Containers

Straight Up
 
I've stopped using or caring about IoC containers. I used to use them because they were so quick and easy and they kept my code looking pristine and beautiful. Now I do manual dependency injection and the results on non-trivial systems are very interesting and look even more beautiful. At the end of the post we'll examine a little bit more of why I left them behind. In the meantime, I've probably left you wondering what the heck I do to keep things from getting out of hand. "What about the times when you have to inject a dependency through five other objects before it gets to where you need it??" Yeah, we'll get to that.
 

Read the rest of this post »

Message Oriented Object Design and James Shore's Challenge

James Shore posted an architectural challenge this week on his blog and personally threw his gauntlet in my face to answer the challenge using this message oriented design stuff I've been ranting and raving about. Of course when I say "threw his gauntlet in my face" I really mean he said it might be interesting to see... BUT STILL! A man can't back down from that! ;)

Read the rest of this post »

Message Oriented Object Design and Machine Learning in Javascript

This article will show how to use Message Oriented Object Design (not unlike Message Oriented Programming aka MOP or Actor Model) to model your user interface as an actor and handle some more complex processing while updating the user interface. Specifically, the sample code implements a simple machine learning exercise wherein you enter any character on your keyboard and the program attempts to guess what you chose (without cheating ;).
 

Read the rest of this post »

Katas for Practicing Refactoring

Problem

I've tried to do the various TDD katas found laying around on the web (not dissimilar to those found here: http://codekata.pragprog.com/) and found I have a couple issues with most of them. First it has to do with what I perceive a kata to be.

A kata is a choreographed set of movements that are practiced ad-tedium so that they come almost instinctively, one after another. They are very narrow and focused. There is no real problem solving to be found in them.

In completing some of the various katas I've found on the net, I've noticed they are more complex than I'd like, but also, in the end, I don't really know that I've done it right. It's extremely easy for me to get off track. I also never know why I'm doing it. What am I learning? Am I learning?

It's important to note that I'm not saying the TDD katas out there are broken, if they work for you then I don't recommend you stop them although you may still want to give these a try. I'm really just saying that they are broken to me.

Read the rest of this post »

TDD-ing Concurrent Code

A Method for Modelling Concurrency
 

I'm prepping code for Code Camp Boise and Seattle and I thought I'd share some of the simple stuff I'm writing as I'm writing it to act as an introduction of sorts to the concepts.

 
I hear a lot of people say things like "Well we made this process concurrent so now we can't test it." That just always felt wrong to me. Over the past year or two, as I've been reading about threading though I've kept this in mind. Like any concern, it's difficult to test without taking it into account if the concern isn't abstracted away from the code under test.
 

Read the rest of this post »

A TDD Practitioner's Pragmatic Argument Against 100% TDD

Not writing unit tests can drive more value than writing them if one
makes a good gamble. More often than not TDD pundits argue that if you
don't have tests you can't easily and rapidly discern a buggy system
from a solid one. They claim you can't effectively explore your code
base by utilizing the tests for hypothesis testing. They claim that
it's risky and wasteful.

They're half right.

Read the rest of this post »

The Best Way to Learn the Art of DO...?

Can't make any forward movement standing still... sometimes I find myself forcing me to move forward even if it's to some place I don't want to go, simply because it's the best place to go for right now. My fixation is on moving, expending energy even when it isn't economical to do so. My entrepreneurship class is one such example.

Is it a sunken cost? Should I just drop it and focus on my business without that class as a worry? It doesn't apply to my degree.

So now I'm thinking very hard on this problem. Given that the only possible value I can derive from the class is that which I can derive from the professor directly, I am really deciding upon the value of my professor. Over the last few weeks, what have I learned from him? Nothing. His own business drives limited profit (by his own admission) and consists of him consulting on how to start/run a business.

Rather than take a class to learn about business, maybe my friends have been right in that I need to just start a business. Even if I fail a few times (or a thousand), the lessons I learn would, without a doubt, be of a far higher value than anything I've learned thus far in this class.

I'm giving myself until tomorrow to think on it.

Using Graphs to Build Your Own Ruby Pattern Matcher

There's More Than One Way To Skin a Rat!

A while back I posted an article on using dynamic programming to implement a string matching algorithm I cobbled together. That article is here: http://justinbozonier.posterous.com/string-pattern-matching-welcome-to-dynamic-pr

Tonight, I'm writing about solving that same problem but by using a graph. It was a solution suggested by a few people and then finally a couple of days ago my boss (Kelly Leahy) brought up the problem once more as I was asking for suggestions of CS concepts he thinks I should tackle and we got back on the subject of that pattern matcher. If it was mentioned so much in the past why did I jump on it now? Quite simply, I've been learning Ruby lately at the insistence of James Thigpen. He's been ranting and raving (on top of many others) so I thought this would be a great first project.

Read the rest of this post »

Mocking Frameworks, How'd They Do That?!

Writing Your Own Stubber, A How To Guide

The largest mystery when trying to understand how a mocking framework works has always been just understanding where this object it creates comes from. I mean I give the mocking framework an interface and it comes back with an object that implements everything (at least in the case of a stub). The point of this post is to show that they aren't magical and to hopefully extend what you think is possible in your own problem solving with C#. I'll be assuming you're familiar with mock objects and how/why they're used.

Read the rest of this post »