To certain extent, the title of this post is a little dishonest: it’s not really the first time I’ve introduced Succinc<T> on this blog. I first mentioned it over two years ago. To explain the title therefore, some history is required.
During early 2013, I was indulging myself in a “thought experiment” language: Lapsang. One such thought experiment was around the idea of whether a language could sensibly support the concept of not throwing exceptions for petty, unexceptional, reasons. Continue reading “Introducing Succinc<T> — functional additions to C#”
Two years ago (almost), I stopped posting to my blog. Two years ago (almost) I took the opportunity to switch roles within the company I worked in at the time from developer to development manager. The two events are of course linked. It was a big move for me. I’d previously been a team leader; I’d previously had responsibilities for managing groups of people, but each time I’d carried on spend at least some of my time developing code. This role was different though. This role was 100% management. Coding became a thing of the past. There was lots of new skills to learn: people management; product management; project management; finance; and – with hindsight the most important skill learned – expectation management of commercial desires of the company.
So why didn’t I blog about these new discoveries? To put it simply, I was unsure about what was appropriate to post; how to talk of what I was learning without compromising the commercial confidence of the company. I couldn’t post about the negatives and the positives always seemed almost mundane and hardly interesting reading for others. So time passed and the blog died a slow death… Continue reading “I’m back!”
I don’t use IoC containers. Many of the best developers I know swear by them. More, three incredible people who have taught me so much over the last few years – Shaun Smith
and Till Schneidereit
– even developed their own, very popular, IoC container: RobotLegs
. Yet I don’t use IoC containers. I’m a big fan of dependency injection and a passionate advocate for the return of the death penalty for the singleton and service locator patterns. Yet I still don’t use IoC containers. Is the reason I don’t use them because IoC containers are a case of “the Emperor’s new clothes”? Continue reading “Are IoC containers a case of “the Emperor’s new clothes”?”
Do you have a compatible Apple device, but are unsure whether to install Apple’s latest OS on it? If so, I’ve created a handy flowchart to help you decide. Continue reading “To upgrade or not to upgrade (to iOS7)?”
Design patterns: who really uses them? Are they just ways of overcoming limitations in Java? Are they an idea that has had its time? Do they really aid understanding of ideas between programmers, or do they just cause more confusion? Or, are they a great, but often misunderstood, idea that is still relevant today and that can be applied to all languages? After much thought and discussion with unsuspecting folk who have suffered a string of daft questions from me, I finally feel able write down my take on software design patterns and my conclusions might surprise many that know me. Continue reading “Are design patterns compatible with modern software techniques?”
Recently I created a very simple framework, SuccincT
. At it’s core is the
interface. As I explained in a previous post though, by itself that interface isn’t much use. C# lacks the ability to define constraints on an implementation of
, save through comments. The idea behind it was that an implementation should throw an exception if its
is read when
is false, but there is no way to guarantee that an implementation will exhibit this behaviour. This bugs me.
Unrelated to SuccincT, I’m a fan of defining data objects via interfaces, rather than concrete types. By “data object”, I mean any object that encapsulates a set of values. These might be used to avoid multiple parameters to a method or constructor, or to return a complex data set from a method. Data objects need not be immutable or serializable; they just need to be simple to use without causing problems when it comes to testing. As I like to encapsulate data, I like the setters of data objects to be internal, which does cause problems with testing. Thus why I like to use interfaces: the test class can define its own implementation, rather than having to fight against encapsulation. However, for every interface I create, I have to create at least one class too. This adds needless code to projects, which also bugs me.
These two things – wanting interfaces to define a more detailed contract and wanting to avoid having to write data object classes that can be 100% inferred from the interface – set me thinking: could I create some way of extending interfaces and avoiding writing data object classes? Continue reading “Some thoughts on expanding SuccincT to provide richer interface contracts and auto-generated data classes”
Equality in C# is an odd beast. At first glance, it seems very simple. Value types are compared by by value, objects are compared by reference and the comparison method can be overridden by a class if it wants to. For example, the String class compares the string contents, rather than comparing by reference. There are also sensible “best practice” rules suggested by Microsoft, such as avoiding comparing mutable objects by value, only by reference. All is not as it seems though as the following series of NUnit tests show. All the tests pass and thus demonstrate some aspect of equality in C#. Continue reading “C# equality in depth. Part 1: Basic == equality”
The two ways of checking for equality in C# – using == and .Equals() – can be modified for individual types. It is important to remember though that override and overload are two very different things in C#: .Equals() can be both overridden and overloaded, whereas == can only be overloaded. This set of tests demonstrate the significant effects this subtle difference can have on equality comparisons. Continue reading “C# equality in depth. Part 2: .Equals() and == are not equal”
With .NET 2.0, Microsoft introduced the IEquatable interface. It introduced a typesafe Equals() method that could be used to speed up comparisons in the new generic collections. It speeded up those comparisons by avoiding the need for casting and boxing, which the Object.Equals() suffered from. The IEquatable interface is a dangerous beast though as it can lure the unwary into thinking it rationalised equality in C#. This set of tests sets out to demonstrate how quite the opposite occurred: it simply made things worse. Continue reading “C# equality in depth. Part 3: IEquatable”
The .NET framework is getting on a bit. Many users of the .NET framework are either resistant to API changes, or are stuck with binary-only 3rd party tools that would break with API changes. As a consequence of these two things, the .NET framework has aspects to it that go against modern thinking, but we are stuck with them. The solution to this is often to encapsulate those features within newer frameworks, which offer “best practice” facades on to those features. SuccincT is one such framework. Continue reading “SuccincT — A .NET framework to solve unexceptional exceptions & out parameter annoyances”
This blog post was inspired by a brief twitter conversation between myself and Mark Seeman
on how, in the future, developers will likely just write tests and how the computer will generate the code to make those tests pass. Continue reading “Is Test Driven Development the only future for software development?”