December 29th, 2009 §
Its been a while since I’ve read a book that’s almost purely about a programming language and C# in Depth does not disappoint. Even though I’ve recently done a couple of Microsoft certification exams and read the relevant preparation materials, those were more about the .NET framework and the .NET libraries more than any particular programming language. This book is all C# though, cover to cover, and Jon Skeet lives up to the hype…
Fear not! There is none of the boring “Chapter 1: What is a class” type of material here. It is assumed that you are already familiar with programming in C# and the material serves more to highlight how the language has evolved from C# 1.1, through C# 2.0 to C# 3.0 and explains how the language version numbers are not the same as the framework version numbers. The book dives right into a preview of the most modern C# trends, before going back to explain how it all got to be that way. Some of it was really mind-blowing stuff to me, and it really shouldn’t have been because that was only the C# 2.0 parts. There is so much potential in the C# 2.0 language and .NET 2.0 framework and they are really under-utilised, possibly due to being overshadowed by the emergence of .NET 3.0 and quickly followed by .NET 3.5 with LINQ.
For those LINQ enthusiasts out there, you really should read this book if you want to understand the fundamentals of LINQ and where it evolved from (a LOT of it is based in C# 2.0 generics and anonymous methods/delegates). If you’re like most of us developers, you’re probably only just moving on to using .NET 3.5 at work and possibly don’t even realise some of the power you’ve been missing out on. Having worked on several corporate projects in 2009, it appears that many larger organisations are still sticking using .NET Framework 2.0. By the way, you can get away with using a lot of the C# 3.0 features on the .NET framework 2.0, since many of the additions are language based or are based on compiler “tricks”. If ever there was a code magician / illusionist – Jon Skeet could be him!
Manning (publishers) are releasing an Early Access Preview of the second edition of this book in electronic form now (the soft-cover is due Summer 2010, according to the Manning C# in Depth website). I’d still recommend the first edition, having most of the same material except for the last few chapters, and its in paperback form so you can read on the run
October 20th, 2009 §
How well do you know your database server? And no!, I’m not talking about favourite colours, favourite things to do, or other first date questions here… I mean how well do you know the technology behind your database server and what makes it tick? Many developers out there focus on the web and application layers and only look to the database layer as a persistence medium. At least until they need to get a LOT of data in or out in a hurry that is…
More often than not, small companies can’t afford to have a dedicated database administrator (DBA). So it often falls to the technical operations guy/gal and the developers to manage the company database(s). I’ve been in the position of one of those developers, where looking after databases was more of an add-on task than any official duty, and that experience has taught me that a good DBA is worth their weight in gold.
Every developer should get to know at least one database technology intimately because your database can do a lot more for you than just persist data. Get to know the engine of your database server: how it works; how it makes decisions on query plans; different algorithms for joining and grouping data and how it all evolved.
As an example, have you ever written a program that processes data on-the-fly and batching bulk-inserts? Assuming all that bulk-inserted data goes into a set of tables that will later be processed for rollups, you’ll have some indexes on those tables, so that the rollups run faster… right? Well those indexes will have a dramatic performance impact on your bulk-insert operation… I’ve learned that when processing large amounts of data for crunching rollups later on… only create the indexes just before you need them and then drop the indexes again afterwards. The reason is that the bulk-insert is probably going to be the long-running operation and writing to a table with 3 indexes across columns can take 2-3 times longer than writing to a table with no indexes.
My database of preference is SQL Server because I’ve worked with Microsoft technologies all my working life and found the tool-sets generally hit the mark on best compromise between functionality and easy learning curve. SQL Server 2000 was the top dog around the time I was finding my feet and an invaluable resource was Kalen Delaney’s book Inside Microsoft SQL Server 2000. I have *huge* respect for the team that created one of the first databases that was capable of running on desktop computer hardware, whilst having a .dll/.exe footprint in the order of 10’s of Megabytes and, to this day, is capable of managing databases in the order of Terabytes!
July 31st, 2009 §
I write code all day and spend quite a bit of time working with various content management systems and databases. When I sat down today to set up my own blog, I knew I was never going to write my own blogging platform from scratch. That sort of thing is just not done anymore – unless you’re doing something that’s never been done before (and blogging has definitely been done before!).
.NET
My original choice was a .NET based blog because I’m familiar with ASP.NET and figured I’d be able to customise it. After hunting around, the first thing that I learned is that blogging software is a lot more complicated and feature-rich than I’d expected. Comment spam filters, trackbacks and integration with Windows Live Writer all seemed pretty attractive options. My choices eventually narrowed down to:
All four of the above platforms were available for simplified install via the Microsoft Web Platform installer:

This time around, I’m being a real software “user” and looking for the path of least resistance. While all four .NET platforms seemed like they could do the job, I rejected them for combinations of the following reasons: lack of reviews, difficulty skinning, long learning curve and effort required to customise. Even though I’ve frequently used Umbraco and it has blogging packages via the community, I didn’t want to spend time setting up the templates or writing custom code for the basic blogging features available in other software.
WordPress
In the end, I settled on WordPress. As a lazy user, this has everything I need and is a well-matured blogging platform with a massive diversity of themes and plugins. MySQL was a requirement as a database backend:

One of the beauties of the Microsoft Web Platform installer is that all these dependencies are detected and resolved for you:

15-20 minutes later, I have WordPress installed, an IIS site set up and working. Themes abound everywhere you look and I eventually found “Oulipo” by Andrea Mignolo. Installing a theme was as simple as copying the files to a subfolder and clicking the thumbnail in the Appearance section of the Admin page.
And there you have it – my first deployment of a PHP / MySQL application, that so far has exceeded expectations, whilst being really easy to set up. As a Microsofty / .NET coder, the only comfort I take out of the experience is that the Microsoft Web Platform installer made the whole process simpler. Actually the really hard part was picking the name (thanks to Richard Parker for helping with that part) and finding a clean-cut look for a blog focused on technical content.