I woke up this morning in a semi-zombie state and just learned that tonight will be our “late night”, which means we’ll go until 2 or 3 am instead of midnight. Nevertheless, I’m still enjoying the course.

Here’s some thoughts about the second day of the course (yesterday).

  1. Actions, Predicates, and Funcs…Oh My - We started the day with a wrap up of all the work we did with delegates from day one. This is when the lightbulb finally went off in my head on the differences between the Actions, Predicates, and Funcs types. They are just convenience wrappers for delegates with different signatures. If you need to pass around a method that returns a bool, then you’ll want to use a Predicate (filtering & matching). If you just need to store a void method, then pick Action. Otherwise, if you’re working with a method that returns a value, then Func is what you’ll need.
  2. Imitate, Assimilate, Innovate – This is a model that represents the stages of learning. I realized that I spend too much time in the imitate stage (adapting googled code) and almost no time in the innovate stage. One of the first goals I selected for myself this week is to spend more time in the innovate stage. A long term goal is to eventually launch an open source project. Kudos to Dru and Rob, two former co-workers, who took this step already.
  3. JP’s BDD framework – This is a fluent interface that replaces test attributes, asserts, and obscure mocking API’s with more a fluent interface that reads more like an English sentence. It disoriented me for a while, but the syntax is starting to grow on me after a few days of using it. Check out this post for a sample of the syntax.
  4. Rewriting frameworks from scratch – The first day we implemented LINQ extension methods from scratch. Yesterday we wrote the routing portion of a basic MVC Framework. Today we’ll be writing an IoC container from scratch. These sound like an inane “reinventing the wheel” tasks, but they are meant to be simple exercises to help us practice good design. Not only did it help increase my conceptual understanding of the lower level infrastructure I’ve been using, but it was also very empowering to temporarily counteract the long term trend of consuming API’s and frameworks at that are higher and higher on the abstraction stack..
  5. Coding Centric Course with no Lab Manuals – Most training courses that I’ve attended or taught have provided students with detailed instruction manuals on how to complete the lab portions of the course. By contrast, JP cuts you loose with minimal direction. It was frustrating at first, but then I saw the value as soon I noticed how focused I was when he finally showed us the solution. It made so much more sense than it would have otherwise once I had some context based on first hand experience.
  6. Using Delegates to Test the Untestable – Probably the most memorable technical epiphany I experienced yesterday was when JP showed us a technique for testing methods that contain static framework methods or concrete framework classes without interfaces, both of which are unmockable when using RhinoMocks. By turning the methods into delegates that are private member variables, we were able to use interaction based testing to verify that the methods were invoked and that all the correct parameters.

Popularity: 1% [?]