Friday, May 02, 2008

I'm an Insider

Quick update:  I've been invited to join ASP Insiders!  I'm proud to be part of a select group of ASP.NET professionals who reach out to the community via forums, blogs, conferences, etc and are generally recognized experts in ASP.NET.



Some of the benefits of being an ASP Insider is to get in on some private discussion about design, new features, etc.  While I cannot publish any of this on my blog, I will be able to provide feedback in some areas (such as ASP.NET MVC).

Now, to go learn the secret handshake..
Monday, April 21, 2008

ALT.NET - Day 3

Day 3 started out with some breakfast at the DigiPen campus.  The first session was on Lean Software Development.  Evan Hoff was supposed to convene this session, however he had to leave for the airport.  Dave Laribee filled in.

Lean Software Development

IMG_0262

Notes:

  • Lean really refers to lean manufacturing
    • manufacturing is a much more appropriate metaphor to software development
    • focus not just on software development, but on entire value stream from inception to delivery
    • Everything is a pull.
      • i pull requirements off of a “shelf” someone should put the next one up there for me to grab it.  If there isn’t one there when I go to pull, waste occurrs, because I am waiting on something that I need. 
      • This concept goes all the way down the chain
      • everything is a customer/supplier relationship
    • Goal of any business is to make $
    • focus on flow (value stream)
    • I need to read these books:
    • I think a good metaphor for this is to picture a rope that goes from the beginning of business actions (ie: a CEO makes a decision to create value for the business) to the end (business value).  A number of interactions take place along the rope, and anytime you are pulling what you need from your “supplier” you have to have the slack, otherwise the rope will go taut.
      • eliminating waste would mean to minimize the tension *and* the slack in the rope.

I found a lot of value in this session because it seemed to pinpoint some of the issues that I face in my current project (ie: not technical problems, but getting customer involvement, prioritization of features based on business value, rather than tasks in TFS, etc).

I hope I didn’t steal the stage at this session, but I felt like Lean is probably going to be an area of study of mine later this year (once I dwindle down my book list!).

Advanced Techniques & The rest of the team

Some controversy surrounds development techniques such as IOC, SRP, ORM, AOP, etc.  These are all complex topics that solve complex problems.  For a team to not know how to deal with this, it can be fatal to a project.

Oren said that he tried to “hide” all of this from his team, so they woulnd’t have to learn it.  What happened?  A year later (this week) he received a call and someone asked him what “that windsor file was.”  I think it was obvious that this technique has a high “bus” factor.  (I.E. what would happen if you got hit by a bus?)

Scott Bellware noticed that we kept saying “Us” and “Them” — which leads to distrust and lack of empathy.  No really solid answers came out of this session, but a lot of folks concurred that an incremental approach to using very advanced techniques is ideal.

Oren recommended Release It! for the 100th time.  I think I need to buy that book  (but I already mentioned my reading backlog).

“Find the friction points and remove them” — Oren said this referring to abstracting away the infrastructure in an application.

Round table & lunch at Thai Ginger

The sessions came to a close and we all gathered in the main room again to do the final round table discussion of what we liked.  We passed around a stick and said what we liked about the conference.  The stick was much nicer than the sweaty putty we had last time.  It was a little sad to have the event come to a close, but as they say “When it’s over it’s over”

Endofday1

We met Donald Belcham and some of the rest of the Canadian Contingency (TM) for lunch at Thai Ginger.  The waitstaff was friendly and the food was excellent.  We even had a surprise visiter!  Hey, how’d you get there?

Lunch-endofday

Ending Thoughts

This 2nd ALT.NET Conference was so much more profound than the first.  There were no sessions on “Are we hurting feelings” or “Can we change the name?” and more topics like “Git” and “F#” and “Coaching Agile Teams.”  Doc was right when he said that in Austin we were very much a “storming” team.  This time around we were definitely “norming” and likely “performing.”  I think the next ALT.NET in Austin (dubbed “Continuous Improvement”) will be even better.

Bye ALT.NET Seattle!  See you in Austin this October!

Tags:

ALT.NET - Day 2 Continued

I’m sitting here at SeaTac Airport and really soaking in all of the events from the weekend.  Here is the finished recap of day 2…

Lunch was next, and Microsoft provided some really good sandwiches. 

Lunch

Lots of conversation continued…  I think these guys are talking about how to leverage SharePoint in all software development efforts.  Or maybe not

Conversations3

Some people took this time to do a little work…

Orenhardatwork

In this time Oren probably rewrote SVNBridge or something.  You know, about 30 minutes of work.

Here’s Phatboyg:

IMG_0217

and good ‘ole JP Boodhoo is always fun to chat with:

IMG_0218

Jeffrey Palermo was working on a Youtube video of the participants.  Somehow I was edited out of his video.  Intentionally?  I think so.

IMG_0222

I mean come on, just look at that evil smile!

Talking to Suits

IMG_0223

After lunch I went to “Talking to Suits” which was a pretty good discussion, however there was a lot of noice chat in my opinion.  I got the most value out of listening to Udi Dahan, Chad Myers, and Jim (effin) Shore (!).

Notes from the session:

  • Problems:
    • Fear
      • lack of stuff (documentation, etc)
      • no trust
  • Some people suggested the subversive approach to agile.
    • can work for TDD, CI, etc. but those things are more about quality.  Your manager won’t care how you do things if you present it to them in their terms (ie: code quality, better maintainability, less bugs found in production, etc)
    • you can’t sneak in trust though
  • Need to exhibit empathy, respect and understanding
  • Convey the value in terms of the “suit” 
  • “Suit” was chosen deliberately to convey perception (back to respect & empathy)
  • The “suits” are not opponents
  • Good book:  Rules for Radicals

IMG_0224

IMG_0225

IMG_0226

Behavior Driven Development

The next session was a tough choice.  I started out in the BDD session.  Unfortunately Scott Bellware had some computer hiccups (I think Windows sabotaged him) — anyway he lost about 10 solid minutes just on setup. 

Points were:

  • TDD tests don’t prove any business reason why the test even exists in the first place.  With BDD, your tests are directly tied to a feature, so you are less likely to start building features that are not even needed.  TDD can’t protect you from that.
  • To Estimate user stories you must have some acceptance criteria for the story.  That can be technical or non-technical / functional or non-functional.  This drives your BDD Tests, or “specs.”
  • It’s ok to have very technical acceptance criteria like “An order table must be created to store the orders” — Stories are not a customer artifact, they are a team artifact.

IMG_0228

IMG_0229

IMG_0230

Yes that guy *is* wearing a utili-kilt.  He does that.

The material that I saw was pretty much the same as what I’ve seen before, so I decided to duck out and check out the NHibernate for Deadheads talk.

NHibernate for Deadheads (or with Cartoon Bears)

To my extreme disappointment there were no cartoon bears in this session, but it was a pretty good Q & A about what NHibernate is good at and why people should not cling to traditional stored procedure + datasets method of data access.  I was able to contribute to this session, so that felt good.

After Oren and I went back & forth for about 30 minutes about effective use of NHibernate he finally came up to me and noticed my nametag.  It looked like this:

Ben Scheirman
@subdigital
http://flux88.com

He finally put it together, as we have talked a bunch of times online, but he hadn’t put my name to my face to my blog, etc.  It was pretty comical.  Next time we should have everyone do nametags.

IMG_0231

IMG_0233

Notes from the session:

  • What about sprocs?
    • sprocs offer no perf benefits over properly executed dynamic sql, which nhibernate does.
  • What about the generated SQL?
    • most of the time it is quite good.  NHibernate is better at it than I am in a lot of cases.
    • The cases where you find that there is a specific query that you want to use and NHibernate chooses to do it a different way, you can provide these as named queries to NHibernate.  Use SQL Profiler and be aware what’s going on w/ your database.
  • NHibernate complexity
    • too steep a learning curve for new folks
    • once you “grok” it you can be incredibly productive.
      • the data access becomes a solved problem
    • irresponsible development leads to serious N+1 select problems.  Need to first identify where that happens then find out how to fix it.
      • to identify:  can use Ayende’s PagePerformanceModule and limit the # of queries at a per page basis.  This is very quick feedback.
      • to fix:  understand lazy loading and eager fetching.
    • object design can affect this
      • deep inheritance hierarchies (while generally painful in OO) pose big problems depending on the strategy you use
        • table per subclass: lots of joins & extra queries to get the data for 1 entity
        • table per concrete class: lots of duplication
        • table per hierarchy: flattened table with all columns for all derived classes.  Limits queries needed, but then you have strange db semantics and no clear way of putting not-null constraints on some columns.  Perf problems with lots of columns as well.
    • lots of people have seen NHibernate used poorly… including me
      • how to fix this?
      • NHibernate gets a bad rep
      • unfortunately we didn’t dig deep enough here.

Some people expressed concern with NHibernate XML mapping (learning, understanding deep concepts) –– Chris Ortman and Oren both mentioned using ActiveRecord attributes to manage this.  I interpreted this as saying Use ActiveRecord (as in, inherit your entities from ActiveRecordBase<T>, which is something that I don’t really like to do).  Chris later suggested that I look at RhinoCommons to see how Ayende does Repository<T> with classes that have ActiveRecord attributes.  They are not quite POCO’s, but at least the class doesn’t inherit from a persistence aware base class.  I will definitely be looking into this.  (Damnit, when will planes have wireless internet for us?!?!)

Double Double “D” (or Distributed Domain Driven Design)

I wanted to go to this session in hopes of getting some more structure around what Greg Young was actually talking about.  Right now I’m not really feeling the pain of what he’s talking about so I think the talk was a little over my head.  Some good take aways:

  • “How many of you have an EmailGatewaySerivce in your domain?”
    • about 15 people raise their hand
  • “That’s a noun.  But does it belong in the ubiquitous language?  Do you talk to your business experts about this EmailGatewayService?”
  • convert it to a verb.
    • Create a new SendEmailMessage, pass it to a message handler
  • DDDD can help you scale to extreme levels by decoupling your domain from itself.  (ie: internal messaging, not just over service boundaries).

IMG_0238

About this time I saw a tweet by Matt Hinze that the Pair Programming session was pretty cool so I snuck out and went to check that out…

Pair Programming (Ping Pong Style)

Chad Myers and Ray Houston paired up for this one to demonstrate how to use the ping-pong-pairing technique & TDD to build out a flash card system.

Ping-poing paring goes like this:

  1. I write a test.  I make it compile.  I run the test.  It fails.  I slide the keyboard to you.
  2. You implement the bare minimum code to get the test to pass.  Make sure you don’t add gold plating or nice-to-have things here.  Once the test passes, refactor to remove duplication and code smells.  Now you write a failing test.  Make it compile.  Slide the keyboard to me.
  3. I implement the features, following the same steps as #2.
  4. Repeat until feature is done.

In this sense there is a good rhythm to pairs.  Each person has a specific set of things to do, and the person watching can help them avoid pitfalls or shortcuts and generally keep everyone honest.  It’s like continuous code reviews.

I think a lot of people got some good info on TDD and RhinoMocks from this as well.  Ray Houston is a BDD Practitioner, so I noted his style of naming test classes & methods.  I may start doing this very soon, as BDD is just making more and more sense.

Chad and I did a screencast doing this same thing last week but CamStudio decided to crash while encoding the video and we lost the whole thing.  Some folks expressed interest in us doing this again.  I wish Camtasia had a community or personal license that was cheap.  That’s such a good tool.

Wrap up & Dinner at Mehfil’s Fine Indian Restaurant

We wrapped up the day with Doc admiring the amazing thing that is Open Spaces.  It’s so interesting to watch a group self organize and see awesome results emerge.

I could tell that most people were mostly drained.  It takes a lot of mental energy to engage at a high level like that the entire day.  Add to that the fact that probably half of the attendees were also at the MVP Summit last week.  What I’ve found after both ALT.NET conferences is that I need a couple of days to really let everything process and to make some goals about how I want to take that knowledge and energy to go do something good.

A good bunch of us went to Mehfil’s (an Indian Restaurant).  I sat at a table with Russell Ball (Caffeinated Coder)and Ian Cooper.  Most of our conversation was around world politics and history, which was quite interesting.

I went to the bar for a few drinks and to talk to Steve Harman about some SubSonic thoughts.  I was pretty beat, so I went up to my hotel to crash.

Stay tuned for my recap on Day 3…

Tags:
Sunday, April 20, 2008

ALT.NET - Day 2

And so Day 2 comes to a close.  One of the biggest problems with this conference is that at any given time I will want to attend 2–3 simultaneous sessions.  Fortunately, the open spaces format allows anyone at anytime to float (I think the term is “be a butterfly” or “be a bumble bee”).  I did this in a few sessions to maximize the amount of sessions I could attend.

We started out at Ruby’s Diner for breakfast.  I arrived at the event to see people looking at the schedule wall.  It’s really amazing to watch a conference self-organize like this.

Schedule-wall

Our facilitator, “Doc” List, did an excellent job of setting the ground rules and clearing up a few scheduling hiccups and quickly we broke out into sessions.

Opening-altdotnet

What’s with all the white guys?

The first one I went to was: “What’s with all the white guys? (Diversity)” convened by Scott Hanselman.  We talked more about women in computing and why there is such a low ratio of men:women.  Some argued that it was genetics, some argued that it was cultural or parental.  We also talked about how Computer Science curriculums have highly technical weed-out courses at very freshmen levels.  I think this breeds a group of smart people, but also tends to attract people with limited social maturity.  This can either make it not fit for most women (if I am going to make some generalizations) or possibly make it a difficult environment for women.  I think it’s also good to note that in software, there is very much a “people” aspect that a very large percentage of CS majors would not qualify for.  (MIS may be the answer to this, but at UH, some joked that MIS was for “CS Dropouts”).

Diversity

Scott talked about he has spoken at high schools to break down the technology behind MP3’s, for example.  Most of the audience wouldn’t care, but there would be that 2 or 3 people that would take interest and that can make a difference.  The 2 women that were in the room were encouraged to try that out.

I was happy to note that our female attendance this year rose 400% (to 4 women).  Hopefully this number will change in future events.  I think it’s important for our community to be accepting and diverse.

After the session ended, we gathered in the main room again to chat for 10 minutes or so before the next session began.  There were some really cool conversations going on around just about every corner.

Conversations1

Hallway-conversations

To Mock or Not to Mock

The next session I attended was about mocking.  It was a pretty good fish-bowl session and a lot of good conversation was had.  Towards the end it spun downhill due to some harsh arguments and I think this was the most “unprofessional” of all the sessions.  Overall though, I got some good information about how some people manage pain with mocks and whether or not Auto Mocking Container is a design smell.

To-mock-or-not-to-mock1

To-mock-or-not-to-mock2

I will finish up the rest of the day in a later post, because I have to get ready to go to brunch!

Tags:
Saturday, April 19, 2008

ALT.NET - Day 1

I’m up here in Redmond for the the 2nd ALT.NET Open Spaces gathering.  The first one was truly a great event.

Unfortunately I flew up Friday afternoon and missed the Friday night fish-bowl session.  I had to miss this last year as well, and next time I want to come up early enough to participate.  The fish-bowl session (from what I gather) is a rount-table discussion about the topics that should be covered in the open space the following 2 days.  If you want to learn about F# or Git, shout it out!  If you want to talk about jQuery or BDD, then let it be known.  People gravitate to the good ideas and that’s what’s covered.

I decided to rent a car and drive to my hotel.   I figured it would be cheaper than taking a taxi and easier than bumming rides off of others.  I checked in and quickly headed over to DigiPen, where the conference is being held.  Stupid me, I forgot my jacket and it was snowing!  I ran into Eddie Bauer next to the hotel and picked up a jacket to keep me warm.

digipen-nintendo-buildings

The campus is next to Nintendo, as you can see in the picture.  I’ve heard that DigiPen graduates are guaranteed internships at Nintendo.  That’s awesome.

I ran into Brian Donahue, Dave Laribee, James Thigpen, Raymond Lewallen at the front.  Inside the main room there were about 120 geeks all chatting intensely.  I glanced around and saw many known faces in the industry.

After a while a bunch of us headed over to Desert Fire, a southwestern grill near the hotel.  The room was probably going to exceed fire code and would definitely impede us getting some much needed food (and beer!) so a few of us decided to go get a different table.

If you’re on twitter, then check out the hashtag #altdotnet to see the live tweets about the conference.  For me, I don’t do much mobile tweeting, but I might post a thing or 2 during the day, so follow @subdigital if you’re on twitter.  Here is Jeffrey twittering on his phone at the restaurant:

IMG_0197

Next to Jeffrey was Jean Paul Boodhoo, who was chilling out with a large glass of milk:

IMG_0198

Here is the rest of the table:

IMG_0199

There’s Evan Hoff, Chris Patterson, Dave Woods (forgot your last name!), Dru Sellers (behind Dave), and one of Chris’ co-workers, (I forgot your name as well!).

After dinner it was drinks and geek discussion in Phatboyg’s hotel room.  Here’s the night’s progression:

IMG_0200

IMG_0202

(luckily only 2 of those were mine, otherwise I’d be hurting this morning!)

ALT.NET day one was pretty fun, but I’m looking forward day 2.  Right now I’m off to eat breakfast with some people at Ruby’s.  Until next time!

Tags:
Tuesday, April 08, 2008

The Importance of Writing the Test First

I had a skype call today with Rob Conery and Scott Bellware (twitter) today to talk mainly about how to improve the “TDD message” of his latest ASP.NET screencasts.

One of the points of feedback Rob got on his screencast is that he had stubbed the code he wanted to test before actually writing the test.  While there was no “meat” of the code he wrote, there was still code.  And that code had some sort of design baked in already.

The topic in question was about Products.  Rob had a fictitious requirement that the discount should be displayed next to the price.  So he created something like this as a stub:

public class Product
{
	public float DiscountPercent { get; set; }
	public decimal ListPrice { get; set; } 
	public decimal AdjustedPrice 
	{ 
		get { return 0.0m; }
	}

	public decimal DiscountAmount
	{
		get { return 0.0m; }
	}
}

The intent was to test that a discount was properly applied to the product.  Of course, the test fails initially, and then you can easily go make it pass, but the first activity performed was stubbing out code, and that is design.

Instead, a failing test should show with absolute opactity that there is even a need for those properties.  The fact that you’ve written a test specification that says:

A Product with a discount percent of 10 and a list price of $100 should yield a discount amount of $10.

This becomes executable, and you know immediately that you have to implement those properties. 

“But wait?” I can hear you say, “…didn’t you just come to the same end result?”  Well, yes, here I did.  But what if while writing this code you realized that you really need to calculate this amount when you are calculating an order total, then you might introduce an order object.  Or you might have a completely different need.  The point here is that you shouldn’t just assume that you’ll need those 4 properties, or this 1 method, because you’ll likely be wrong.

This also brings out the point of having good test naming.  The test name should be so descriptive, it’s like a rule for the application.  Any new developer can come onto a project and decipher the meaning & intent of broken tests.  That is a very valuable thing to have.

If you recall the original fictitious requirement, it was “the discount should be displayed next to the price” you can see that it is a UI requirement.  It doesn’t necessarily dictate the model that you must use.

In fact, you might even come to the conclusion to use a data transfer object as a presentation model and then this piece of information could literally come from anywhere.

TDD is about design.  You’ve heard that a million times.  The obvious corollary benefit is the enforced existence of automated tests for every possible specification.  Even if you intend to write the tests immediately afterwards, you may have missed out on some critical aspects of design, such as loose coupling, or eliminating waste.  You’re also tempted to just not write tests at all.

If you skip on the test-first nature of TDD, then you’re really just unit testing, and you’re missing out on the real design benefits of TDD.

I also want to point out that I’m not picking on Rob.  He’s had way too much of that.   I think he’s doing a great job and (if done correctly) he can definitely reach a larger audience than I can, seeing that he works for Microsoft.  I also think it takes guts to submit your work to the world and, in the face of some pretty harsh criticisms, stand up and say… “Hey, why don’t you get on skype and we can talk about how much I suck!” — Keep it up, Rob!

So here’s a challenge:  those of you who think that Rob did a “disservice” to the community, I’d like to see your screencast on the subject.  Obviously there is a gaping void instead of widespread adoption, so we as a community could definitely use the material.

Tags:
Thursday, April 03, 2008

A Refreshing Take on Usability

I was browsing some high resolution dual & tri screen monitor wallpapers at http://wallpaper.panedia.com/ and I noticed something really cool.  They looked at my user agent string and resolution settings to determine which wallpaper was best for me.

Considering that (without 3rd party add ons) Windows can't display more than 1 image on multi-monitor setups, you have to choose 1 large image.  They were nice enough to highlight the correct resolution as well.  Kudos to Panedia for that!




(note:  there were a ton of sizes available, my highlighted suggestion was way at the bottom)
Tuesday, March 18, 2008

Speaking at North Houston .NET User Group

Sorry for the late notice on this one (it sort of snuck up on me!)  I’ll be speaking at the North Houston .NET User Group (yes I said North, it’s new).  The talk is scheduled for Thursday, March 20th @ 6:30PM.  The meeting will be held at Montgomery College in The Woodlands.

I will talk about adopting agile development… the what, why, and how.  Hopefully it will be more of an interactive discussion, as there the audience can usually relate to the pain points that I talk about with traditional waterfall development.

For more details, check out their website.