Simplify Requirements by Rejecting Boolean Questions

Mar
29
2009

My current big project is a rewrite of a platform that has 3 predecessors, all of which are still running, with implementations on them. The original gig was to dig into 2 of those platforms to get them back to running because all of the existing developers had left. Back in December, we were asked to tackle writing platform number 4.

One of my “rules” of software development on any project where I have a say in such matters is “You don’t get to rewrite it unless you understand it.”

That one made it on my list because of how common it is to watch software developers take a look at code some other developer write for 15 minutes only to declare it “crap” and in need of a complete rewrite. When challenged to explain what the offending library/package/application does, most can’t. That leads to a near 100% certainty that the rewrite will miss some large requirement or miss something subtle but important in how the original works.

So, as we set out to rewrite this mess, we wanted to make sure we understood what those older platforms do. We read all of the original requirements, dug through data structures and code, talked to the people who helped define the requirements on the original, etc.

One of the common threads that went through everything related to all of the implementations was the overly complicated ways that things were done in an obvious attempt to accommodate a wide variety of permutations. However, the complexity actually got in the way of accommodating those same permutations.

As we worked through the features that would be in the initial version of version 4, we pushed back on every assumption we could, hard. It’s something I’ve always done to one degree or another. On this project it’s been with more discipline than in the past.

Now, 4 months later, that has proven to be a critical strategy. That’s because optimizing your thinking about the problem and how you’ll solve it leads to orders of magnitude more productivity than most software tools.

If you add up the time spent actually typing code into an editor or IDE, compared with time spent trying to figure stuff out and otherwise spent thinking, it’s probably 30/70. That means that even if you had tools that could read your mind and instantly do exactly what you wanted, you’d only speed things up by 30%.

In trying to get other people to push back the same way, I’ve struggled to describe it in the kinds of rules that people un-used to doing this kind of thing (beginners in the Dreyfus Model). This week, one common factor in many of these situations popped out at me (Strategic Intuition at work). When subject matter experts asked us questions that would have led to complicated messes, they were almost always expecting a boolean answer.

They were questions like:

  • Can this new platform do X?
  • Will it have feature Y?
  • As a user of this system will I be able to do this specific task?
  • Can you guys make it do Z?

While those questions can be answered, often easily, doing so almost universally is the wrong thing to do.  Under those kinds of questions are giant piles of assumptions. When you answer these questions without probing deeper, you validate ALL of those assumptions without ever knowing what they are.

If, instead, you play the 3-year-old and ask “Why”, you can drill down into those assumptions. You can discover that many of them can be set aside or rendered moot by a much simpler design. And those that stand up to the incessant “Why” are worth keeping and now you have a much deeper understanding of what’s driving the feature request.

Of course, it’s an added perk that rejecting a black/white view of an issue fits in well with the Glass Too Big philosophy too. :)

ASP.NET MVC Plugins

Dec
05
2008

One of the last things I posted here was how I was toying with flexible content and template solutions in ASP.NET MVC. For that project, we're going forward with the solution that emerged from that experimentation and I'm excited to see how it turns out. 

Along the way, an interesting question about how to create what are essentially plugins for the MVC framework. Basically, if what you're building is an MVC app that will be deployed in dozens, hundreds or thousands of independent implementations, it becomes obvious pretty quickly that you need most of the pieces of the application to be modular so they can added/removed/overridden at least to a minimal level.

I've come up with what I think is a workable solution, which is pretty much just gathering up some of the other ideas already out there into a quick-n-dirty working prototype. The basic idea is this:

Put an encapsulated set of model classes (or none if you depend on central model classes), controller classes and a set of views into its own DLL. The views (using the default WebForms view engine, they're aspx files) go in as resources.

Pull that DLL into your MVC application and the MVC stack inside your "plugin" will work just like if those bits had been a "natural" part of the base MVC application. In fact actually creating the pieces from inside the main app and then moving them over to their own project is the quickest way I found to actually create the bits for the plugins.

When the question came up, I vaguely remembered seeing a question on StackOverflow about how to put views into an assembly/DLL. That question along with one on VirtualPathProviders provided most of the kernel of what I needed.

So, on to how to actually do this.
Read the rest of this entry »

Standardized ASP.NET MVC Controller Actions with Visual Studio Item Templates

Sep
07
2008

First, I think that this may be the longest title for any post on this site. I ditched 2-3 other variations for the only one that accurately describes this post.

Anyway, over the last couple of months, I've been working on getting better with screencasting tools. I learned a lot doing the last one and took that into the tinkering I've done with another one over the past week or so.

It stretched out over that timeframe because of a bunch of other stuff going on as well as some time spent on one-time tasks, like creating a Keynote theme to use for future screencasts that's a bit better thought out than the one I used on the last screencast. This look is something I'm much happier with and gives me a basis for more consistent look and feel going forward.

There's none of my shining face because I lent my webcam to a friend. I do see the value in adding that to the recording, but am not sure the best way to do it.

Anyway, on to the topic I actually covered in this video.

In ASP.NET MVC, the Controllers often end up with an Action method for all of the really common bits of functionality: Create, Insert, Update, Delete, etc. Stephen Walther put together a list of suggested standardized naming and usage for these Actions and I've been using them in the couple of ASP.NET MVC projects I'm working on.

In the process, I created a Visual Studio Item Template to make creating a new Controller that follows that convention easy. When I showed it to a co-worker, he expressed interest in how I did it and I saw an opportunity to explain something that's actually useful.

So, if you've ever wondered how to get your own templates into that Visual Studio "Add New Item" dialog box next to "Class Library", "Application Config File", etc. This is the screencast for you.

Anyway, give it a watch and let me know what you think.


Creating Visual Studio Item Templates from J Wynia on Vimeo.

Dynamic Font Replacement: sIFR, FLIR and More

Aug
22
2008
numeral types
Creative Commons License photo credit: threedots

A couple of weeks ago, Antonio Lupetti shared a list of 10 "handwritten" fonts that he uses in his design projects. He also does a brilliant job of integrating that stuff into the diagrams in his posts, which is why I paid attention when he put out a list (just take a look at his archives and you'll see what I mean).

As I was looking at those fonts and downloading them, I was thinking about sIFR, which I've mentioned before. It's a way to replace text in web pages with Flash on the fly, using fonts that aren't on a user's computer. I've wanted to include that on this site and on several others for quite a while.
Read the rest of this entry »

Writing My Own Travel Agent in C#

Jul
30
2008

Yesterday, Garrick was describing the difference between a "search result" and "find". His short answer was:

Search Results Listings say, 'The answer might be here'. Find says, 'Here you are, get on with your day.'”

That distinction is something that has always struck me as irritating about using every travel site I've ever seen (later discussion revealed that, ironically, this distinction is talked about obsessively at Orbitz). That irritation is because every search I've made started out as something that doesn't fit in their search boxes: "Find me a cheap coach flight and a hotel near the conference center in Austin, TX for SXSW", "I'd like to go to San Francisco for a long weekend some time this fall; is there a way to do that for under $500?" or "Which one of these cities and which weekend will be cheapest in October for a 5 day weekend?".

Those aren't questions which naturally get answered by a search results page. You don't get to pose those questions to travel sites. What you are asked on every one of them is to choose specific dates and, in many cases, both airports. The sites don't even so much as hold on to the fact that 99% of my travel is based out of Minneapolis/St. Paul International Airport.

Rather, I get a constant flow of emails from the travel engines telling me about great deals to Miami/Las Vegas/New York for $89. Of course, if you are flying out of Minneapolis, that deal suddenly becomes $327 instead.

There is a place you could and can ask those questions and get your "find" satisfied. Travel agents pick up the phone, listen to just such a question and call you back later in the day with the results of your find. Unfortunately, they also are professionals who need to make a living. That means they're not entirely thrilled to, for instance, check daily for weeks at a time for a very specific set of criteria for a vacation I may take if the deal is good enough.

That does, however, smell of the kind of thing that I like sling a bit of code to solve. And, it's something I've wanted to solve for a very long time. Every couple of months, I go looking for a way to write code that searches for flights and hotels and have always come up empty.

Then, this weekend, I did it again and ran across the Kayak API, which looks like what I've been looking for all along. The API allows 1000 searches per day, per developer key. While that wouldn't let me create much of a public service or commercial application, it's a really roomy number if you're looking to do lots of permutations for your own travel needs.

Personally, I'd like to do things like have a list of cities I've never been to and have software grind away on it, finding a good deal for a "fall long weekend" or a "week-long summer vacation", etc. for one of those locations. Similarly, I'd like to be able to say, "I've got $300. Is there somewhere I can go and get a hotel for a 3 day weekend that's on my list?".

Software can easily handle digging through the tedious crap like seeing whether leaving on Thursday and coming back on Sunday is cheaper or more expensive than leaving on Friday and coming back on Monday. As a person, trying those combinations on the existing search results-oriented sites is tedious. Tedious is what software does best.

Before I start dreaming too big for what might be possible, I threw together a quick POC app to see how easy it might be to search and grab results. I created a really basic class library for doing the actual searches and a tiny console app to try out a single search.

I have to say, I like what I see and think that there are some real possibilities for coding up my own travel agent with Kayak.

The sample, half-finished POC code is available in PDF form if you want to look at it. It's got gaping holes all over (hard-coded, read-only properties, unused properties, concatenated strings, etc), but shows the basic idea for how to hit the service. This doesn't do anything to take advantage of any of the polling cycle that the API documentation describes, so the results are incomplete.

However, it proved what I wanted from the POC. I'm now pretty sure that I'll be able to get what I want out of that API. If you're interested in travel and writing software, it might be worth a look for you as well.

« Older Entries  

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2009 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.