The coding blog of Alastair Smith, a software developer based in Cambridge, UK. Interested in DevOps, Azure, Kubernetes, .NET Core, and VueJS.
It was announced a few days ago that the Super User private beta has begun. Instructions on accessing it are available from the Stack Overflow blog announcement.
I have a couple of new posts waiting in the wings for this series. They're both quite lengthy, so they're taking a bit of time to write. Things have also got considerably busier at work in the last week or so, and it's proving nigh on impossible to dedicate the time to reading and absorbing the material. As such, there will likely be a bit of a gap in my postings on this series after I've cleared out the back-log. If you've been enjoying the series so far, and/or if you have any feedback on how to improve it, etc., please leave me a comment or two.
Chapter 5 of Code Complete covers the concept of Design in software construction. This is a pretty weighty chapter, so I'm going to tackle it in a mini-series of posts. Here I cover McConnell's description of the design challenges, including why it's so hard to get right. This post is a something of a bite-size chunk, and hopefully it'll provide a measure of breathing space between two large posts. [img_assist|nid=98|title=Design can be a wicked problem|desc=|link=none|align=center|width=400|height=292]
Part 1 of this post covered the importance of pre-requisites: why it is worth doing them, and doing them well; why it is a bad idea to jump straight into coding; and how to ensure that they are completed at your organisation (if they aren't automatically already). This second post covers the three main pre-requisites, namely Problem Definition, Requirements, and Architecture. Note: this is a long post!
Any good carpenter, joiner, or other worker of materials will tell you to “measure twice, cut once”. This is a good philosophy to apply to life and your craft as a software engineer. It implies attention to detail, efficiency and proper preparation; it results in “right first time” components and products, quality and reduced waste.
So, getting your pre-requisites right is important. There are different opportunities to emphasis quality: at the beginning of the project (planning and design), during the construction of the product and at the end of the project (testing). During the construction phase, your only option is to build the product solidly, with quality materials and tools. At the end of the project, when your only option is testing, you can’t detect that your product is the wrong solution for the problem, or that it is the right product built in the wrong way. Testing is only one part of quality assurance, and only ensure that the thing is fit for purpose.
Therefore, the planning and design stages are your one opportunity to “get it right”, and the cheapest opportunity to resolve any issues. You can, and should, make sure you have the right project and the right plans, and ensure the design is fit for the product. It’s a risk reduction process. As my Dad used to tell me, and as his boss (fittingly, in the construction industry) used to say, remember “The Seven Ps”: Proper Preparation and Planning Prevents Piss-Poor Performance.
Chapter 2 of Code Complete covers software development metaphors, critically evaluating a number of metaphors that have been proposed over the last thirty or so years, including code as writing, growing a system, system accretion, and software construction.
Apologies to anyone who tried to comment on one of my previous entries and found they couldn’t. The issue with reCAPTCHA that was preventing this has now been resolved and you should be able to post comments again without any problems.
Today was Day 1 of the Rest of my Life: I read the preface and first chapter of Code Complete, and here’s what it had to say.
Next week I’m starting an adventure. I mean that in the truest sense of the phrase: I feel exhilaration and trepidation in equal measure. The path is littered with potholes and other small dangers. But at the end of it, I will emerge a better developer. Next week, I am starting to read Code Complete (2nd ed.) by Steve McConnell.
An enjoyable, rollicking space adventure in the best tradition.
In case you’d somehow missed the news and the leaks, the RC of Windows 7 is publicly available as of today. It’s been available to MSDN subscribers (and, by extension, the wider Internet) since last Thursday, but Microsoft are officially opening the doors to the unwashed hordes tomorrow.
You may remember a post I wrote a while back advertising the Stack Overflow site created by Joel Spolsky and Jeff Atwood. It’s been live a bit over six months, and it’s grown enormously in features and user base since I wrote that post.
Jeff and Joel have now put the software behind Stack Overflow to another use, powering a System Administration community site entitled Server Fault, currently in private beta.
I thought it was high time that my blog, being called CodeBork an’ all, be located at a codebork domain, so I just bought codebork.com and codebork.co.uk. codebork.co.uk has been configured as a ServerAlias for codebork.com. The site as a whole will continue to be accessible indefinitely at the current domain, alastairsmith.me.uk, but requests to this domain will be redirected (via a 301 Moved Permanently response) to codebork.com. Hopefully this will go some way to avoid annoying Google; after all, I now “own” the CodeBork search term on Google, and it would be dumb to upset that.
Sadly for all you Whovians out there, I don’t mean those Ood. Instead, I want to talk about the SOLID Principles of Object-Oriented Design, as proposed by “Uncle” Bob Martin back in the mid-1990s. The SOLID Principles gained a level of notoriety in the .NET community a couple of months ago, after Jeff Atwood and Joel Spolsky made some, er, unguarded comments about them in one of their StackOverflow podcasts. This post is long overdue, so I’m glad to finally get it out there! :-)
[img_assist | nid=71 | title= | desc= | link=node | align=center | width=400 | height=233] |
In my recent blog post on the Windows 7 beta, I alluded to the new window management features in Windows 7, called Aero Snap.
That second link gives you most of the low-down on what Aero Snap is and what it does, and even how it was designed if that interests you, but I wanted to call your attention to the two main features of Aero Snap, that I think threaten to make single-monitor working almost as productive as multi-monitor working.
I recently upgraded my main PC at home to the public beta (build 7000) of Windows 7. Whilst it’s no longer available from Microsoft, I’d downloaded this during the public availability phase with the intention of setting it up in a Virtual Machine. The public beta and later builds are available if you know where to find them, and build 7000 is still available to MSDN subscribers. This post covers my experiences with Windows 7 so far.
PowerShell is Microsoft’s new command line shell for Windows. Version 1 was released in 2006, and version 2 has been in CTP for about a year now; it will finally RTM with Windows 7. It’s a truly fantastic shell, and if you haven’t looked into it already, I would urge you to do so. There’s a wealth of information out there, not least on the PowerShell blog, that will get you started very quickly.
I’m such a fan of PowerShell that I’m quite surprised I haven’t posted about it here in any detail before. One of the key advantages is that it is a first-class .NET language, giving you access to the entire .NET framework from the command-line; this arises from the basic data item being an object (rather than plain text as it is in UNIX shells). I hope to post an introduction/tutorial to PowerShell sometime in the near future.
The subject of this post, however, is a specific feature of PowerShell, the -whatif
switch. I assume familiarity with basic PowerShell features, and the PowerShell syntax.
I know I’m way behind “the curve” blogging about a new feature in Windows Vista, and that it’s seriously old news these days, but I wanted to do a quick post on the search functionality that was introduced with Vista. As such, this isn’t going to be a post trying to sell the feature to you (as it might be if the feature were still new), but more an indication of how I use it on a day-to-day basis, and why. This post will be less technical than some of my usual posts to make it accessible to a wider audience.
A little while back, I posted up some interview questions for employers. You know, to ask at that awkward moment when the interview is basically over and the interviewer asks you if you have any questions for them. I didn’t receive a great deal of feedback to the post at the time, but my friend Steve recently came across another blog post that provided a much more comprehensive list.
[img_assist | nid=70 | title= | desc= | link=node | align=center | width=400 | height=267] |
One of the reasons progress on my web frameworks’ evaluation has been so slow of late is that my last check-in broke my CCNET automated build, and, as the good programmer I am, I felt that this needed fixing before I made any more progress.
I’d written some unit tests for the PostController
(good) that were accessing the database directly (bad), and for whatever reason the build machine couldn’t successfully connect to the database. A classic case of “works on my machine!”, and, as is usually the case with such things, a good example of poor design.
In Java, there’s only one way to explicitly cast a variable from one type to another, and that’s using the bracket syntax. In .NET (well, C# anyway), there are a couple: the Java-esque bracket syntax and the as
keyword. Whilst I have used both frequently in the past, a situation occurred a couple of days ago where I realised I needed to clarify what as
did under the hood.
It’s been a little while since I made any progress on this little project of mine, due to the downtime I suffered throughout December. I couldn’t get access to my virtual machine server, so I wasn’t able to restart the VM hosting my blog and my Subversion repositories; everything went down together.
As such, it’s probably time for an update on where I’ve got to so far.
I’ve suffered a bit of downtime of late — about the last month, actually — which is why my blog has been unavailable and my web frameworks’ evaluation has crawled to a halt. Apologies to anyone that might have been following that series.
The good news is, however, that I’m back for 2009 thanks to a particularly felicitous finding on my laptop that resolved the underlying problem. I’m hoping to move at least my blog (if not some of my other bits and pieces) to a more reliable hosting package sometime this year. 363 days and counting to accomplish this!
I’m looking for a new iPod. My current 5G 60GB iPod Video has served me well, but it’s getting a bit beat up, and is missing some of the features of the newer models that I consider “killer” features. Features like search. So I’m in the market for a new one. Note that I’m specifically looking at iPods; I’m not interested in other makes, as I have iPod-compatible accessories that I don’t want to have to replace, and all my music is nicely categorised in iTunes, with most “recent” rips (i.e. a year or so old) completed in AAC. I’m not prepared to change media player or faff about with my library to support a new MP3 player, so an iPod it is.
ASP.NET MVC is still only a beta, although it has only recently gained this status from the previous “Tech Preview” releases. The rumour is that it will RTM as part of .NET 4.0.
Despite the beta status, it has a pretty solid feel to it, and it’s obviously quite stable: Stack Overflow was developed with this framework. It integrates well with VS 2008 Pro SP 1, and promotes the use of Test-Driven Development, primarily through Microsoft’s own Unit Testing framework (also known as MSTest). However, it will support other frameworks such as my preferred NUnit.