The need for faith, (the mental state of programming)

A long time ago I was talking to a right wing christian. He was explaining to me about his religion etc. He told me I should read the bible etc. I told him I had read the bible many times. Some where in the conversation he found out I was a programmer. He then made the statement. “You would not understand about faith/miracles, computers are logical”.

I then tried to explain that computers are anything but logical, in order to be a good programmer you have to have a lot of faith. The simplest computer is nothing more then a toggle switch, it contains 2 states, off/on , 0/1 etc. If you attach a clock to that switch you have a computer. A very simple computer. You line up 32 of those switches you can store your telephone number. But when you have millions of these switches it becomes extremely complex.

With something like a Fibonacci series it is not possible for me to calculate the next number in the series unless I know the previous number. So unless I know the previous 99 states I can not determine the 100th state. The same principles can be used to create pseudo random generators etc.

Your PC probably has components from over 1000 manufactures. Its operating system has millions of lines of code, that has been written by 100s of people. The applications well …. . And somehow all of this functions and works together 99.9% of the time. As a programmer you will use API constantly to communicate to the OS, other apps etc. It is like a black box. I give it stuff and magically it will give me what I want back. I do not know the inner workings of this black box, just this is what happens. And the right wing christian accused me of not having any faith, or believing in miracles. It is a miracle computers even operate :)

There are very few books on actually how to program. Most of the books are just abbreviation of some programming languages specification manual, ussualy full of poorly written code examples. And then some drivel about how to use function XXXXX, often with incorrect information. Again here we can draw lessons from the bible :). In the story of jesus and the centurion, because the centurion is important man initially he sends one of his servants to go talk to jesus. But then the centurion knows that these servants will probably fuck it up. So he decides he better go talk to jesus himself, find out what the true story is :). And so the same in coding, even the API sometimes lies, always if in doubt look at the source code if possible. The source never lies :)

As king solomon said, there is nothing new under the sun. And so the same hold true today. All ideas are just old ideas recast with new wrappers. People used to ask me at parties what I do for a living. Being the prankster that I am I would reply I am a magician. And then I would tell them (i stole this from some book i read a long time ago, and forget which one).

I create objects at will, I make them appear and disappear :).

I have been accused of never leaving concrete examples, and so I shall :)

A good example is the internet.

On the simplest levels it is nothing besides a bunch of electrical pulses going allong a wire (0/1).

But on a hardware level for sake of organization these pulses are put into “packets”.

But these packets do not really exist, they are just something router/hardway guys invented.

But for the programmer these packets are a pain in the ass, and hard to work with, it is much better for them to view the packets as a “stream”. As in the internet is like a water pipe, and when i turn on the tap (socket) data flows out, and when i turn if off the data stops.

And so you may ask, which way is the best to envision the internet. Should it be views as a stream or packets. (Like the arguements is light a wave or a particle :) ).

And light, the answer depends on what you are doing.

If you are designing an application that does not do real time, (example an irc type chat proggie, email etc) then the stream answer is the correct one.

But lets say you are doing a real time app. (example VOIP) when fractions of a second make a difference, and you have to deal with the latency of the packet. Then you need to use the packet analogy.

When i had to do voip work, i would picture then internet in my head as a road, along the road where vehicals, like cars, trucks, buses etc. And all of these vehicals where going to all sorts of different places. Sometimes there where accidents (net work collisions) bus runs into a car :). At the intersection of these roads are like policemen (routers), these policemen send the cars to the proper place. But sometimes the policemen are taking nappy time :).

When i had to make like none real time apps i picture the net as an oil refinery with like thousands of pipes. Big pipes, little pipes. And connecting the pipes are all sorts of valves etc. Or sometimes a rivers (depending how I feel).

Each application you make you make different type of picture in your head, depending on what you need to do.

Well i guess looking at it, my concrete example was not so concrete after all :).

2 Responses to “The need for faith, (the mental state of programming)”

  1. gnarlyguy Says:

    Great analogy. BTW … your Fibonacci link is fished.

  2. Dink Says:

    I have the faith, baby!

    You gots a good blog going here, Nop. Keep it going.

Leave a Reply