Software Development

Big corporations love uniformity: things are much easier to manage if they are all alike. But then they may also fail all at the same time, with catastrophic consequences. Remember […]

Just found this in production code: var fa = new FileAsset { Hash = tempFile.Hash, Length = tempFile.Length, CreatedOn = DateTime.UtcNow, Data = tempFile.Data, CompressedLength = tempFile.Length, Name = tempFile.FileName, […]

If anyone tells you unit tests are a waste of time, send them to this post. I am in the middle of some major refactoring of our bills generator. Billing, […]

In a piece of code I inherited from some smart, well meaning, but a little disorganized East European consultants, I found the following class hierarchy: RestClient (abstract) JsonClient (abstract) XyzClient* […]

In a nuthsell, SimpleXMl has two things broken: 1. Elements that represent “emtpy” tags evaluate to false. This is weird design. 2. Other elements sometimes evaluate to false due to […]

The following code does not work as expected: $xml = simplexml_load_string(“<root><a/><b>text</b></root>”); $node = $xml->xpath(“/root/a”)[0]; if ($node) process($node); // process($node) may not be called for some valid nodes Unlike most other […]