July 2008 - Posts

MVC Framework - A Needle In a Haystack

This is the third in an ongoing series of articles about my team's transition to the Asp.NET MVC Framework.  In my last post I blogged a bit about how I haven't quite got comfortable enough with the new MVC framework to feel über productive.  What augments the feeling is the difficulty of finding quality information.  The data is few and far between and only sometimes relevant.

I was struggling yesterday to find information on the ComponentController class.  Things I was finding were from the Preview 2 release but finding something on the Preview 3 release was a bit more challenging.  Things are rapidly changing...

Read the rest at: http://www.timbarcz.com/blog/MVCFrameworkANeedleInAHaystack.aspx

(Update your feed readers to point to new address http://feeds.feedburner.com/TimBarcz)

with 0 Comments

Formatting Output with String.Format() Part 2 - Left and Right Alignment

I recently posted some code that could have taken advantage of format strings available when using the ToString() for integer output.  The other day I was building a report for a moonlighting gig where some of the text had to be right aligned and left aligned.  String.Format() does that as well.  I've seen some goofy attempts at formatting text, presumably not realizing...

Read the rest at: http://www.timbarcz.com/blog/FormattingOutputWithStringFormatPart2LeftAndRightAlignment.aspx

(Update your feed readers to point to new address http://feeds.feedburner.com/TimBarcz)

with 0 Comments

MVC Framework - Learning to Walk

A few days ago I posted that our team was making the transition from webforms to MVC.  Since then a few days have gone by and I wanted to post my some struggles and successes (however few) in recent days. First, it's been tough wrapping my head around the shift from web forms to MVC.  I would caution anyone making a similar shift or considering it, that...

Read the rest at: http://www.timbarcz.com/blog/MVCFrameworkLearningToWalk.aspx

(Update your feed readers to point to new address http://feeds.feedburner.com/TimBarcz)

with 0 Comments

Making Good On a Promise

Last week I blogged a about Unappreciated Open Source projects.  In the post I made a commitment:

From here on I've resolved to donate a dollar any time I download a free library or webcast where a donate link is presented.  Why $1?  In all honesty it is something I can commit to.

I'm thoroughly looking forward to watching the...

Read the rest at:  http://www.timbarcz.com/blog/MakingGoodOnAPromise.aspx

(Update your feed readers to point to new address http://feeds.feedburner.com/TimBarcz)

with 0 Comments

Using MVC Framework In the Wild, Our Transition to the ASP.NET MVC Framework

We recently decided that with the effort we're putting into our website and some changes that we're making that now would be as good of time as ever to make the switch to the new Asp.net MVC Framework.  We're no Google, but we're currently receiving around 18,000 unique visitors a day and 300,000 page views and hope to grow that number as we make our site easier to use for our customers.  I hope to rely heavily...

Read the rest at:  http://www.timbarcz.com/blog/UsingMVCFrameworkInTheWildOurTransitionToTheASPNETMVCFramework.aspx

(Update your feed readers to point to new address http://feeds.feedburner.com/TimBarcz)

with 0 Comments

Formatting Output with ToString()

A coworker ran across the following and shared with me.

   1: Dim strpage
   2: strpage = pageNumber.ToString()
   3: If Len(strpage) = 1 Then
   4:     strpage = "000" & strpage
   5: ElseIf Len(strpage) = 2 Then
   6:     strpage = "00" & strpage
   7: ElseIf Len(strpage) = 3 Then
   8:     strpage = "0" & strpage
   9: End If 

The programmer is trying to ensure that the page number, when printed out, is always four characters long.  This is not the best way to write this code.  I thought I'd keep this post to myself but unfortunately this isn't the first time I've seen code like this, it is quite common.

The better way to write the above is:

   1: Dim strpage
   2: strpage = pagenumber.ToString("0000")

It's shorter, more concise, and easier to read.  Further the second example is more extensible.  If the requirements change to say the page number should be five characters, the first example must recompile.  The second example must be recompiled as well in it's current state, however the string "0000" could be moved to a configuration file somewhere and then wouldn't need to be.

Originally Posted At:  http://www.timbarcz.com/blog/FormattingOutputWithToString.aspx

(Update your feed readers to point to new address http://www.timbarcz.com/blog/)

with 0 Comments

Underappreciated Open Source

Many people use open source tools, whether its NUnit, Nant, Rhino, or log4net in their professional lives.  If you use any of these tools, when was the last time you donated time and/or money to any of the open source tools you use?  That's what I thought. 

I was recently watching the Hibernating Rhinos from Ayende Rahien and I wanted to thank Oren....

Read the rest at:  http://www.timbarcz.com/blog/2008/07/10/UnappreciatedOpenSource.aspx

(Update your feed readers to point to new address http://www.timbarcz.com/blog/)

with 0 Comments

My "Building A Solid Core" Contest Entry

About a month ago Jean-Paul Boodhoo announced a contest that he was sponsoring.  The contest idea centered around the idea of developing passion in others around you.  I have an immense amount of respect for JP having met him at ALT.NET Seattle.  When the contest was announced I thought I'd put in an entry as I enjoy the journey passion for my craft has taken me on with others.  Here is my entry in its entirety:

Read the rest at:  http://www.timbarcz.com/blog/2008/07/08/MyQuotBuildingASolidCorequotContestEntry.aspx

(Update your feed readers to point to new address http://www.timbarcz.com/blog/)

with 0 Comments