Two Hard Things

This post by Martin Fowler quotes Phil Karlton:

There are only two hard things in Computer Science: cache invalidation and naming things

(and Martin adds the derivative quote: ‘there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors’) which is quite nice. Today’s post was originally about naming things being hard… but I think I can extend it to something close to the two topics in the quote. Continue reading

Rejuvenating a Stalled Project

The client had a stalled project with many changes to an existing system; there were several areas of new functionality, but they were not completely trusted. There was considerable concern regarding the reliability and performance of the database, and in some senses the database was seen as the whole problem.  Not only had this set of changes stalled, but minor fixes had also stacked up waiting to be released and all were dependent upon the main project.
Continue reading

Using Live Data as a Source of Test Databases

Many modern development tools are providing ways to create databases and populate them with test data; often with the idea that unit tests can then be run against them. But there is an alternative approach available to some people; which is to use live data as a source for our test environments.  Now, there may be reasons why this is not possible (not the least of which is ‘compliance’), and there are certainly issues of practicality that will need to be considered, but if you are allowed to do this there can be huge benefits.

Continue reading

Making Use-Case Diagrams Useful

We have found that communicating our system designs with clients is most usefully done with diagrams rather than large chunks of text.  Some years ago, we looked at using UML Use Case Diagrams for this communication – but see what Martin Fowler has to say about them in  ‘UML Distilled’:

“But almost all the value of use cases lies in the content, [of the textual cases]  and the diagram is of limited value.’

In other words, in his opinion, you should use the textual Use Cases, not the diagrams (which just map those texts visually).

‘Pure’ UML also seems to disappoint in terms of producing very dry monochrome diagrams with stick figures, and simple primitives such as boxes and ovals.  Is this really the best we can do to convey the use of a system?

Continue reading

Top 10 Ways to Write Easy-to-Use SQL

This post is about some top tips and tricks to use when writing and modifying SQL.  At first sight they may seem a little bit strange, but hopefully after explanation they will make sense. Let’s take a look at the first bit of SQL:

SELECT    SomeTableId
          , TeamName            -- (2)
          --, EmployeeId
          , EmployeeName
          --, BigXmlCol         -- (3)
FROM      dbo.SomeTable         -- (4)
WHERE     1 = 1                 -- (5)
AND       TeamName LIKE 'Blah%'
--AND       EmployeeName LIKE 'Nigel%'  -- (6)
ORDER     BY TeamName
--ORDER    BY EmployeeName

Continue reading

Job Scheduler Case Study

The client had accrued a considerable number of windows task-scheduler batch-processes over time, but really did not have any documentation of what they all did.  This exposed them to a number of risks; one of the most considerable being that in the event of a disaster, reconstruction of the task list could have been problematic.  The client’s parent company were pushing through a number of resilience projects, and one thing they wanted was the batch processes to operate in something-like a clustered manner; if one server failed, another would take over. Continue reading

Debugging

“Everyone knows that debugging is twice as hard as writing a program in the first place.  So if you’re as clever as you can be when you write it, how will you ever debug it?”

Kernighan and Plauger

There’s supposedly a very similar quote attributed just to Kernighan, but I chose this one mentioned in this blog which also gave me a date of 1974.

There are two assertions in this statement, and I am pretty sure that the first is not true any more given that we have modern visual debuggers provided by tools such as Visual Studio.  Debugging can be even be fun!  But I think it is certainly fair to say that  advanced debugging on a platform like Windows can easily extend complexity greatly. Continue reading

Performance Analysis by Tracing Side Effects

People sometimes claim that if a performance measure has not been recorded directly, then it is not possible to report on it.  Need to know how long a batch job took to run? That’s ok – I have a table that tells me job run times.  But if you need to know how much work a batch job did?  We don’t record throughput, they say.  This may be followed by a suggestion that they could add log messages or something like that. Continue reading