Trinity .NET

If you ever read a systematic theology, one of the most technical parts is the explanation of the doctrine of the Trinity (or, as my four year old daughter Lily calls it, the “holy, blessed and glorious chimney”). Wayne Grudem has gone beyond mere words and attempted to use diagrams (Systematic Theology p253-255) to explain both what is not meant as well as what Christians believe. But as a computer programmer, I prefer to think in terms of classes and interfaces. So here I present the doctrine of God in C#.

First we need to define some interfaces, to give us the three persons of the Godhead. An interface allows us to define the properties and methods of an object, without having to specify how they are implemented (which is good because it is easier for us to say what God does than how he does it). Naturally, there will be some commonality, defined in IPerson, as well as certain activities unique to each member of the Trinity.

public interface IPerson {

}

public interface IFather : IPerson {

}

public interface ISon : IPerson {

}

public interface IHolySpirit : IPerson {

}

Now the temptation would be simply to finish this off by creating a class that implements all three interfaces:

// No! Heresy!

public class God : IFather, ISon, IHolySpirit {

}

But this would not do! We would have created the heresy of modalistic monarchianism, and defined a unitarian God – one God who can appear in three different forms. We need concrete classes to represent the fact that the three persons of the godhead are indeed real and distinct persons:

public partial class Father : IFather {

}

public partial class Son : ISon {

}

public partial class HolySpirit : IHolySpirit {

}

Notice we have defined these as partial classes. We will not be able to compile our code. This is because God is infinite and cannot be fully known. There is more to each person of the Trinity than we are able to comprehend. But God is not unknowable – he has revealed himself to us – hence we do have these partial classes. We of course must not stop here, for so far we have got another heresy – tritheism. We cannot simply have three objects kicking around – we need a container class to represent the Trinity. We must continue to construct our C# doctrine of God:

[LoveAttribute]

[HolinessAttribute]

public static final class God : IFather, ISon, IHolySpirit {

private static readonly List<IPerson> persons = new List<IPerson> {

Father.Instance, Son.Instance, HolySpirit.Instance

}

public override Equals(object other) {

return false;

}

}

A few things to notice:

  • This is a static class – there is only one God. He is a singleton. We need not concern ourselves with race conditions on startup as he is also eternal (a new keyword perhaps for C# 4.0).
  • This is a final class – we will not be adding any capabilities to God in the future – he is complete
  • This is a public class – God is knowable because of his self-revelation
  • The list of persons is private and readonly – the Trinity will not be accepting any external additions of new IPersons
  • If we want to apply any custom attributes to our class (such as FaithfulnessAttribute, JusticeAttribute, LoveAttribute), we will apply them directly to the God class, as they apply equally to all three persons. I have not shown the definitions of these attributes but naturally some will inherit from CommunicableAttribute and some from IncommunicableAttribute.
  • Despite my comments above on modalistic monarchianism, I have actually chosen to apply the IFather, ISon and IHolySpirit interfaces to this class. At the very least, IFather is necessary as the Bible quite interchangably refers to the Father simply as God. But also the Son and Spirit are not wrongly described as “God” either.
  • This means that the God class implements IPerson. I leave it to your own understanding of ontological equality and economic subordination to determine how a call to a method or property of IPerson would be delegated to the appropriate member of the Trinity. Naturally you could make explicit calls to individual members of the Trinity by casting God into the appropriate Person’s interface, but they may choose to delegate back up to the godhead. Hence calling Jesus.Forgive(me), Father.Forgive(me) and God.Forgive(me) will achieve the same operation.
  • We have chosen to call our class God, but Godhead, HolyTrinity or even Yahweh may have been a more appropriate naming choice (feel free to discuss in the comments).
  • Notice we resisted the good C# programmer’s instinct to implement additional interfaces. God is not ISerializable, IClonable, and certainly not IComparable.
  • We have found it quite easy to override the Equals method – nothing is his equal, so we shall return false.

Thank you for listening to my first installment in my forthcoming magnus opum – Theology .NET. Next up I will be explaining the algorithm behind the doctrine of election.

3 thoughts on “Trinity .NET

  1. Whatttttttt???????!

    Your brain just staggers me at times!! I didn’t understand a word but I bow in awe at your awesome intelligence!! Hope I am not the only one who didn’t follow a word – but I still believe in the Trinity!!

    Hurrah!

Leave a Reply

Your email address will not be published. Required fields are marked *