Wednesday, July 23, 2008

.NET Dojo - Free Hands On Training for ASP.NET MVC

dojo 

I'm a little late on this notice (luckily J Sawyer already posted about it) but I'm going to be hosting a .NET Dojo class at the Microsoft office in Houston.

The class will be a free half day session where we will dig into ASP.NET MVC.  I'll cover the basic principles of the MVC pattern, why you might want to use it over WebForms, how to leverage Ajax and how to apply test driven design practices with the framework.

You'll need:

When?

August 28, 2008
1pm-5pm

Where?

Microsoft Office
2000 W Sam Houston Pkwy

How do I register?

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032383675&Culture=en-US

Space is limited, so first come first served!

Monday, July 14, 2008

Houston ALT.NET Geek Dinner #2 - Tonight

I'm so lame.  I forgot to post this last week.  If you don't want to be lame like me, then you should head out to Star Pizza tonight at 6pm for some fun-loving tech discussions about ALT.NET and the Houston community.  There will be pizza.  There will be beer.  And there will be a fat guy in a jump suit giving away iPhone 3G's*.

Potential Topics:



Star Pizza
2111 Norfolk
Houston, TX
Date: (Tonight!) July 14th, 2008
Time: 6pm

View Larger Map


* No iPhones will be given away.  And there won't be a fat guy in a jump suit.  I hope.


Wednesday, May 28, 2008

ALT.NET Geek Dinner Recap

The pizza was good and the conversation was even better.  We had 9 people show up and we talked a lot about tech, Microsoft, Test Driven Development, and beer!

I brought up the subject of possibly organizing an ALT.NET Open Spaces conference here in Houston, and folks seemed interested.  I'm a little frightened by the amount of work this will be, but in the end I think it will be worth it.  We also decided on getting a google group setup, so if you're in the Houston area (or just want to listen in) then join us at http://groups.google.com/group/houstonaltdotnet.  We'll use this for future planning.

Unfortunately I forgot to take a picture of the group, whoops!  I guess that just means we'll have to meet again :)

Wednesday, May 21, 2008

Houston ALT.NET Geek Dinner - Next Tuesday

If you're in or near Houston, then perhaps you can join our first ALT.NET gathering, which will be an informal geek-dinner!  We will discuss various concepts around ALT.NET and see if we can get the ball rolling for organizing an open-spaces conference sometime this year.

When: 5/27/2008 @ 7:00 PM  (That's next Tuesday)
Where:

Star Pizza
2111 Norfolk
Houston, TX 77098

(google map)

We're not really sure how many are going to attend, so please leave a comment if you plan on joining us.  I'd like to notify the restaurant if we're expecting more than 20 to show up.

Hope to see you there!

Sunday, May 18, 2008

Austin Code Camp Rocked! (And I'm Tired)

Austin Code Camp 08 was a success, and I’m really glad I participated in it.  About 150–200 eager developers came to learn and network with others from around the area.

I was able to attend 2 sessions, the first was “Agile in the Enterprise” by Joe Ocampo.  His talk was full of a ton of powerpoint slides which really didn’t fit in with the size of the talk.  Here are a few highlights:

  • What makes success?  -> People, Communication
  • What makes failure? -> People, Communication
  • People are often overlooked as critical factors of success of any project.
  • “The worst thing you can do is isolate architects from developers.”  — I couldn’t agree more. 
  • Siloed teams lead to lack of communication, trust.  Change is very difficult.
  • Composite teams are cross-functional – based on component, feature, subsystem, interface
  • Agile projects will generally cost MORE — I can’t say I fully agree with this
  • However, ROI can be realized much sooner, which can help overcome that cost
  • In a waterfall project, technical debt is incurred and generally not paid back.  Leads to lower pace and more costly maintencance.
  • In an agile project, technical debt is minimized, keeping a sustainable pace and enabling change without high cost
  • “Innovation Games” — to help you drive out features/priority with your customer

Some pics:

Iphone 032

Iphone 033

Next I went to a talk entitled “Designing for Stupid Users” which was a fantastic title.  The talk was about User Experience Design and I found it to be informative but a bit dry.  The speaker obviously knew the topic well and could speak to it, but the power point slides where just loaded with text.

There was a great picture on his deck though:

Iphone 036

Basically (it’s hard to read) it says the left most “thing” that the users interact with is the screen.  They then go through many different layers of “stuff” to get to their overall goal, which is a business action.

The rest of the day was me speaking, and I think they all went very well.  I did notice, however, that the DDD with NHibernate is just too much material to fit into an hour.  I should have submitted these as 2 sessions.  I also ran out of time in the Advanced CSS & Javascript talk and didn’t get to demo much javascript.

All in all, it was a great event, I got to meet a lot of very cool people and I learned a bunch as well.

Thanks to all who organized, spoke, or attended the event!  It was awesome.

To end the evening, we went to have beers at a nice place.  Scott Bellware showed up and we had some really good conversations about community.

Iphone 038

Iphone 039

And then I made my journey back to Houston and slept for 10 hours. 

(oh, and you can download all of the material from the code camp at their google code repository)

 

Tuesday, May 13, 2008

Screencast - Test Driving an Inventory Screen

A few weeks back Chad Myers and I recorded a screencast to demonstrate TDD in action.  We had some issues with the recording (again) but I was able to mix it all up and produce this stellar TDD screencast for all of you friends.

A couple things to note:

  • Chad and I are BDD enthusiasts, not experts... so you might see a bit of a quirky hybrid approach.  Don't TwitterFlame us please ;).  I am, however, finding that the more and more I use BDD style tests that I feel myself leaning towards that style, but it's a progression.
  • Chad and I apparently live in different time dimensions, as our audio streams were totally out of sync.  I tried to fix it, but I'm a coder, not a production contortionist.  It's definitely watchable, but the last 20 minutes or so is a bit off sync.
  • It's long...  I tried to bring it down a bit by cutting out silence, but then I just wanted to release it already :)

So without further ado, you can watch the screencast here:

http://www.benscheirman.com/screencasts/tdd-inventory

Total Length: 94min

Please let us know what you think in the comments.   If you find this is useful then perhaps we will do more of these.

update:  a few of you have asked for the code.  I’ll be sure and make this available for future screencasts.  You can download the project here:

File Attachment: TDDInventory.zip (139 KB)

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:
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.

Thursday, January 17, 2008

The Texas Tour of ASP.NET MVC Comes to a Close

It’s been an exciting two weeks.  I visited user groups in San Antonio, Houston, Austin, and Fort Worth, and I got to meet and connect with a lot of interested developers about the new ASP.NET MVC framework.

Two of the events were recorded, so if I ever get my hands on the recorded bits, I’ll post them here in an easily watchable format.  (Don’t hold your breath though.)

My presentation had a minimal amount of PowerPoint.  I decided to focus on real code.  And people have thanked me for it! 

I covered:

  • Basics of MVC
  • Default Routes
  • Simple Controller / Action
  • Passing data to the views
  • passing strongly typed view data
  • Custom Routes
  • new/edit form for an entity
  • writing tests for controllers
  • rhino mocks for mocking out dependencies
  • dependency injection for controllers (using Windsor)
  • ajax integration with prototype

This is a lot to tackle in my 1/1.5 hour time slot.  And I do get a lot of blank stares when I talk about mock objects and dependency injection, but I think more presentations need to present realistic code, rather than simple examples.  The feedback I’ve gotten about this has been overwhelmingly positive, and I’m really glad people liked it.

Some questions that were asked during my tour…

“Ben, you are phenominally good-looking?  Are you available?”
umm no, I’m married (and now terrified)

What is that cool zoomey tool you used?  That’s awesome!”
that is called ZoomIt, by sysinternals.

What are you using for data access on your entities?”
It’s called Castle ActiveRecord, which uses NHibernate underneath.

Can I use ASP.NET validators?”
—Well not really.  The validators have viewstate, which won’t work.  Your validation definitely belongs in the Model, so you could just do server-side if you want.  If you want clientside validation, you could accomplish a similar result by using marker css classes and some clever javascript  (think <input type=”text” class=”required” name=”address1” /><span class=”error_message”>This is required</span>

If we use this on IIS6, will performance suffer?”
— Probably.  On IIS 5/6 you have to send all requests through ASP.NET, which can be slower.  I’m not an expert in this area, so definitely do your research before making any rash decisions.  When we have Windows Server 2008 and IIS7, expect vast improvements.

Do you know Justice Gray?”
—Sure do.  I’m a bona-fide potential friend of Justice Gray, and even have the certificate to prove it.  It’s serial number marked 00000000000003.  I carry it with me at all times for just such a question.

Can you use co-exist with webforms?”
—Yes!  If you hit a page with the .aspx extension, the PageHandlerFactory will pick it up and you will be in WebForms Land.  If you instead hit a route, you’ll be in MVC Land.  Learn to know the difference and you’ll be fine.

Isn’t it dangerous to output strings directly like that?”
—Yes it is.  Read my post about html encoding your values.

Your hair is impeccable?  What kind of gel do you use?”
— It’s called Fructis something-or-other… and it’s awesome!

So Microsoft has two methods of developing web applications?  Which should I choose?”
—If you like the rich eventing model and the ability to save state and mimick a smart client ui, then choose web forms.  If you value clean html, urls, separation of concerns, and testability, then choose MVC.  I will be choosing MVC more often than not from here on out.

When will it be released”
—Gawsh, I don’t know?  Fall 2008?  As soon as I know I’ll post it here.

(admittedly, a couple of those questions were not asked — I’ll let you guess which ones)

You can download the code and the presentation here:

File Attachment: save the world with asp.net mvc.zip (1612 KB)

I’d like to thank the user group leaders for having me speak, it was certainly a pleasure.  Where will the next tour be?

Wednesday, January 16, 2008

Thank you ADNUG and FWDNUG

I got the chance to meet an enthusiastic bunch of folks in Austin and Fort Worth this week, and I wrapped up my Texas Tour of MVC.  I really want to say thanks to groups for having me.  It was a pleasure to speak and connect with fellow developers in Texas.

I’ll be posting a massive recap this week that includes the code and powerpoint that I delivered.  I’d appreciate any and all feedback.

Now for that long drive home…

Thursday, January 10, 2008

Thank you HDNUG!

I enjoyed giving the presentation on ASP.NET MVC tonight to about 90 eager developers at HDNUG here in Houston.

There were a few people that had played with the framework before, a lot who had heard of it, and about 1/3 of the room had never heard of it.  Awesome!

There’s always a balance between how intro a talk should be, but one of my goals with this talk is to show real application code; to show how you actually test these things, and what types of practices and tools that can enable this and make it easy.

I hope that the talk was well received.  If you went, I’d love to hear your feedback in the comments!

Some links from the talk:

I’m sending the code over to be posted at HDNUG right now.  After my tour ends next week, I’ll post a large recap that includes code and hopefully answers to common questions that I’ve been hearing.

They also recorded the talk, so once I get my hands on the video, I’ll throw it up here so others can have a look.

Thanks for having me HDNUG!

Wednesday, January 09, 2008

Thank you Alamo Coders .NET!

Last night I kicked off my Texas Tour of MVC at Alamo Coders in San Antonio.

The room was pretty small and they filled it up with about 25 people.  It was a bit more personal and cozy than the Houston .NET User’s Group that I’m used to.

I ran a bit short on time, but luckily I had my ready-baked turkey in another folder so I was able to show my ajax portion of the presentation and I think it went well.

I got some feedback from a few people who found the talk to be covering too much.  (In addition to ASP.NET MVC, I covered inversion of control, mock objects, and a few other things).  I wish I had a bit more time to explain these things in more detail, as it can be like drinking from the firehose, however I think they are important topics, and necessary to understand if you expect to properly unit testing on your controllers.

For those of you that were there, here are the relevant links for more information…

Inversion of Control:

Mock Objects:

The javascript library I was using was prototype, available here: http://www.prototypejs.org.

Thanks again to Alamo Coders for having me!

Sunday, December 30, 2007

ASP.NET MVC Tour of Texas

Want to see what the hype is all about with the new ASP.NET MVC Framework?

I’ll be touring Texas speaking about it.  If you live in Texas, come check out my talk “ASP.NET MVC – Save the Developer, Save the World.”

Here’s the confirmed schedule:

  • January 8th – Alamo Coders (San Antonio)
  • January 10th – HDNUG (Houston)
  • January 14th – ADNUG (Austin)
  • January 15th – FWDNUG (Fort Worth)

We’ll take a look at the new framework, the design goals, and dig into some code.

Hope to see you there!

 

Friday, October 26, 2007

Ouch! From the ALTNET Mailing List

Someone suggested to use DotNetNuke for the community site for ALT.NET and I heard this reply:

I'd rather chew glass.

Ouch!

DotNetNuke does have a lot of flexibility and generally buys you a lot, but I don’t find it a joy to work with at all.  Especially the OOB experience is just nasty.

 

Tags:

The MSFT Open Source Conspiracy Continues

The latest news just broke in the previously noted Microsoft Conspiracy to Consume good open source project leaders.  I'm sure you've heard it 10 times before me, but what the hell, what's 1 more?

Rob Conery, creator of SubSonic is joining Microsoft full time to work on SubSonic!  I think this is great news.  First, it reaffirms my belief that Microsoft has their eye dead on the community.  Things are changing, and for the better, mark my words (muahahah).

I can't wait to see how this will affect the project, because I know that Rob has passion, and now that he doesn't have to worry about other projects, clients, or deadlines... he can focus and make SubSonic even better!

Who will be next?  Speculate in the comments...



Tuesday, October 09, 2007

ALT.NET Goodness

Wow.  What an awesome event.

I’ll skip the play-by-play, because that has been covered to death.  Instead I’ll focus on my notes.  There are definitely some “meaty” posts in my mind that are still storming, so expect good things to come.  There are some good points here, but it’s a long post so I’ll be surprised if I get any comments .

Being a Catalyst for Change

I first attended a session on “Fostering Passion” and “Being a catalyst for change” which were grouped together.  A lot of people showed up and J.P. Boodhoo led us off.  He talked about the importance of a good, healthy work attitude, and if you aren’t getting what you need from your current employer then you should really seek out something better. 

  • You need to show pain before you can start evangelizing new stuff.  Ask people the question “How is that working for you?”  or “What would you want to improve first…. why?”  This gives you the context and the opening for suggesting new ideas.
  • Talk about problems in context with the 4 variables, this helps lead to whether something is “working” or not
    • Time
    • Scope
    • Quality
    • Budget
  • Hosting brown-bag sessions is a great way to get people excited.  Scott Hanselman pointed out that he found it valuable to create a “shadow government” of peers who you can individually get excited about different topics.  Ask them to give a lunch & learn and spread the word that way.  Somebody called them “Hanselminions”  —  epic.
  • JP Boodhoo stressed that we build relationships before we offer to “fix up their processes.”  If you come in wanting to change everything you’ll just alienate your team and ruin your credibility.
  • Another thing that we discussed is that newcomer’s to our community are going to be very overwhelmed…  currently there isn’t much direction.  We don’t want to be prescriptive, but a general “go in that direction” will definitely be helpful.

Advanced NHibernate

The next session I attended was Advanced NHibernate Techniques, facilitated by Jeffrey Palermo.  I found this to be awesome, because usually when I get to talk (or listen) to NHibernate at a user group or code camp, it’s focused on the beginner side of it.  Everyone in the room had been using it for a while, and had some really good suggestions and valid problems with it.

  • ActiveRecord vs. Persistant Ignorant?
    • I suggested that for dead-simple models, or a team that doesn’t know DDD, that AR was a much easier path with less friction, however you do quickly hit a limit here when you want to start using more Domain Driven Design such as the Aggregate root/aggregate relationship, repository pattern…  or if you need these to be remote… they can’t be used on the client side.  Somebody pointed out that it is very difficult to switch from one to the other, and this makes the initial decision very hard.
    • Howard Dierking pointed out that “No Simple CRUD app stays that way”
  • Database, Mapping, Code -> which first?
    • This was basically a poll question.  Almost everybody here started with code, then database, then mapping.  Very few people used hbm2ddl (like I do) to generate the database.  We all agreed that generating the database needs to be abandoned once you start doing tuning and specific tweaks.  The Eleutian guys (who have names, by the way… Aaron and Jacob) have a pretty hefty process that all starts with a modeling tool.  It kind of scares me, but they seem to have it working so that they don’t have to re-work anything.  To be truly DRY you definitely need another abstraction, however I’m not convinced that UML is it.   What if we had a Boo DSL that represented the mapping, and we could specify advanced DDD concepts there, and have it generate the code, hbm, and Database…?
  • Issues?
    • Aaron and Jacob have been stressing about Adaptive Queries and Read-only queries, and I need to make an effort to understand their problem.  Originally I dismissed this as a non-issue, but that’s a cop-out.  I want to understand what they are wanting that they aren’t getting with NHibernate.
    • We all seemed to agree that it’s painful that if you have a single error in your mapping file, the session factory throws an exception and just about every test in your application will fail.  This SUCKS for pinpointing the error.  I heard Howard mention something about jitting the mapping assemblies (I guess while writing?) — I definitely need to continue this discussion with him.
    • Partials mappings would be pretty cool, so you could generate the mappings based on default conventions, then you could override when necessary.

ASP.NET MVC Framework presented by Scott Guthrie

  • This flippin’ rocks.  A detailed post to follow.

Domain Driven Design – Facilitated by Dave Laribee and Scott Bellware (with a cameo from yours truly!)

  • This was pretty much review for me, but it’s always good to get refreshed.
  • Opening your mouth is a good way to get people to ask you another question (provided you didn’t say something completely stupid) — I kept getting asked to explain more topics here, which was flattering.
  • At one point I said “If you haven’t read Evans yet, go TODAY and buy his book.  Then read it 8 times.”  — This led people to believe that I had read it a few times.  Nope!  I still have 7 more to go .
  • A lot of discussion went around the different between responsibilities of the entities, and the responsibilities of domain services (not to be confused with application services or <gasp> SOA).

User Stories (facilitated by Scott Bellware & Raymond Lewallen)

  • The more I dig into this stuff the more I like it
  • Epics– 30,000 ft view (almost impossible to estimate) (if you have to, also provide a low confidence value)
  • Theme – closer, but not enough to estimate.  Gives more detail.  Many themes per epic
  • Story – small enough to provide estimate & acceptance criteria.
  • Ray said “I can give you a gantt chart & have it say whatever you want on it.”  — this is funny, but SO true
  • Estimation accuracy and Trust are increased as time goes on… providing you aren’t making empty promises early on
  • Don’t estimate a user story until you have acceptance criteria
  • Acceptance Criteria (AC) can be technical
  • AC helps define “done”
  • Early stories will add a LOT of new concepts
    • new models
      • tables, entities, whatever
    • some UI req’s
  • Estimating epics helps w/ product planning  (“How much can we put in by next year?”)
  • Release planning should NOT include epics.  Break them down.
  • AC transitions, which leads is implemented in TDD/BDD style
  • Test names should describe the behavior, not impl.  I’ve got to follow this rule more often.  A lot of tests I write are explicit in that I know what happened if it failed, but the actual story that I’m working on is missing.  The failing test has no context, and thus no value associated with it.
  • BDD classes are named after the state or original behavior.  The setups for this class put the object in that state.
  • Method names are named like the AC
    • public class When_a_case_is_opened
      • public void Its_status_is_changed_to_open

Are Executable Requirements Possible?

  • Jeremy Miller started off by stating the value of Fit vs. FitNesse and a lot of people showed pain with FitNesse. 
  • Fit/FitNesse works great when dealing with state-based testing
  • Behavior based testing is where it breaks down and becomes really cumbersome
  • He invited Joe Ocampo (from Los Techies) to talk about NBehave
  • NBehave solves their problem of providing change tracking and traceability into their organization because they have a strict environment that requires it.
  • They have a fluent language that looks like theUserStory.AsA(“Premier Member”).IWantTo(“get a discount on future purchases”).SoThat(“I can save money”)
  • I joked that they could also have another fluent interface that looked like SystemShall.(“Have a textbox”).ThatShallContain(“the user’s name”) 
  • This helps solve the issue where refactoring is difficult.  Since the strings above are keys for delegate hashes, you’ll get an exception if someone changes the text of a story.  This will spark a much needed conversation with the developers.

I’m still trying to bask in the awesomeness that came from this event.  All you naysayers out there are just upset that you missed out .

Thursday, October 04, 2007

See you at ALT.NET

Get ready folks.  History is in the making.  The Earth will shatter.  People will be enlightened.  The sky will rain candy...

Ok, I'll stop now.

As you can see I'm really excited about the ALT.NET Conference going on this weekend.  I'm especially looking forward to (finally) meeting:
Sadly, I won't be able to meet Ayende Rahien as he won't be able to make it.  I'm really bummed about that.  Also, there are a ton of folks I've met before that I'm eager to catch up with.  And, of course, I'm really interested in meeting NEW people!  It's amazing the amount of excitement and vigor around this community.

I'll be driving in tomorrow night and should arrive around 8pm, so if you want to meet up for dinner/drinks (or if there is something official going on at that time) then drop me a line at ben {at} scheirman {dot} com.

I'm bringing my wife, however she's not so interested in the ALT.NET stuff.  She's more interested in hanging out, having fun, and (probably) shopping.  Maybe I can get her to attend 1 session, who knows.  Maybe we can get her to stop teaching Spanish and start programming.

See you in Austin!

Tuesday, September 18, 2007

I'm on to you, Microsoft

There's a conspiracy going on here.  We all ignored the first signs of it, but now it's too apparent to ignore.   Microsoft is engaging in some devious master plan that will affect most of us.

We all read with shock and awe, Scott Hanselman's post where he announced he was becoming a blue badge.  People wondered what this would do to his blog content, or his contribution to DasBlog.  This was the first sign.  And we did NOTHING.

Today, I saw the 2nd sign, and I'm going to expose this Microsoft conspiracy for what it is.  Phil Haack just announced that he is joining the ranks as a Microsoft employee.  That's right, you heard me. 

Microsoft has hired the technical and charismatic leaders of the two most popular open source blogging platforms for .NET.  This is all a part of a master plan to squash the multi-billion dollar market so that Microsoft alone can swim in the sea of money that is to be made from .NET open source blogging.  Don't kid yourself, there is buku (TM) money to be made in this area.

Sure, both Phil and Scott claim to stay committed to SubText and DasBlog, respectively.  But we all know better.  Soon they will be hard at work, developing the most incredible blogging platform ever devised.  I even have a name for this stealth-assassin project.  It will likely be called Microsoft Collaborative Team Works For Online Weblogs Framework Foundation System 2008.  I can just hear Microsoft Marketing salivating at that title.

All kidding aside, I think that Microsoft is going to be changing it's image, especially in the ASP.NET arena.  They've snatched up some key individuals in the community and they will definitely be making waves.  You can quote me on that.

Sunday, September 16, 2007

Speaking at AgileHouston Next Week

I am going to be speaking on Adopting Agile to our local Agile Houston user group.  Our last presenter, Robert Martin was excellent, and the speaker following me (who I shall not yet name for fear of jinxing it) is going to be stellar as well.  Maybe if I sandwich myself between great people I can be great by proxy.  We’ll see.

Anyway we’re not yet sure of the venue (might not be at UH this time), so keep an eye out on the agile houston website for details.  The date will either be September 24th or 25th, but I thought I would announce it now to give ample notice to those of you who are in Houston but don’t subscribe to the Agile Houston calendar.

My talk will cover some of the foundational principles that are deemed “agile” and why they are valuable.  We’ll also talk about the best way to go about introducing agile at a solo level, a team level, and a company level.  I’d like it to go off as a sort of dialog to get everyone sharing experiences and opinions.

Come check it out next week!