Category: Podcasts

Goals

Starting a Podcast – Phase 0

PodcastI’ve toyed around with the idea to start a podcast for quite some time. I think the time for me to get started has arrived. I’ve created a survey to try to do a little market research that you can find here. If you would please take a minute to take the survey (it is only 6 quick questions), I would really appreciate it.

My goal is to narrow down a format and get 4-5 shows in the can and then publish them at whatever pace gets decided (one of the survey questions!) while making more.

I’m not looking to be “Hansel-famous”, I just want to put myself out there in the community another way and try to continue to grow as a technologist, a communicator, and a person. I’m taking Scott Hanselman’s advice (found here) and going to give this a go.

I would really appreciate if you would take the survey and help me make a podcast that people might want to tune in to. Thanks!

Code Tips

Liskov Substitution Principle

I was listening to Hanselminutes a few weeks back and Scott Hanselman had Uncle Bob Martin on to talk about the SOLID principles of object-oriented design. SOLID stands for

  • Single responsibility principle
  • Open closed principle
  • Liskov substitution principle
  • Interface segregation principle
  • Dependency inversion principle

Obviously, each one of those could warrant its own blog post and Robert Martin himself has written and spoken about them extensively. Uncle Bob did bring up a classic problem on Hanselminutes, though, that I wanted to take some time to talk about.

We who design object-oriented systems have a problem. We’ve been taught that the whole world is made of objects and that we are supposed to model our software after the real world. However, as I’ll cover in this post, sometimes that is a mistake.

The Liskov Substitution Principle says that “Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it” (Uncle Bob’s paraphrase). I have found this one somewhat confusing in the past, but I think that this Rectangle-Square problem explains the problem very well.

In math, the definition of a rectangle is “a parallelogram with four right angles”. One Webster’s definition of a square is “a rectangle with all four sides equal”. Right in the definition from the real world, a square is a rectangle. “Is a” is often a key phrase in object-oriented design used to denote an inheritance relationship.

So, let’s pretend we have the following code:

public class Rectangle
    {
        public virtual int Width { get; set; }
        public virtual int Height { get; set; }

        public virtual int ComputeArea()
        {
            return Width * Height;
        }
    }

    public class Square : Rectangle
    {
        private int _height;
        public override int Width 
        {
            get { return _height; }
            set
            {
                _height = value;
            }
        }

        public override int Height
        {
            get { return _height; }
            set
            {
                _height = value;
            }
        }
        
        public override int ComputeArea()
        {
            return base.ComputeArea();
        }
    }

Okay, that works. You can run code against it and at first blush it behaves like it should. However, the Liskov Substitution Principle says that you should be able to have

Rectangle r = new Square();

and have no problems.

While you can do that and can then operate on r as if it were a rectangle, there is a problem. A person who only knows about rectangles might do this to our r.

Rectangle r = someMethodThatWillReturnASquareSometimes();
r.Width = 10;
r.Height = 15;

They would then get entirely unpredictable results when they computed the area or even went back in to retrieve the properties (finding one had changed without their knowledge). A person who would want to operate in a safe way would have to eventually do the following:

Rectangle r = someMethodThatWillReturnASquareSometimes();

if (r is Square)
{
  // Special Square Processing
}
else
{
  // Normal Rectangle Stuff
}

That now pretty much defeats the purpose of using base classes and interfaces. If you have to know about derived classes and their implementation, you’ve lost the battle. I think that this is a great reminder to model objects logically how they affect the program, not how they reflect “real life”.

Podcasts

My Favorite Programmer Podcasts

Road Image From http://www.sxc.hu/photo/973008I use to have an hour long commute to work. It has been reduced to 35 minutes now with my new position, but I still have 5 hours a week where I’m not being at all productive. I used to listen to books on CD to pass the time, but what I really wanted to do was learn more about programming!

Since Code Complete isn’t out as an audio book yet, I had to turn to podcasts. At the time, I still had 10 hours of drive time, so I was really burning through them. At first, all I had was my nerd-crush Scott Hanselman’s podcast “Hanselminutes”. However, I blew through the archive in a hurry and I needed more.

I had a really hard time finding good podcasts that were updated fairly regularly and that talked about the kinds of things that I wanted to learn about. Since that time, I’ve built up a nice little rotation and I thought that I would share my favorites with you. I wish I could have found a list like this when I was searching, so maybe I can be a help to someone else who is starting out.

Here is my list. In order of preference. I don’t waffle and I calls ’em likes I sees ’em.

Hanselminutes RSS Feed
My absolute favorite podcast. When I discovered this, I liked it so much that I went back and listened to every single episode. When a new one comes out, I bump it to the top of the playlist and hear it next. Worth a listen for the theme music alone ;). Description from the site: Hanselminutes is a weekly audio talk show with noted web developer and technologist Scott Hanselman and hosted by Carl Franklin. Scott discusses utilities and tools, gives practical how-to advice, and discusses ASP.NET or Windows issues and workarounds.
StackOverflow Podcast RSS Feed
This is the podcast to discuss Jeff Atwood and Joel Spolsky’s joint business venture of StackOverflow.com. Well, that is what it is intended to do. In reality, they talk about a lot of issues that are tangential to Jeff’s work or things that have annoyed either one of them in the past week. They also take user questions.
Polymorphic Podcast RSS Feed
This podcast isn’t updated as frequently, but I still like to listen to it when it is new. The tagline is “Object Oriented Development, Architecture, and Best Practices in .Net” and that about sums up what the show is about. Craig Shoemaker, the host, also does webcasts over at getpixel8ed.com. A bit of trivia: I won an ASP.Net Infragistics Controls license for answering a trivia question posed on this podcast!
Deep Fried Bytes RSS Feed
Deep Fried Bytes is a new podcast with Keith Elder and Chris Woodruff. It is described as “The show discusses a wide range of topics including application development, operating systems and technology in general”. Some great recent shows have covered .Net development on a Mac and scaling large websites.
.Net Rocks RSS Feed
.Net Rocks. If you don’t know about this one, you’ve been hiding. Carl Franklin and Richard Campbell do an hourlong show and discuss all sorts of topics in the Microsoft world.
Google Developer Podcast RSS Feed
This podcast isn’t updated very frequently at all. It isn’t boring and does let you know what Google is up to for developers, but I use it as “filler” if I’m all caught up on other podcasts and I need something to listen to on the commute.
Alt.Net Podcast RSS Feed
If you haven’t heard of Alt.Net, it is a group of developers who develop using .Net technologies, but they like to have some choice in how they do things, borrowing heavily from what other development communities are doing. This podcast has a lot of information, but is really dry and another one that I use for filler.

I have a few more that I dig deep on if I am totally out of stuff, but by that time, my regulars have churned out some new podcasts and I don’t need to go much further. If you have one that you really enjoy, leave it as feedback in the comments, I’d love to check it out.