finding God in the machine

code that proclaims His handiwork

type_of_Christ.go

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

// And we all, with unveiled face, beholding the
// glory of the Lord, are being transformed into
// the same image from one degree of glory to
// another. (2 Corinthians 3:18)

type Christ struct{}

// Paul is telling us that if we want to become like
// Jesus we need to see Him. If we want to truly see
// Him we need to find Him everywhere He can be found.
// This means looking for Him everywhere in His Word.

type Noah Christ
type Joseph Christ
type Moses Christ
type Joshua Christ
type David Christ

// We have all read about these "types" of Christ to
// use them as role models. Let's rise above this one
// way of reading the Bible and look for Jesus Himself
// in these stories. We need to do what Paul says:
// behold Jesus's glory. This will change us.

func main() {}

woman_or_wife.go

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package main

type woman interface {
  a()
}

type porn struct{}
func (p *porn) a() {}

type prostitute struct{}
func (p *prostitute) a() {}

type womanAtWork struct{}
func (w *womanAtWork) a() {}

type womanOnTV struct{}
func (w *womanOnTV) a() {}

type womanInNeighborhood struct{}
func (w *womanInNeighborhood) a() {}

type Wife struct{}
func (w *Wife) a() {}
func (w *Wife) b() {}
func (w *Wife) c() {}

type boy struct{}
func (h *boy) interact(w woman) {
  w.a()
}

type Man struct{}
func (h *Man) interact(w *Wife) {
  w.a()
  w.b()
  w.c()
}

func main() {
  b := new(boy)
  b.interact(new(Wife))
  b.interact(new(porn))
  b.interact(new(prostitute))
  b.interact(new(womanAtWork))
  b.interact(new(womanOnTV))
  b.interact(new(womanInNeighborhood))

  m := new(Man)
  m.interact(new(Wife))
}

// There is a common method between "woman" and "Wife" that means that a boy can
// get married and interact with his wife. But until he becomes a man he is
// limited in his ability to interact with his wife because he can only see her
// through the "woman" interface. He can only interact with his wife the same way
// he would interact with "porn" or "prostitute".

// But consider the man. He is designed to only interact with his wife. This
// design provides him with two amazing benefits that cannot be experienced
// by a boy. The man cannot even concieve of interacting with porn, prostitutes,
// etc. (in fact, that won't even compile), and he can call all of the methods
// of his wife. He has a full experience that is beyond the comprehension of a boy.

// The world will try to lie to you and tell you that skipping across the surface
// of a puddle is better than pluging into the depths of an ocean. Don't believe
// that lie. Don't buy into that philosophy.

// Consider another danger of interfaces. By allowing anything in, you are
// allowing Satan the freedom to tempt you with anything that fits your definition
// of "woman". Sure, you can do all sorts of type assertions and try to filter
// what you consider to be bad but this means that you will spend the rest of
// your life running from something that can be fixed by changing a single function
// argument type. Change the way you think and you will be able to let the compiler
// do the work for you.

// If you take a hard, honest look at yourself and you feel that you are more
// like a "boy" than a "man" then you are in the perfect place to start refactoring
// your life.

// Here are some resources that can help:
// http://www.desiringgod.org/resource-library/taste-see-articles/anthem-strategies-for-fighting-lust
// http://www.amazon.com/Fidelity-How-Be-One-Woman-Man/dp/1591281210
// http://www.amazon.com/Clean-Proven-Committed-Sexual-Integrity/dp/1400204682
// http://www.amazon.com/For-Glory-Covering-Practical-Theology/dp/1591280419
// Google these guys: Doug Weiss, Douglas Wilson, Fred Stoeker, and John Piper and
// read their articles and watch their videos.

paneled houses

Is it a time for you yourselves to dwell in your paneled houses, while this house lies in ruins? (Haggai 1:4)

What are the paneled houses of the software developer? It’s the languages we know, the frameworks we’ve used, the open source contributions we’ve made. It’s the investments we’ve made into cultivating ourselves to be better at our craft. While there is nothing wrong with these things in isolation, let’s be careful that we don’t make same mistake that the returning exiles made.

We can build device drivers but can we build friendships? We can build web servers but can we build a family? We can build libraries but can we build a marriage?

God has called us to higher things than paneled houses because we are the temple now. We are the house that God dwells in. We can’t focus on our paneled houses to the detriment of His temple.

boundaries

It is hard for you to kick against the goads. (Acts 26:14)

In our sinful nature we love the thought of independence. We believe that true freedom means that we are free from laws and boundaries. It often seems that our craft can reinforce this dangerous thought pattern as we wield universal power within the confines of our machines. We spend all day being the god of our microcosm and, if we are not careful, we can begin to think that we deserve a life without limitations.

If we do, we are missing tremendous blessings from God. He has created the universe to function in such a way that we depend on Him for everything. And, in His love, He requires that we obey His commandments. However we often view these commandments nothing more than limitations or boundaries on the free will of an autonomous human being. We reduce God to nothing more than an authoritarian who crushes independence.

But what does He say about these boundaries? Jesus says that His yoke is easy, and His burden is light (Matthew 11:30). The Apostle John tells us that His commandments are not burdensome (1 John 5:3). These limitations are clearly not meant to harm us or limit our potential in this life.

Do we ever index an array without checking to see if it falls within the bounds of the array? Do we ever open a file without first checking to see if it exists? Do we embed user-supplied data into a database query without first sanitizing it? No, we accept the reality of the situation and also accept that the boundaries we place in our code keep the application safe. Safe from crashing. Safe from data loss. Safe from as many harmful things as we can anticipate.

Now consider the fact that God has anticipated all harmful things and has given us the means to avoid all of them. His commandments are the means and if we are going to be wisely consistent in our life we will love them exceedingly (Psalm 119:167).

The boundary lines have fallen for me in pleasant places; surely I have a delightful inheritance. (Psalm 16:6, NIV)

burning bushes

And the angel of the Lord appeared to him in a flame of fire out of the midst of a bush. He looked, and behold, the bush was burning, yet it was not consumed. And Moses said, “I will turn aside to see this great sight, why the bush is not burned.” When the Lord saw that he turned aside to see, God called to him out of the bush. (Exodus 3:2-4)

If you want to know how God will speak to you then you only need to look to the things that fascinate you. We can’t be too quick to dismiss things that happen in our day-to-day work. The fascination that we find in an elegant solution or a new language is just a burning bush on the side of the path. It is our Heavenly Father beckoning us to to turn aside from ourselves and behold something that He has made. It’s an invitation to see Him and His creativity in the natural order of His creation.

But why does He want us to see Him there? Because (as with Moses) He wants our fascination to draw us into a conversation, and ultimately into a relationship with Him. He has scattered evidence of Himself throughout the universe so that He can give us Himself.

So let’s take time to stop whenever we are intrigued by a line of code or a powerful library function to listen for the voice of our God. We should remember that He calls out when when we turn aside to see His wonders.

enduring forever

We are used to working with limited resources. We release memory because there is only so much. We release connections because other processes may need to use them. We are constantly tuning our code to use the least amount of resources possible.

We are also used to building things in a fallible world. This means that we need to to anticipate problems, failures, and exceptional situations and plan accordingly. We are always looking to find ways to make our code more resilient against failure.

We need to throw this mindset away when it comes to thinking about God. Let’s consider who God is.

He never times out.

For the LORD is good; his steadfast love endures forever. (Psalm 100:5)

He never throws an error.

One who in every respect has been tempted as we are, yet without sin. (Hebrews 4:15)

He never locks up.

I will not leave you or forsake you. (Joshua 1:5)

He never acts unpredictably,

There is no variation or shadow due to change. (James 1:17)

His resources are not limited and are never exhausted.

I have loved you with an everlasting love. (Jeremiah 31:3)

We need to constantly be freeing ourselves from the confines of our programming mindset. God is not a computer and He is not code. When we medidate on His grace and mercy we should be amazed that He has more than we could ever want or need! When we are praising Him for His holiness we should remember that He is 100% sinless and pure!

The cynical perspective that makes us effective programmers needs to be cast off so that we can joyfully bask in the glory of a God who is not limited by anything or anyone.

“I am the Alpha and the Omega,” says the Lord God, “who is and who was and who is to come, the Almighty.” (Revelation 1:8)

knowledge.rb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Be filled with the knowledge of his will in all spiritual wisdom and
# understanding, so as to walk in a manner worthy of the Lord, fully
# pleasing to him, bearing fruit in every good work and increasing in the
# knowledge of God. (Colossians 1:9-10)

require "spiritual_wisdom"
require "understanding"

def fill_with_knowledge
  walk_in_a_manner_worthy_of_Him
  fully_please_Him
  bear_fruit_in_good_works
  fill_with_knowledge
end

mark and sweep

Think about a “mark and sweep” garbage collector. Any reference you may hold to a memory location is a “root”. When this type of garbage collector runs, it first marks all roots. The next pass of the garbage collector reclaims all memory that isn’t marked. The designation of “root” saves the memory from being reclaimed and prevents the data at that location from being destroyed.

The blood shall be a sign for you on the houses where you live; and when I see the blood I will pass over you. (Exodus 12:13)

Jesus’ blood is the only mark that will save us. There is no other way to be considered a root (John 14:6).

Don’t think that you can wait, either, because God’s garbage collector is non-deterministic. (Matthew 24:36)

So we have covered the marking phase, what about the sweeping? Once this phase has started, there is no more time. Once this phase begins you cannot be marked as a root any more.

And another angel came out of the temple, calling with a loud voice to him who sat on the cloud, “Put in your sickle, and reap, for the hour to reap has come, for the harvest of the earth is fully ripe.” (Revelation 14:15)

proven code

What good is your quicksort implementation if you never sort anything? What good is your custom web server if you never serve anything? The only code that matters is code that does something.

Mature developers are ruthless in their removal of unused code. We don’t tolerate a single unneeded line. This is because we live and breathe an unbending philosophy: working code is not just raw logic – working code is logic that has been proven against real data. In other words, working code is proven code.

Show me your faith apart from your works, and I will show you my faith by my works. (James 2:18)

an abundance of counselors

In abundance of counselors there is victory. (Proverbs 24:6)

As software developers we often have to choose between writing code to solve a problem or use an existing library that was written by someone else instead. When we are faced with this decision we have to be willing to sacrifice our own pride and honestly evaluate the options for the sake of the project. We know that we cannot possibly write everything ourselves since we do not have the time or expertise to do everything without help.

Are we as willing to accept outside help in our lives? We should be seeking godly counselors (whether in person or in books) with as much fervor as we seek good libraries.