I got the chance to speak at the Manchester Sitecore user group recently, introducing some tools and tricks that can be used to measure site performance while you're developing your Sitecore code. For anyone who wasn't there (and those who were but, want to refer back to what I said) here's a summary of the important bits of content from that talk...
I spent some time working with some code recently, which had some annoying habits of failing oddly in scenarios where nulls got passed into constructors. While I was trying to work around some of these issues, it struck me that tests for parameter handling for constructors are one of those annoying things that tend to make unit testing frustrating. They're annoying boiler-plate to write if you need them, and then a constructor signature changes, you end up with a lot of make-work test changes to do.
So as an exercise in "learning something new", wondered whether I could automate them in a reasonable way...
Recently I've spent some time debugging some issues with a client site. One problem that came up during this work (which, sadly wasn't actually the problem I was looking for) was a set of errors from SQL Replication appearing in the Sitecore logs. In keeping with my previous ranting about keeping your Sitecore logs as error free as possible I spent some time working out how to solve this.
Since I'd not looked at databases at this sort of level for some considerable time, I'm writing down some notes for my future self, next time I have to worry about this sort of thing...
Following on from my previous post about things to think about if you're new to upgrading a Sitecore project in your development environment, there was another side of the issue of upgrading I wanted to point out – some of your deployment choices...
Every so often I get asked to look at existing Sitecore installs and write up reports on what's good and what's not so good about them. I spend time looking at lots of stuff, like the infrastructure, the databases, the code and security. But time after time I find myself writing up a similar issue...
I've been involved in a few discussions about the scope of projects to upgrade existing Sitecore instances in the last few weeks, and quite a lot of that discussion has focused around the "development environment" aspects of the upgrade work. So I thought I would write down some of the things that have come up in my conversations.
It's school holidays as I type this, which means I've been out of the office keeping kids entertained rather than doing anything interesting with code. But all is not lost – because it leaves time for playing some games instead. That reminded me of a conversation I had at Sitecore's Symposium last year about "games I like because they appeal to me as a programmer" – so I thought I'd make a list of the stuff I've enjoyed wasting time with in the last few years (When I've not been playing Minecraft or Terraria with my eldest), in case they appeal to anyone else...
Something I've learned over the course of many years working in IT is that when you hit a difficult to explain problem it's very easy to say "it's the runtime's fault!" or "that's a compiler bug" to cover for the lack of explanation for your problem. The vast majority of the time, it's not true though. It's just a subtler bug in your own work that you can't see yet.
Every so often, however, it is true. And it turns out the issue I discussed the other week about Sitecore rendering a Razor error when you asked for a media item may well be an example of this.
I wasn't at SUGCON**1 this year, but I followed the event on Twitter and have read a few of the write-ups that have been posted since the event. A popular topic this year has been applying machine learning to Sitecore in the quest for ever cleverer personalised experiences. It's fascinating stuff to read about, and I'm sure it has great potential for the future, but what I didn't see much discussion of was the possible down-sides of using "AI" for these tasks rather than people making choices. So allow me to put on some comedy horns and play devil's advocate for a bit...
If you spend your life working with software, you can't help but collect a few stories of issues that defied your understanding – and I came across a great example with Sitecore recently. I haven't managed to decide if this is an issue that can happen to others, or whether it was completely specific to the setup of this particular site. But since I got few useful results from Google when I was trying to solve this, I figure it's worth writing about it just in case someone else sees a similar problem in the future...