Scott Hanselman

April 2006 - Corillian is hiring

April 17, 2006 Comment on this post [1] Posted in Corillian | ASP.NET | Tools
Sponsored By

Wayne Allen posted this on his blog, here's the scoop. These are in Portland, OR on the Westside. Email Wayne directly with your resume (and mention me! ;) )

I have 3 openings in my group right now: Senior QA Engineer, Interaction Designer & Staff Software Engineer.

If you are interested in being involved in the next generation of online banking take a look or drop me an email.

Senior QA Engineer

This is a senior level software quality assurance and testing position reporting to the Manager of the Product Quality Assurance group.  Senior Engineer contributes to the development, deployment and support of products at Corillian.  The Senior Product QA Engineer will scope testing efforts, create test plans, and execute test cases.  In addition, this position will contribute to the development and use of various test tools and mentor less experienced members of QA staff.

Staff Software Engineer

The Staff Software Engineer develops products and completes implementation and customization of products sold to new and existing clients and business partners. This person has a track record of consistently rendering clear technical judgment and routinely considers architecture-level, project-planning, and other project-level issues. This person ensures that projects are conducted in ways that benefit the project objectives, the people participating in the project, and Corillian?s long-term interests. This person is innovative, consistent, and contributes beyond the assigned tasks.

Interaction Designer

The mission for this position is to deliver the most elegant, powerful, useful, and usable interfaces to our customers. The role of the interaction designer is to design, test, and specify requirements for user interfaces and user interaction models. The interaction designer will provide corporate leadership in the advancement of user-centered technology. Act as a resource for providing state-of-the-art professional expertise in the design of graphical user interfaces for web-based applications and supporting documentation. Ensure human factors principles, techniques and guidelines are applied to technology consistently across the organization. Educate management, end-users, and developers about the importance of usability in the design of software applications.

Now playing: ABC News - World News Now, 4.10.06

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Paying off your Mortgage early

April 15, 2006 Comment on this post [48] Posted in Musings
Sponsored By

Mortgage1Seems to me that if one could pay off their mortgage early (earlier than 30 years) it would be a Good Thing (tm). The argument that the tax write off we (American's) get for paying mortgage interest is specious. You get a $0.35 tax break for the privilege of paying the mortgage company $1.00. How is that useful? If I pay $10,000 in a year in just interest, I get to (this is a simplification, really I adjust my gross) write off $3,500 in tax, but I'm STILL out $6,500. That $6,500 could be working elsewhere.

I googled some, thinking the experts on tha intraweb would have something useful to say. This only confirmed that I can get better advice from any public bathroom's wall. Note "Ask Kim" provides different wisdom based on the season.

Mortgage2I did like these reasons though:

Here are a few reasons for Paying Off Your Mortgage Early:

  1. You want more than anything to be 100% debt free.
  2. You want to have more choices and options for your future and no debt gives you this option.
  3. You want to retire early. With no mortgage payment, you can save up for retirement faster and quit sooner.
  4. You want a guaranteed rate of return. Paying off your mortgage guarantees you that savings rate. Investing in the stock market can never guarantee you anything.
  5. You don't itemize but take the standard deduction.
  6. You live in Canada or another country where these is NO tax benefit to carrying a mortgage.
  7. You are disciplined enough that once you have paid off your mortgage, you will invest the same payments into a retirement fund until you have enough to meet your retirement needs. (Remember, with no mortgage, your required retirement income will be greatly reduced.

These resonate with me. Why sell a house that's appreciated 200% when a comparable house has ALSO appreciated 200%? I figure 99% 97% of Americans that own homes also have a mortgage (An official out-of-the-butt-made-up-but-must-be-true Scott Statistic) and that debt fuels the economy. I haven't the chutzpah to go off the grid, but paying of my house would be a start, at least we'd be off the "debt grid."

Even making one extra payment a year can trim SIX YEARS off a 30 year mortgage. Of course, to do this one has to stop consuming. I wonder if a significant number of folks stopped drinking Frappacinos and put the extra money on their mortages if the economy would grind to a halt.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

BUG: Fixing One-Letter Titles in the Title Bar in IE

April 14, 2006 Comment on this post [5] Posted in Bugs | Tools
Sponsored By

Weird bug...suddenly IE shows the first letter of the title bar. Like if the title bar should be "MSDN" it'll say "M" - the "SDN" would be clipped.

Fix? Uninstall (and reinstall, if you like) the Google Toolbar. Obscure.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Programming Sudoku

April 13, 2006 Comment on this post [11] Posted in Programming
Sponsored By

1590596625.01._AA240_SCLZZZZZZZ_

My wife <gasp> declared last week that she wants to learn to program. We sat down and did the whole hello world thing, but that got boring and not-concrete very quickly.

Enter Programming Sudoku from Wei-Meng Lee. This little gem walks you through building a Sudoku generator and solver in Visual Basic 2005.

This book is easy to follow and at the end you'll end up with a very complete (and extendible) WinForms application.

I'm a fan of programming books that walk the reader through the creation of an application (and the thought behind the decisions) from start to finish. Reminds me of the apps I used to type in from Compute! magazine.

Now playing: Stephen Lynch - Bowling Song (Almighty Malachi, Professional Bowling God)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

CodeGen'ing a Data Access Layer with CodeSmith

April 13, 2006 Comment on this post [11] Posted in Nant | Tools
Sponsored By

I mentioned CodeSmith in my podcast post earlier, and we'll talk about it on next week's show, but as a nice coincedence Brian Windheim, one of our architects, posted how he was using Code Generation on one of our internal Corillian (das)Blogs.

Here's what he had to say (some parts redacted):

Brian: I’ve become a huge fan of code generation for data access and object mapping.  The [blank] team has been using a generated data access layer to interface with the [blank] database for a long time now, and the reward has been tremendous.  Without trying to sell it too much, here’s what the client code looks like, inside a hand-coded product API method:

FooThing ReadFooThing(long fooID)

{

   using (SomeDatabase db = new SomeDatabase())

   {

      return FooThing.CreateFromDataReader(db.ReadFooThing(fooID));

   }

}

In the above code, the FooThing and SomeDatabase types are 100% generated code.  Methods are generated for every stored procedure, and multiple sproc calls can be used inside the same using block, as the SqlConnection is maintained for the undisposed life of the SomeDatabase instance.  Classes with single-record and multiple-record column-to-property converters are generated for each table in the database as well.  The codegen implementation will work on just about any database (it is not team-specific), and if you adhere to a few basic rules with your sproc names, the generated code will be very nice.

Some history: last summer I built a CodeSmith template to do the codegen, based on sample code from CodeSmith and some trial and error.  Start to finish was under three hours, and I had no CodeSmith experience before, other than poking around in the [Corillian Voyager SDK’s CodeGen templates].  There has since been some minor maintenance to it, but the overall time commitment has been exceedingly small.  And the benefits?  Here’s a start:

1. Compile-time failures when a stored procedure interface has changed and the application code hasn’t.
2. Type safety for sproc inputs.
3. Automatic column mapping from sproc result sets to strongly typed domain objects.
4. Automatic type mapping from SQL to CLR types and vice-versa.  If the sproc takes in a smallint, you won’t get away with shoving a System.Int64 in there.
5. Automatic mapping of SQL OUT and INOUT params to method return types.
6. Awareness of DbNull and CLR value type collisions.

So what does the generated stored procedure wrapper code look like?  Here’s a sample for a read-single-record sproc:

public IDataReader ReadFooThinglong fooID)

{

   SqlCommand command = new SqlCommand("dbo.ReadFooThing", this._connection);

   command.CommandType = CommandType.StoredProcedure;

   command.Parameters.Add(new SqlParameter("@FooID", fooID));

   return command.ExecuteReader();

}

… and another sample for a create-new-record sproc, which returns the ID of the new record:

public long CreateFooThing(int batchID, long accountID, string checkNumber, decimal amount, string currencyCode,

  DateTime issuedDate, DateTime someDate, string reason, string payee)

{

   SqlCommand command = new SqlCommand("dbo.CreateFooThing", this._connection);

   command.CommandType = CommandType.StoredProcedure;

   command.Parameters.Add(new SqlParameter("@BatchID", batchID));

   command.Parameters.Add(new SqlParameter("@AccountID", accountID));

   command.Parameters.Add(new SqlParameter("@CheckNumber", (checkNumber == null) ? System.DBNull.Value : (object) checkNumber));

   command.Parameters.Add(new SqlParameter("@Amount", amount));

   command.Parameters.Add(new SqlParameter("@CurrencyCode", (currencyCode == null) ? System.DBNull.Value : (object) currencyCode));

   command.Parameters.Add(new SqlParameter("@IssuedDate", (issuedDate == DateTime.MinValue) ? System.DBNull.Value : (object) issuedDate));

   command.Parameters.Add(new SqlParameter("@SomeDate", (someDate == DateTime.MinValue) ? System.DBNull.Value : (object) someDate));

   command.Parameters.Add(new SqlParameter("@Reason", (reason == null) ? System.DBNull.Value : (object) reason));

   command.Parameters.Add(new SqlParameter("@Payee", (payee == null) ? System.DBNull.Value : (object) payee));

   SqlParameter outputParameter = null;

   outputParameter = new SqlParameter("@FooID", new long());

   outputParameter.Direction = ParameterDirection.Output;

   command.Parameters.Add(outputParameter);

   command.ExecuteNonQuery();

   return (long) outputParameter.Value;

}

The generated domain types that correspond to tables are rather big, so I won’t include them here.

I use the code generator in our builds in the following manner:

1. Drop the existing database.
2. Deploy the database (schema + sprocs).
3. Run the code generator to produce SomeDatabase.g.cs.
4. Compile SomeDatabase.g.cs into assembly Corillian.SomeDatabase.Facade.dll.
5. Compile assemblies dependent upon the above.

There are some simple algorithms that I use to determine whether a stored procedure is a read-single, read-multiple, create-new, or something else entirely.  I leave the discovery of this as an exercise to the reader.

My nant build target looks something like the following.  I re-used the [Voyager SDK’s CodeSmith "codegen" task] to kick everything off.  Note that all I need is a connection string …

<target name="codegenDatabaseWrappers">
 <property name="databaseList" value="SomeDatabase"/>
 <echo message="databaseList = ${databaseList}"/>
 <foreach item="String" delim="," in="${databaseList}" property="database.name">
  <do>
   <property name="databaseWrapper.outputFile" value="${database.name}Database.g.cs"/>
   <delete file="DatabaseFacade\DataMapper\${databaseWrapper.outputFile}" failonerror="false"/>
   <codegen template="DatabaseFacade\DataMapper\DatabaseWrapper.cst" outputdir="DatabaseFacade\DataMapper" outputfile="${databaseWrapper.outputFile}">
    <properties>
     <property name="ConnectionString" value="user=${DB_Login};password=${DB_Password};server=${DB_Server};database=${database.name}"/>
    </properties>
   </codegen>
  </do>
 </foreach>
</target>

Scott: Certainly there are dozens (hundreds?) of ways to generate a Database Access Layer (DAL) as there's lots of opinions as to how they should look and what's the best style. The point here is that if your database is nice and regular and needs CRUD (Create, Read, Update, Delete) then there's really no reason you shouldn't be able to generate your DAL (and often even sprocs) from either your sprocs, tables and/or views. You'll lose nothing and gain so much more time, especially in a Continuous Integration environment.

File Attachment: DatabaseWrapper.cst.txt (14 KB)

Unrelated Quote of the Day: "I can't be racist, I drive a Prius!"

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.