# Monday, 24 October 2011

There isn’t enough hours in the day to not to.

After 13+ years of employment with Coconino County I’ve decided to move on.  It’s been a really tough decision yet at the same time an easy one. 

Comfort

Leaving behind 13 years of effort is hard. 

Leaving behind team members, colleagues and friends I’ve made is hard

Leaving behind something that has become very comfortable and familiar is hard.

Passion

Following my desire to be more involved in the technical day to day leadership and doing is easy.  My heart lies with the coding craft.  I love to code and I love the process of becoming better at it every day. 

When I graduated from College I didn’t think much about code as a craft

From WikiPedia:

In English, to describe something as a craft is to describe it as lying somewhere between an art (which relies on talent) and a science (which relies on knowledge).

I think most colleges miss the first part of that.  It’s a shame as I believe this is a huge key to great programmers.  Perhaps it’s too much to ask of them?  After all many in the class are still just trying to understand a For loop or Big O notation.

What I do know is you can’t teach passion and this is key to the artistic side.  It’s all about internal motivation.  I’ve always enjoyed coding and always saw it as a way of expressing myself.  But I was lacking something and I didn’t know it.

Body Of All Possible Knowledge - courtesy of http://maxme.org/old_site/bodyknow.htm

My Awakening

About three years back I bought a license to Safari Books Online.  It cost more than what we were budgeting yearly for literature but I was staring at a bookshelf full of out of date books.  There had to be a better way.  With so many books at my fingertips I went from reading one or two books a year to seven or eight with a few more that I perused through and a slew of development blogs.

Clean Code

Clean Code, by Uncle Bob was perhaps the most influential in changing the way I thought about code.  Along with many more books and blogs I found that code could be so much more than just code.  It is my creative outlet to solving other people’s problems and it can be elegant and poetic.  Yes, I’m getting all gushy. The simple answer is that I care deeply about honing my code craft and we need more who think and feel this way in our trade. 

My Code Passion

  • I love making life easier for people. Building software for this purpose is a passion; it's not just a job. I am constantly looking for ways to better myself, my code, my team and my product.
  • I believe that deleting code is a beautiful thing.
  • I want to leave code in better shape every time I touch it.
  • I believe that well written code can be read like a story line.
  • I believe in constantly looking to improve one-self and those around them.
  • I believe that craftsmanship isn't just for wood working.

A New Journey

Passion - Courtesy of http://maxme.org/old_site/Passion.htmFollowing my passion, this week, I began a new journey with NAU (my alma mater) as a Senior Developer.  I will be responsible for setting the architectural direction and development of several applications around the advising process for Freshman and Sophomore students before they declare their major.  The group I support also helps them land jobs!  I’m very excited about it and look forward to bringing my skills to the table as well as continuing to hone my coding craft.

Need a little more help stoking your fire?  Read The Passionate Programmer

We need a few more passionate programmers.  Won’t you join us?

Happy Coding! :-)

Posted 10.24.2011  #    Comments [0]  | 
# Saturday, 06 November 2010

There are a lot of things that can sink an app but none more visible, yet often overlooked, than a poor user experience.sinking

User Experience Matters

Duh, of course!  Something we all know, right? But do we take care of the UI with the same passion as we do with code?  In order to ensure the user experience remains relevant and a pleasant experience requires refactoring as well.  Like code that can erode over time, the user experience can suffer the same fate.

 The Eroding UI Example

Our team has worked on an application that’s used throughout the organization to enter requests for budget.  The application has gone through several heavy revisions over the past few budget cycles and each time we have had a very tight timeline.  It’s always been a mad rush to make the modifications necessary to accommodate the changes in the process. 

Over time, the UI slowly began to mismatch how the users worked.  The UI grew into a large form and required all the fields to be filled in before a user could save any work.  The nature of how the user worked was very different.

The user process is highly iterative and collaborative within business units who are developing requests.  They often work on one section’s wording over and over until they have it just right and then move to the next section. 

Unfortunately, the UI didn’t handle this well.  Fields that required a lot of text (several paragraphs) were forced into a small text area that had to be scrolled to read.  Users would just print a report to see all the text to get around this.  With all fields being required, users entered garbage/placeholder information into fields in order to save their work.

old

 

New ideas were introduced into the process and the application grew.  A few more forms were added.  The flow was changed so that the user was required to enter this information and save it as a separate step from the main form.  The items were required but very much felt like a bolt on and not as important.

 

An Aside…

Who’s fault is this?  Mine.  It’s the job of the team leader to remove barriers to success and help foster and create situations that lead to success.  It took me a few tries to get us to the point where the team could work their magic properly instead of being hamstrung by constraints that could have been better managed by yours truly. 

 Redesign

This year we took the time to give the application some tender loving care.  The vision was to create logical sections of information.  Maximize space utilization for the sections and move away from strict validation to a routine that would allow saving work anytime while quickly showing what is left to be completed.

The team took the vision and ran with it.

Navigation

nav

The team created a new navigation section that is very pleasing on the eyes and more visible.  The team nearly eliminated the need to scroll vertically on the page. When scrolling does occur the team floated the navigation so that it will always be at the top of the screen.  The save and cancel operation work on the entire record, versus several forms that required saving separately.  Additionally, the user can save at anytime and reduced the number of absolutely required fields down to two.

Layout

tabs

The team created tabs to group similar information into sections.  The tabs have an icon representing if that section has been completed or not. 

Additional information is in each tab to help the user.  When a tab has a green check mark the tab includes a message stating it’s complete.

tabGreen

If the tab is incomplete, represented by the yellow warning sign, a message is shown stating what is needed and each element on the form that needs attention has the same warning icon and it’s own message.

incomplete

With “softer” validation in place the user is able to work on a request in whatever order they need to and with a glance see what is incomplete.  They can also save their work in whatever state they want.  This lends itself well to the iterative drafting process of the initial budget development cycle.

Handling large text needs was simplified by giving them their very own tab.

largeText

More obtrusive (yet nice) messaging was added to the system to help ensure the user doesn’t accidently/inadvertently do something.

delete

The real test - What are the users saying?

In the users tests we’ve conducted we received rave reviews.  We have a few weeks to go to finalize the application and go live with the entire user community.  It’s exciting!

It’s coming along great and I am extremely pleased with the team’s redesign and the large undertaking to replace the strict validation with a softer/gentler validation technique to serve the users better.  Kudos to the team!

Conclusion 

The UI is not immune to change and requires the same level of care that code does.  The need to develop changes can erode the UI just like code.  The UI requires our attention and needs refactoring as well to stay relevant.

Happy Coding!

Posted 11.06.2010  #    Comments [0]  | 
# Friday, 07 May 2010

A few posts back I wrote about adding character counting to the .Net AJAX HTML Editor.  Recently, I received a question asking how to hide and show the character count element for the .Net AJAX HTML Editor when the editor goes in and out of focus.  The short and sweet answer is to wire up a function on the focus and blur events of the editor control and call the hide / show methods in jQuery on your count element.

$(GetEditor()).focus(function() {
  $(Editor1InfoArea).show();
}).blur(function() {
  $(Editor1InfoArea).hide();
});

Just add the above code in the $(document).ready function and away you go.  The GetEditor function and Editor1InfoArea variable are referenced in code in the original post.

However, jQuery has a lot to offer and I wanted to show some of these offerings.  I took advantage of method chaining to save myself having to call $(GetEditor()) twice as shown below.

$(GetEditor()).focus(function() { $(Editor1InfoArea).show();  });
$(GetEditor()).blur(function() { $(Editor1InfoArea).hide(); });

If your new to jQuery chaining may throw you a bit but it works great for saving keystrokes and once you get used to the syntax can be easy to follow. 

Beyond the show and hide methods you could call on many other methods to add some panache (Come on, give this one to me,  I am French after all).

You could replace show/hide with some of these combinations:

Nothing like making your app a little more appealing with some animation.  But wait! There’s more.

You can also change the style with the css method:

$(Editor1InfoArea).css("display", "block");
$(Editor1InfoArea).css("display", "none");
Or
$(Editor1InfoArea).css("visibility", "");
$(Editor1InfoArea).css("visibility", "hidden");

Of course, you are using classes to make easier management of your styling right?  You can use the addClass/removeClass methods:

$(Editor1InfoArea).addClass("showCounter");
$(Editor1InfoArea).removeClass("showCounter");

* What about the toggle method? Ah, I’m glad you asked. In this case since we are tracking the focus and blur events you may end up with the toggle working the opposite as you expect.  This is because toggle does the opposite of what the targeted element’s visible value is when called.  You can fix this by calling the show or hide on your element after the focus/bind methods are setup.  Toggle is really designed for the click event but can be used in this situation.

So there you have it.  More ways than you probably care to know and I wouldn’t be surprised if there were more. 

A parting thought.  Earlier this week I read a great post on the performance of show/hide vs. toggle, css and addClass/removeClass.  Check it out if you want to read more on it but the basic answer is calling the css method is the best.  However, there is one more way that’s even faster but you’ll just have to read the article to find out what it is.

Happy Coding! :-)

Posted 05.07.2010  #    Comments [0]  | 
# Thursday, 22 April 2010

I recently needed to make a change to some code that had a routine for getting the week currently in.  I needed to add the ability to get the previous / last week relative to this week.  No problem, I would just work off of the existing routine.

Private Sub SetDatesToThisWeek()

  Dim dateStart As String
  Dim dateEnd As String

  Dim dateNow As Date
  dateNow = Now

  dateStart = (Weekday(dateNow, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) - 1).ToString
  dateStart = DateAdd(DateInterval.Day, -CType(dateStart, Double), dateNow).ToString
  dateStart = Format(System.Convert.ToDateTime(dateStart), "MM/dd/yyyy")

  dateEnd = DateAdd(DateInterval.Day, 6, System.Convert.ToDateTime(dateStart)).ToString
  dateEnd = Format(System.Convert.ToDateTime(dateEnd), "MM/dd/yyyy")
 
  Me.StartDate.Text = dateStart
  Me.EndDate.Text = dateEnd
End Sub

It took me a little bit of time to digest the routine and realized I needed to simplify the routine and even though the code is in VB I wanted to remove the dependence on the Microsoft.VisualBasic library as well.  This means getting rid of Weekday, DateAdd, etc and replace with the framework standard.  I love not reinventing the wheel and happened to find a nice pointer on stack overflow.

Private Sub SetDatesToThisWeek()

  Dim thisSunday As Date = DateTime.Now.AddDays(-(DateTime.Now.DayOfWeek - DayOfWeek.Sunday))
  Me.StartDate.Text = Format(thisSunday, "MM/dd/yyyy")
  Me.EndDate.Text = Format(thisSunday.AddDays(6), "MM/dd/yyyy")

End Sub

11 lines of code and three variables down to three lines and one variable with the added benefit of being easier to read, understand and the reliance on Microsoft.VisualBasic gone (at least for this code). Since I needed to create another routine that returns last week I decided as suggested in one of the stack overflow answers to create an extension on the date type.

Imports System.Runtime.CompilerServices

Module DateExtensions

  <Extension()> _
  Public Function StartOfWeek(ByVal aDate As Date, ByVal dayToStartWeek As DayOfWeek) As Date
    Return aDate.AddDays(-(aDate.DayOfWeek - dayToStartWeek))
  End Function
End Module

Now I can use the extension like so:

Private Sub SetDatesToLastWeek()

  Dim lastSunday As Date = DateTime.Now.StartOfWeek(DayOfWeek.Sunday).AddDays(-7)
  Me.StartDate.Text = Format(lastSunday, "MM/dd/yyyy")
  Me.EndDate.Text = Format(lastSunday.AddDays(6), "MM/dd/yyyy")
End Sub

Private Sub SetDatesToThisWeek()

  Dim thisSunday As Date = DateTime.Now.StartOfWeek(DayOfWeek.Sunday)
  Me.StartDate.Text = Format(thisSunday, "MM/dd/yyyy")
  Me.EndDate.Text = Format(thisSunday.AddDays(6), "MM/dd/yyyy")
End Sub
The C# version of the extension is a little different than VB:
namespace Extensions
{
    public static class DateExtension
    {
        public static Date StartOfWeek(this Date aDate, DayOfWeek dayToStartWeek)
        {
            return aDate.AddDays(-(aDate.DayOfWeek - dayToStartWeek));
        }
    }   
}

Leaving code better off than when you started is always a great feeling.

Happy Coding!

P.S. – I also replaced the date formatting strings with a constant. :-)

C# | Programming | VB
Posted 04.22.2010  #    Comments [0]  | 
# Saturday, 20 March 2010

Need to parse a text file or perhaps a stream?  Tired of writing parsing code to do this?  Well, for only $19.95….  Ha, ha,  just kidding.  I ran across FileHelpers earlier this week and was impressed.

FileHelpers are a free and easy to use .NET library to import/export data from fixed length or delimited records in files, strings or streams.
The idea is pretty simple:

You can strong type your flat file (fixed or delimited) simply describing a class that maps to each record and later read/write your file as an strong typed .NET array

The Library also has support for import/export data from differents storages like Excel, Access, SqlServer, etc. – Home page of FileHelpers.com

Setting it up and getting started is very easy.  I’ll walk you through a sample.

I have a CSV file with usernames and email addresses in it.  I need to parse that file and I need to verify the information in the CSV against another data store.  I won’t go into verifying to the other data store for this example.

For the purpose of the exercise, create a new C# console project named FileHelpersSample.

Download version 2.0 and reference the FileHelpers library in your project.

Here’s how our CSV looks:

joeuser,joeuser@email.com
awinter,awinter@summer.com
jdoe,jdoe@welcome.org

HINT - If you are following along and creating this project from scratch be sure to create a file named Users.csv with the above entries in it and put it in your debug/release bin folders.

In your project create a new class called User.  This class will be used to map the CSV file.

using System;
using FileHelpers;

namespace FileHelpersSample
{
    [DelimitedRecord(",")]
    public class User
    {
        public string username;
        public string email;
    }
}

Now create a new class and call it Parser.  This class will invoke the FileHelpers engine to parse the file.  It should look like this:

using System;
using System.Collections.Generic;
using FileHelpers;

namespace FileHelpersSample
{
    public class Parser
    {
        private string _filePath;
        public Parser(string filePath)
        {
            _filePath = filePath;
        }

        public User[] Parse()
        {
            FileHelperEngine engine = new FileHelperEngine();
            return engine.ReadFile(_filePath);
        }
    }
}

The FileHelperEngine uses generics to accept the mapping class.  When the ReadFile method is called on the object it uses the mapping to return an array of User objects.

It’s that easy to parse a CSV file.

Now, let’s complete the sample.  Open the Program.cs file and copy the code below:

using System;
using System.Collections.Generic;

namespace FileHelpersSample
{
    class Program
    {
        static void Main(string[] args)
        {
            Parser userParser = new Parser("Users.csv");
            DisplayUsers(userParser.Parse());

            Console.ReadLine(); 
        }

        static void DisplayUsers(User[] list)
        {
            foreach (User u in list)
                Console.WriteLine("{0} {1}", u.username, u.email);   
        }
    }
}

Run the project and you should see:

image 

That was easy! 

The library can do a lot more than this simple example shows.  Be sure to read their quick starts and samples.  The library can ignore the first and last X number of lines as well as empty lines.  It can ignore/process records based on conditions you set along with many other options.  It even has a tool to create your mapping class.

Download this sample in C# or VB.

Happy Coding!

C# | Open Source | Parsing | Programming | VB
Posted 03.20.2010  #    Comments [0]  | 
# Saturday, 06 March 2010

It’s been almost two years since StackOverflow went live.  The brain child of Jeff Atwood and Joel Spolsky, StackOverflow has fast become the top programming Q & A site and it’s free!

The site is incredibly easy to use, their reputation engine is perfect for ensuring you know you are getting a good or bad answer since the entire community rates both the question and answers.  Answers come fast and the best one is identified very fast as well.  It’s like having a top gun coder in your back pocket for any topic you can think of!  We can’t know everything (unless your Jon Skeet). 

I have found SO to be a great resource for finding answers.  I also frequent it to help answer questions for others.

Happy Coding!

Posted 03.06.2010  #    Comments [0]  | 
# Friday, 26 February 2010

I was not asked nor am I being paid for this post.  I just want to let other’s know about a service that I have found to be incredibly valuable to improving my code craft.

I knew about Safari Books Online for a couple of years before I decided to give it a shot.  I had trepidation at first due to the price point and wasn’t sure if I would really use it.  I averaged a few books a year so it didn’t seem worth it.  Nine months have passed since I took it for a spin and I am smitten with Safari and here’s why.

  1. Thousands of Books at your fingertips

Nearly 11,000 as of this writing.  The publisher list is large and I have only a couple of a cases where a book I wanted was not in the library.  They are adding titles every week it seems like.  For the most part, I feel like a kid in a candy store seeing all the books that are available.  I have 47 books in my bookshelf at this time and have accessed many more.

  1. Features, features, features

I have a habit of marking up, highlighting and dog earring the books I read.  While this is great it’s still not the easiest to find that note or dog ear I made that had that particular topic I wanted to re-read or apply.  Enter the world of Safari Books Online.  I can add bookmarks and notes to my books and easily access them.  I can email and even download books/chapters if I want/need to.  The books have hyperlinked references & related content.  The searching ability offers a great way to find topics of particular interest in different books if you are wanting to learn/read on a particular topic rather than read an entire book.

  1. Accessibility

At first I had a hard time reading a book electronically.  It felt awkward and I wanted the physical book.  That didn’t take long to get over.  The ability to pick up where I left off on a book anywhere I have access to the internet is unbeatable.  I have used Safari at home, at the office and recently Safari added mobile devices to the list.  I experimented with the mobile device for my BlackBerry and found it to be pleasing.  Naturally, a larger media device would be preferable but if you don’t have one the small BlackBerry screen and Safari’s layout make it very readable.

  1. No Worries = More Reading = More Learning

Should I buy this?  I fought this question over and over again before Safari.  Now my battle is which book will I read next.  In the nine months or so of owning Safari I have read through six books and will finish my seventh soon.  I figure I will get another three in before the year is over.  That’s 10 books from cover to cover in a year. That doesn’t include the others I have browsed through, read a chapter here, looked at a code sample there.  I would easily say this is the most I have read in a year.  All thanks to the simple fact that I don’t have to shell out money every time I think I want to read a book.  There’s even been a couple of books on Safari that I started to read and then dropped after realizing I didn’t care for them.  Had I purchased the book outright I would have been disappointed.  Instead I feel liberated and empowered.

  1. Cost

Safari Offers two versions of it’s service for individuals.  The 10-slot bookshelf costs just over $250 a year and the unlimited access version weighs in at just under $475 as of this writing.  If you are like me the unlimited access version starts to feel a little costly but that’s the version I bought and have found it to be well worth to cost.

I have 47 books in my bookshelf currently.  If I bought each one at an average of $25 I would have shelled out nearly $1,200.  Let’s be honest though, I would not have bought all those books.  Instead let’s just say that I would have bought 10 of them since that’s what I believe I will have read completely through using Safari in a year.  I still would spend $250.  At the least, I have equaled the value of the 10-slot bookshelf.  It may be hard to find technology books for $25 average unless you buy used as much as possible.  If the average book cost $40 we are fast approaching the value of the unlimited bookshelf and don’t forget the shipping costs.

Now throw in the added features you get with Safari and I thinks it’s clear that Safari is a great tool well worth the price for any developer.

I have one nagging thought about Safari but it has nothing to do with it’s service.  I have no idea how author’s are compensated for book usage.  I hope it’s a good deal for them but I imagine it’s still not as good as buying a book outright.  Still, there’s a good chance I wouldn’t have bought the book in the first place so perhaps Safari is helping to increase their revenue. :-)

Happy coding, err… reading!

Posted 02.26.2010  #    Comments [0]  | 
# Friday, 11 December 2009

In an earlier post I added character counting functionality to the ASP.Net AJAX HTML Editor with jQuery.  Soon after posting the entry I noticed that cutting and pasting text into the editor via the context menu did not change the character count immediately.  I enhanced the jQuery code in my last post to do this.

var Editor1 = '#Editor1';
var Editor1CountLimit = 50
var Editor1InfoArea = '#Info';

$(document).ready(function() {
    TrackCharacterCount(Editor1, Editor1CountLimit, Editor1InfoArea);
});

function TrackCharacterCount(ctl, limit, info) {
    var editor = GetEditor();
    $(editor).load(function() {

    var body = $(this).contents().find('body');
    var txt = $(body).text();
    $(info).html(txt.length); //set initial value 

    $(body).bind('cut paste', function(e) {
            setTimeout(function() {
                var txt = $(body).text();
                UpdateTextCounter(txt,limit,info);
            }, 150)
        });
        
        $(this).contents().keyup(function() {
            var txt = $(this).contents().find('body').text();
            UpdateTextCounter(txt,limit,info);
        });
    });
}

function UpdateTextCounter(txt,limit,counter) {
    if (txt.length > limit)
        $(counter).html(txt.length).css("color", "red");
    else
        $(counter).html(txt.length).css("color", "");
} 

I added the bind code on line 17 to handle the cut and paste functionality.  I went through a couple iterations of the cut & paste functionality to count the characters correctly.  I was running into an issue where the textbox value was not being updated immediately with what was pasted.  Then I stumbled upon a nice stackoverflow answer that used a timeout to wait for the textbox to be updated.  This little jewel allowed me to simplify the code to what it is now.

I refactored the code to decrease duplication of code by creating the UpdateTextCounter function. 

I also noticed a subtle difference between IE7 and IE8 that stopped the counter from working and have corrected that in this version with a browser check.

function GetEditor() {
    if ($.browser.msie == 'true' && $.browser.version == '7.0')
        return editor = $(Editor1).contents().find('iframe').eq(1);
    else
        return editor = $(Editor1).contents().find('iframe').eq(2);
}

I verified the code runs on IE7, IE8, FF 3.5.5 & Chrome 3.0.

Enjoy!

AjaxHtmlEditorV2.zip (1.28 MB)

Read the first post.

Read the next post where I fix a bug when using a customized toolbox with the editor and find a better way to locate the IFrame that our text editor is in.

Posted 12.11.2009  #    Comments [0]  | 
# Saturday, 05 December 2009

Dynamic Data is a new project type in VS 2008.  It uses scaffolding to help code faster.  Over the past month or so I have been playing with DD and wanted to share the resources that have helped me understand and use/customize DD.

Dynamic data on codeplex: Good resource, has lots of samples on doing things beyond the basics. http://aspnet.codeplex.com/Wiki/View.aspx?title=Dynamic%20Data

Some samples include creating your own view using your own select statement.  Also in the samples is how to use Stored Procedures with DD.

Matt Berseth - http://mattberseth.com/blog/dynamic_data/

Has some nice tutorials on going beyond the basics like creating a custom meta provider that allows you to change the default way your columns are named.  For example, have the columns be Product ID instead of ProductID.

Stephen Naughton - http://csharpbits.notaclue.net/

Perhaps the best site I have found for taking DD to the next level.  Many examples of customization.  Stephen is an expert on DD in my opinion.  I used a sample from him to turn off foreign keys from showing at all for the entire application.

Craig Shoemaker also has some great examples and a book for about $10. The book isn't heavily into the underpinnings though but is worth the price for a beginner.  He also has a deep dive example which goes a little more in depth.

http://weblogs.asp.net/craigshoemaker/archive/tags/Dynamic+Data/default.aspx

http://blogs.msdn.com/rickandy/archive/2009/01/08/dynamic-data-faq.aspx - Great links to resources and perhaps my second most visited site while trying to get a handle on DD.

http://www.asp.net/learn/3.5-SP1/ - video's on DD...

http://forums.asp.net/1145.aspx - forums for dynamic data....

Depending on your level of skill with Linq2SQL or Linq2EF you may want to learn more on them as well since DD sits on top of these tools.  Knowing more about these topics and extending them will also add to your arsenal for DD.

For me, I found the basics of DD to be easy to grasp but I quickly realized two things: 

  1. DD could be really great for small tasks like creating administrative pages that allow users to add / edit lookup tables, etc….
  2. Taking DD off road, aka – going beyond the basics will require a much deeper knowledge (duh).

The three items I found that are important to understand in order to take DD off road:

  • Modify / define your own metadata providers.

http://mattberseth.com/blog/2008/08/dynamic%5Fdata%5Fand%5Fcustom%5Fmetada.html - Names all columns with a space between words... Yes, you could use the DisplayName attribute but this is a sample of how to refine the basic scaffolding project.

  • Creating your own attributes.

http://csharpbits.notaclue.net/2009/04/hiding-foreign-key-column-globally-in.html - Sample of creating an attribute to hide the foreign key column for all tables.

http://csharpbits.notaclue.net/2008/10/dynamic-data-hiding-columns-in-selected.html - Sample of another attribute to hide a column but applied at the page level.

  • Create / modify the templates.

You can create your own templates and modify the existing templates to influence the UI experience.

After this, to get DD ready for the real world you can:

Tier it:

http://weblogs.asp.net/craigshoemaker/archive/tags/Dynamic+Data/default.aspx

Mix it with Web forms, with MVC... http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473

Use AJAX and/or JQuery….  These are not DD specific modifications but likely necessary to be real world ready.

Hope this helps you on your journey!

Posted 12.05.2009  #    Comments [0]  | 
# Wednesday, 25 November 2009

I believe strongly in teams being families.  We spend eight hours a day, five days a week with each other.  A great team is able to take everyone’s ups and downs, pluses and minuses, strengths and weaknesses with dignity, respect and healthy doses of humor.  A great team is a team that isn’t all alike and embraces and remains open to diversity of ideas, backgrounds and ways of thinking even when it’s hard for them to do so.

Lindy White was one of the most unique team members I have had the pleasure to work with and go on to lead.  His candor was unmatched and so was his personality.  His tenacity and intensity for development was infectious.  He was an extremely valuable team member.  He made us all better.

Many years back we moved our website to a CMS system.  Over the years, the site grew to have around eighty content liaisons (users who could write content).  Unfortunately, strewn throughout the website were email addresses.  Our website was responsible for a large amount of email cherry picking by bots.  The team discussed how we could handle this and Lindy was given the lead to develop the solution.

As time went on, Lindy being Lindy was unsatisfied with the solution being developed and struck out to find a better way.  What he came up with was pure gold.  He wrote an HTTP Module that intercepted the outgoing HTML and converted all email addresses to a format bots could not use/read. With zero changes to our end users and next to zero maintenance on our part the web bots can no longer steal email addresses from the website.  I nominated him for an IT Pro Hero award through Windows IT Pro magazine.  Here’s the article:

http://windowsitpro.com/article/articleid/100073/lock-out-spambots.html

Lindy knew of the award but sadly he passed away before he could see the article with his own eyes. 

It’s been a little over a year since he left us and I still think about him all the time.  Lindy, I miss you and you will always have a special place in my heart.  Thanks for the memories!

Posted 11.25.2009  #    Comments [0]  | 

I have been developing with ASP.Net since it debuted.  Before that I was doing windows form development with VB and classic ASP web development.  The advent of ASP.Net was phenomenal for me and my team.  The web forms model allowed our team to continue using the Windows event driven model over the web and allowed us to take our web development to a new level than classic ASP.  We quickly dispatched of our windows development in favor of the simple deploy / update model and gladly left the dreaded PC install / update nightmare.

Fast forward many years and ASP.Net matured quite a bit, Windows Forms had click once and all sorts of other goodies in the framework.  Now MVC.  My experience with MVC up until this point had only been my reading in the Gang of Four book and the occasional blog entry.  While all this was going on I had (and still am) been on a mission to improve my programming skills.  The majority of this was and has been reading, reading, and more reading.  I started trying out test driven development with a side project of mine.  The project was web forms based.  I was greatly encouraged with TDD but had read all the difficulties with TDD and web forms.  I had just begun this side project and decided why not make the switch to MVC?  So I did.

Along the way, I have had a lot of  "aha" moments.  Here’s some of them:

Web forms code behind faked me out. I thought I had good separation of concerns. Or I really abused the code behind file but I thought I was doing right.

For quite a while I knew large code behind files were not healthy.  I had been working as best as possible to decrease the code in them.  However, with my MVC journey I think I have come to see just how unhealthy large code behind files are and just because the code was not in the same file as my html did not mean I had a strong separation.  MVC by it’s nature encourages good separation and all the books and blog entries I have read show this by default.  In the web forms world I had to seek this out (not so much today but definitely in the early days and habits can be hard to change).

I’m having data source withdrawals and View State withdrawals.

I’m nearly over it now but this was a big hurdle for me.  It’s amazing how reliant I became on this but it shouldn’t be too much of a surprise since this is the magic of Web Forms. 

I'm loving having control back of the HTML and the HTML is actually readable now.

This is definitely has been a pleasant return to HTML for me.  With web forms I went on autopilot for much of the HTML / JavaScript that my apps produced.  I just lived with it even when I saw disgusting and bloated source.  Many took great pains to make web forms bend to their HTML will and I certainly understand why.  For me though, this is one of the reasons I like web forms so it didn’t bother me much.

So why would I want the control back.  Simple, because I can easily have it back now and the trade off to me doesn’t really feel like a trade off.  MVC is far more bare bones by design but I still don’t feel like I am back at the classic ASP spaghetti code.  It’s this bare bones nature that I am really digging.  I have a lot more control over everything and even though I may not want to control a lot I know I have the option to.  I do miss at times the "drag and drop a control unto the canvas and go" mentality but with jQuery and HTML helpers I am missing it less and less as I become more proficient.

Hello, JavaScript. It's been a while since we last worked together.

With web forms, I enjoyed the luxury of not having to really getting down and dirty with JavaScript.  I used everything at my disposal to use a control and/or post backs to handle what was needed and only used JavaScript when I needed to.  Mind you, I realized this came with a price of some nice user interactions but I was willing to pay that price.  JavaScript and the DOM specifically were always giving me fits. 

Unfortunately, this experience in the long ago past blinded me to the wonderful things going on with JavaScript over the years.  With JavaScript libraries like jQuery the capabilities that once required a JavaScript and DOM wizard are now at your fingertips.  I have fallen for JavaScript and am ashamed I had closed my mind off to it for so long. 

MVC by it’s nature encourages JavaScript for rich UI interaction much like controls did for Web Forms but so much more.

Testing? Ya, I did that. It's F5 right?

MVC was not my start on considering better ways to test but everything I read and worked with on MVC had testing involved all the way.  Every book I have read, every beginning MVC blog entry has testing intertwined.  My first attempts at unit testing was with a web forms project and I was absolutely convinced it would make me a better developer, faster developer and create more maintainable code.  However, with web forms, testing for me and many I suspect was changing some code and hitting F5 to run the application and manually test.  With a little unit testing / TDD under my belt I have come to see how much more efficient it is to "F5 testing". 

MVC permeates with the idea of unit testing and that’s by design.  I have much to learn on my testing journey but it has already paid dividends for me that has me convinced it’s an important tool in my toolset.

I am working in harmony with the HTTP protocol now.

I mentioned one of the reasons I liked web forms is that it allowed me a very easy transition from windows forms development.  As much as I would like to say I understood how the web really worked underneath the hood I know now that I didn’t.  Yes, I knew it was stateless and all that jazz but with web forms I was abstracted away from the way the web worked. 

When I started learning MVC it became painfully obvious how much I had forgotten and/or didn’t really understand about how the web works.  I am still tripping over this while I continue my MVC journey but I am happy to say that the knowledge gained in understanding more deeply how the HTTP protocol really works is making me a better web developer.  “Working in harmony” is a paraphrased quote from "Pro ASP.NET MVC Framework" by Steven Sanderson.

I am enjoying my MVC journey and look forward to becoming extremely proficient with it.  I will also admit that much of my 'aha' moments are not because of Web Forms, rather they were mainly a result of my own lack of exploration into what was possible and what was out there.  I was too busy keeping my head down and firing out widgets instead of really trying to hone my craft at all times while spitting out widgets. :-) This has changed for me now.  I have an extremely strong desire to be a real craftsman and not just someone who can bang on a keyboard.

Web Forms is a great tool and I imagine I will continue to have it as a tool in my toolset for a long time to come along with MVC.

Posted 11.25.2009  #    Comments [0]  | 
# Sunday, 15 November 2009

I live in Flagstaff, Arizona and since it’s a small town not many happenings occur for coder geeks.  I wanted to come out of my shell a bit and head down to the Valley (Phoenix).  It’s only a couple hour drive, not too bad.  I decided to attend Desert Code Camp this year for the first time and all the sessions I attended were great.  They even fed us which I was not expecting.  What a great camp!

The camp heavily favored web development but that’s the majority of my work.  I attended several sessions and want to give a small run down and thanks to the presenters and to the organizer.

First and foremost, to the organizer, Joseph Guadagno, thank you!  I can’t imagine the work it took to put it together and all the volunteers by your side.

To all the presenters, thanks.  Giving your time to teach others is always appreciated.

I wanted to give a special thanks to Michael Collins, Saul Mora, Rex Miller, Steve Andrews and Remi Taylor.  You guys did a great job on your presentations!  I mean it.

Michael – I wasn’t sure what I would find sitting in on Advanced Debugging with Visual Studio.  Well, I was more than surprised.  You gave me some good ideas and I just might write a visualizer now!

Saul – If there was an award for most animated and informational,  you’d get it!  I attended your sessions on CSS3 & JavaScript.

Rex – You deserve the award for doing as much as you could in 30 minutes!  Unfortunately, the schedule dealt you a short session.  However, you did a great job of going over the basics of ASP.Net MVC.  If you had an hour I imagine you would have been able to dive into more challenging stuff.

Steve – What can you expect when hardware just doesn’t want to go your way!  Joe to rescue!  Your session on tips & tricks in VS.Net was great.  I already have Sara Ford’s book that you mentioned and read it a while back but there’s just so many tips & tricks.  You gave me a few new ones!

Remi – What can I say?  You are a jQuery wizard and your presentation on it had me salivating.  As luck would have it, I was able to put some of it to good use fairly quickly back at the office.

I’m looking forward to next year's Desert Code Camp!

Posted 11.15.2009  #    Comments [1]  |