June 2014 Blog Posts
Microsoft Surface Pro 3 Macbook Air Trade In Value

When it came out that Microsoft was offering up to $650 trade-in value for a Macbook Air to apply to the cost of a new Microsoft Surface Pro 3, I decided to take a look.

I had a 2011 2 GB MBA, and was concerned how much it would bring, but was happy to find I got around $550 for it, so I now have a mid-level i5, 8 GB RAM, 256 GB SSD Surface Pro 3.

Just starting to play with it, I can see things I don’t like as much as with an MBA, but other things that I do like.  The biggest immediate issue is that the screen is very reflective, so I have to pay more attention to ambient lighting, but I think that is manageable.

Minor tip: when setting up the Pen, put the battery in the right way, it tends not to work as well if you don’t.

posted @ Sunday, June 29, 2014 3:53 PM | Feedback (0)
TDD isn’t dead, it’s dumb

DHH had a post about TDD which apparently has raised a lot of comments.  The usual suspects have replied, showing once again they don’t get it (and in this case adding one of the dumber discussions of monogamy I’ve seen in a while….then again, he’s a developer sort, so, you can’t really expect much).

DHH says:

But first of all take a deep breath. We're herding some sacred cows to the slaughter right now. That's painful and bloody. TDD has been so successful that it's interwoven in a lot of programmer identities. TDD is not just what they do, it's who they are. We have some serious deprogramming ahead of us as a community to get out from under that, and it's going to take some time.

I certainly agree that TDD is a sacred cow for some, and a part of some programmer identities, but I most certainly do not agree that it has been “so successful”, going so far as to posit that it hasn’t been successful at all, from almost any perspective.  The vast majority of test suites that I have encountered have been inadequate, unmaintained, meager, or even worse, have created horribly conceived code bases that are based on myopic opinions about testability, as opposed to what makes for well conceived code or properly driven software development.

Uncle Bob’s response is enlightening in ways he certainly didn’t intend, but I want to focus on one thing he says in particular, what he apparently thinks is the most important thing:

If you have a test suite that you trust so much that you are willing to deploy the system based solely on those tests passing; and if that test suite can be executed in seconds, or minutes, then you can quickly and easily clean the code without fear.

Think about this for a minute.

Cleaning code doesn’t even make it into the top five on the list of most important developer practices, and most definitely not even in the top twenty of most important software development practices.

He talks about how clean code allows developers to code quickly, and without fear.  Simply for the sake of argument, I will accept this for the moment.

But being able to quickly code poorly conceived code is not a good thing.  Most importantly, it’s the wrong focus.

Let me repeat for emphasis, it is the wrong focus.

The proper focus involves determining the proper business requirements and executing them. 

Testing itself, properly conceived, is within the top five of most important developer practices, and at least cracks the top ten of most important software development practices.

But TDD, paradoxically, typically (though not always) leads not only to bad code development, but bad testing itself.

To be a good developer, one really needs to stop thinking and being just a developer, and learning the techniques of TDD but abandoning the dogma of it is probably a necessary step in that direction.

posted @ Monday, June 23, 2014 12:09 AM | Feedback (0)
Date UTC format has zero index months

So, like, if you have January, it, like, is 0, not, like, 1.  And, like, so on.

Just in case you run into this.

posted @ Thursday, June 05, 2014 8:35 PM | Feedback (0)
OleDbDataAdapter and Excel: Why are some of the column values missing?

Ran into this recently, writing it down in case I forget.

I had an excel spreadsheet that I had been importing for quite a while (meaning, a job that had been working for months on daily submitted spreadsheets) and I wanted to add new columns that were present, so I did all the necessary c# work, but then when I ran the updated project, the values were blank, though I verified they were present in the spreadsheet.

It turns out to be related to the fact that the columns were sparsely populated and how the connection string was set up.  The code will try to ‘guess’ data types and whatnot depending on what it sees in the first few rows, so since the columns I was interested weren’t populated in the first few rows, it was missing them later.

You need to add extended properties, like this:

Extended Properties='Excel 8.0;HDR=YES;IMEX=1'

And it is important to put the single-quotes around them, otherwise you will get a “could not find installable ISAM” error message.

posted @ Thursday, June 05, 2014 11:46 AM | Feedback (0)
EF 6 Bug – Can’t share tables across edmx files?

I’m trying to upgrade an application from EF 4 to EF 6 and ran into a number of problems, so I spiked out a simple console app and am seeing the same bizarre behavior.

Using two different .edmx files, using different connection settings, and using custom namespaces, if I try to have each one reference the same two tables, so that they could have those mapped as entities in each namespace, it fails. 

If I run custom tool on the model .tt file one by one, I can see that it will ‘steal’ the entities back and forth, and obviously, when I try to build the solution as a whole, it will choose one of them (reverse alphabetical order?  not sure).

This can’t possibly be right.  Think of a stereotypical eCommerce app.  I will want to have cart entities in a ‘shopping around’ context as well as cart entities in a ‘checking out’ context.  They aren’t the same entities (though they ultimately map to the same tables).  I use earlier versions of Entity Framework to do this as expected.

This can’t possibly be right, I must be doing something horribly silly.

posted @ Wednesday, June 04, 2014 4:06 PM | Feedback (0)