Archives

Archives / 2008 / September
  • Favorite Developer Books

    Updated 29 Dec 2009 I've written a few posts recently about various books, and recently while interviewing a candidate for Nimble Software  Professionals it occurred to me that for an experienced developer (e.g. not a new grad out of college), asking what their favorite (or most recently read) programming book is could tell a lot about them as a developer.  If their favorite book is something like Expert Programming in 21 Hours (not a real title) that paints a very different picture than if their favorite book is Design Patterns or a similarly respected title. Of course, flipping the question around, I started to think about what I would list among my own favorites, and naturally … more

  • Strategy Pattern With Ninject

    This is a follow-up to my post about avoiding dependencies with design patterns.  It left off with something like this as a Cart object that uses the Strategy pattern to avoid a direct dependency on SMTP emails. 1: public class Cart 2: { 3: private ISendEmail emailProvider; 4: //public Cart() 5: //{ 6: // emailProvider = new LiveSmtpMailer(); 7: //} 8:  9: public Cart(ISendEmail emailProvider) 10: { 11: this.emailProvider = emailProvider; 12: } 13:  14: public void Checkout() 15: { 16: // Do some other stuff 17:  18: this.emailProvider.SendMail("someuser@domain.com", … more

  • Monty Hall Envelope Puzzle

    So, recently I wrote about my introduction to the Monty Hall problem and its solution.  However, in the course of thinking about this problem, I came up with a related one that is pretty tricky as well, and builds on the insight gained from the Monty Hall problem.  That is, given three random chances to win a prize, if you pick one and another is revealed as a non-winner, you are better off switching with the remaining chance you didn't originally pick than sticking with the original selection (with 1/3 - 2/3 odds).  With this in mind, consider the following problem. Steve's Monty Hall Envelope Puzzle I take 3 plain envelopes and put a $100 bill inside one of them, seal them, … more

  • Probability Puzzle Answered

    In a recent post, I described a Probability Puzzle that is actually known as the Monty Hall Problem.  This is a fairly famous problem and has a long write-up on Wikipedia that is definitely worth reading to get a good understanding of the problem.  Almost everyone fails to answer this problem correctly the first attempt, because it seems obvious that there is one prize behind one of the remaining two doors, and there is nothing constraining which door we might pick (the 2nd time), so it should be a fresh decision with a 50/50 chance of success. In fact, the way to look at this problem is in reverse.  With the initial choice of one door out of three, the odds of success were … more

  • Probability Puzzle

    I was recently introduced to the following puzzle by another developer (from Vertigo, in fact).  This is actually a fairly well-known problem and you'll find write-ups about it on Wikipedia and elsewhere, but I'll omit links to those sources from this post to prevent some temptation to just click and see the answer (I'll post everything in a follow-up). The Scenario Imagine you are on a game show in which a great prize is hidden behind one of three doors.  Behind one door lies a brand new car.  Behind each of the other two, a goat.  The host of the show has explained this to you, and asks you to select a door.  You choose one and inform the host of your … more

  • Review - Murach ASP.NET 3.5 Programming with VB

    I have a copy of Murach's ASP.NET 3.5 Web Programming with VB 2008 (book web site) that I received over the summer and have been meaning to write a short review.  So here goes.  First of all, I love the "Murach format" for books, especially for "how-to" books which as it happens tend to be what they publish.  Specifically, they lay out their books such that typically the left-hand page is providing some explanatory text, while the right page has the corresponding figures, source code, etc.  The result is that you pretty much always have everything you need in front of you, unlike 99% of the technical books out there in which you're always have to flip pages or read … more

  • Slack and Constraints and Optimizing Throughput

    This is my second post that's related to my recent reading of Poppendiecks' Lean Software Development - read the first one here on Delaying Decisions. A related book (and one thing I loved about Lean Software Development were the many references to other great books, some I'd read, some not) that I've read and recommend is Slack, by Tom DeMarco.  It's referenced on page 81 of Lean Software Development, in reference to optimizing for flow as opposed to optimizing for utilization / efficiency. In both books, the point is made that total throughput and resource efficiency are opposed to one another.  To prove this, consider the case where you have a worker who is only 60% utilized on … more

  • Recursive FindControl

    I've been asking for a recursive FindControl() method as a method off of System.Web.UI.Control for years but so far no luck.  You find yourself needing these frequently when you work with composite controls, like most of the Login family of controls introduced with ASP.NET 2.0.  In particular, LoginView, CreateUserWizard, and Login frequently require a technique like this to access their contents. I posted a simple version a while back; Michael Palermo updated it, and Aaron Robson posted a nice generic version on IntrepidNoodle.com.  However, his site is often incredibly slow or non-responsive (perhaps he should switch to ORCSWeb), so while I'm happy to give him full credit, … more

  • Graffiti CMS Extension for DotNetKicks

    I've been manually adding DotNetKicks icons to my posts recently to try and generate more buzz for them, but that gets old quickly, so about an hour ago I decided to figure out how to make this automatic.  My current blog engine is Graffiti, which I really like, and after doing some searching for a pre-existing solution, I pinged ScottW on IM about the problem and he set me down the right path within seconds. The Problem DotNetKicks will display a dynamic image with a count of how many "kicks" a particular post has had.  It looks something like this: The HTML for this icon is very simple, and the only dynamic part of it is the URL of the post, which must be fully qualified and URL … more

  • Avoiding Dependencies

    I gave a one day class to about 20 developers today introducing Microsoft .NET, C#, and ASP.NET. As it was only one day and there were no hands-on labs, coverage was necessarily cursory, but overall things went very well. In the course of discussing the Base Class Library and specifically the areas of logging and sending emails (System.Diagnostics and System.Net), I was careful to emphasize to the class that they should definitely avoid making direct calls to these namespaces' members for their logging and emailing needs.  Instead, they should encapsulate their dependency on these classes using one of two patterns (and I'm inclined to favor the latter).  Specifically with regard to … more

  • Codebehind Files in ASP.NET MVC are Evil

    With the current versions of ASP.NET MVC (Preview 5) that have shipped, the default MVC template sites all include codebehind files for the ASP.NET views.  For example, here's a screenshot of what a new project looks like the one at right.  Further, adding a new ASP.NET MVC View Page will also include a .aspx.cs and a .aspx.designer.cs file by default. The question is, why is that codebehind file there, and what are the consequences of having it there by default?  If you watch a few screencasts and blog tutorials from Rob, Phil, ScottGu, ScottHa, et al, it's pretty rare that you'll find anybody actually putting any real code into the codebehind files for the views.  In … more

  • CodePlex Support For TortoiseSVN

    CodePlex is Microsoft’s open source project repository. It is built using Microsoft Team Foundation System and as such has until recently required the use of Team Explorer to access. However, due to the extreme popularity of Subversion (SVN), an open source tool for source control configuration, CodePlex has just announced support for TortoiseSVN (an SVN client). You can read the full details (including step-by-step instructions) in the official announcement, here, and access the root of the SVN tree via the web here. more

  • Interesting Slide Deck on Software Design

    Just found Allen Holub's Everything You Know Is Wrong presentation, via the Yahoo DDD group.  It makes a great case for favoring interfaces over inheritance and avoiding property getter/setters in favor of delegating work to the object being referenced (such that you don't need to know its properties - just the net result of the operation).  The interface discussion is similar to some of my recent posts on the subject.  The last slide also references his book, Holub on Patterns, which I hadn't seen previously but will have to add to my reading list. I have to admit that while I've been on board with favoring composition and interface inheritance over implementation … more

  • Delaying Decisions

    I've recently finished reading Mary and Tom Poppendieck's Lean Software Development title, which I'll write a review of in a later post.  One of the points they make, devoting a all of the book's third chapter to it in fact, is that there is tremendous business value in delaying decisions. Lean software development delays freezing all design decisions as long as possible, because it is easier to change a decision that hasn't been made. The consequences of making hard-to-change decisions early is that when new information presents itself, it is difficult (and expensive) to adjust the design.  Decisions that are trivial to change in the future can be made as needed - not every … more

  • Interfaces and Testing

    Chris Brandsma posted his thoughts on a discussion he had about interfaces as a requirement for TDD (or unit testing in general, I would say).  I added a brief comment there but wanted to expand on my thoughts here, as I only fairly recently came to believe my current stance.  See, I've heard that interfaces were a "good thing" for years and as Chris points out, plenty of authoritative Software Development books extol the virtues of programming to interfaces as a means of providing loose coupling and other benefits. Program to Interfaces = Good Program to Implementation = Bad I read this in these Design Pattern and similar books, and nodded (in my head, not really while I was … more

  • P3P Trouble with Internet Explorer

    Recently I've had some customers request that some third party scripts Lake Quincy Media provides avoid the evil eye of death that IE6+ likes to show if such scripts even think about using cookies.  In our case, we are testing to see if the browser has Flash installed, and save the result in a cookie since it is a relatively expensive operation and we do not want to have to repeat it.  The source of this IE feature is P3P, which itself exists because of user concerns about online privacy. The concern I have is that I'm having difficulty bypassing the IE6+ behavior even on my own sites, where I wish to share common scripts between domains.  The issue is that along with the evil … more

  • Find Duplicate Files and Clean Up Disk Space

    I'm in file cleanup mode tonight as my laptop hard drive is consistently nearly full lately.  On a side note I'm really looking at getting an HP MediaSmart Windows Home Server like the one ScottHa got a while back, but they're a bit old at this point so I figure newer models with more RAM and larger built-in HDDs must be coming soon.  But I digress. In the course of cleaning up hard drives, I religiously use SpaceMonger, which is (was) free and shows you everything broken out by proportionally sized rectangles (SpaceMonger 2.1 is not free, looks improved, but I haven't tried it yet).  This app is awesome for finding out why you suddenly have no disk space.  I sometimes … more

  • Client Side Client Detection

    I just heard about a new flavor of the top of the line client detection component, BrowserHawk, that is being branded as "BrowserHawk To-Go (BHTG)."  What's interesting about this (to me) is that it's following a SaaS model and a pay-as-you-go scheme for pricing.  This makes the software very affordable for startup sites and simplifies the installation requirements.  Implementation in this case is via a client side script include, which is configured to be cached by users for a day, so the actual number of downloads required should be minimal.  Billing is done based on the number of times the script runs, and this in turn is set up to work only with the approved domains … more

  • Keep Vista from Changing Folder View

    I've been running Windows Vista since it came out in November 2006.  By and large I'm happy with it and wouldn't go back to XP, which I'm still running on some other PCs.  However, once annoyance that I've finally gotten fed up enough with to track down the fix is the constantly changing folder view issue.  For instance, say you're a developer, which probably isn't a stretch since you're reading my blog.  And further, say you're a *web* developer, and your web application has a bunch of files in it, some of which are likely images.  Now let's say that one of your cohorts was working on said files, and you quickly want to see which file(s) were most recently … more