A Mathematical Model of Happiness

August 13th, 2009

What if we could use mathematics to figure out how to make ourselves happier? I submit for your consideration that it is, in fact, possible.  In this post, I construct a simple mathematical model of experiencing the world, and then derive some principles from the model which I believe are applicable to real life. Let’s begin! Consider the following graph of my happiness over the course of a day:

[Happiness on a Typical Day]

The day starts off well, and reaches a peak when I eat my breakfast of eggs and turkey bacon. Yum. I get into my car, and there’s a wreck on 15-501, so I’m late getting to work. My mood goes down, but it’s still positive. Upon arriving at work, I realize that I’ve fallen seriously behind in a big important project, so my mood falls. As I work harder and harder, I keep realizing how much more work I have to do. My mood plummets, until lunch time. A dozen buffalo wings provide a brief respite and put me in a better mood, but I’m still frustrated about work. I have time to think at lunch, though, and I realize  I can save myself some time if I take a new approach that I hadn’t though of.  My mood improves, and by the end of the work day I’m happy again.   After I get home from work, I relax by playing a game of Left 4 Dead with some friends, and my mood improves back to where it was.

The above graph was generated using a type of randomized noise function called Perlin noise. In other words, I modeled happiness as simply the summation of random waves. What better models can we use to describe and predict how people can become more happy? If happiness is a function of time, the simplest model says that we just choose to be happy all of the time. I would argue that the ‘choose to be happy’ model is too simple to be very useful.  Happiness isn’t a simple binary choice: It’s hard to choose to be happy when it’s cold and dark outside, and you feel tired, lonely, and hopeless about the future. Conversely, It’s easy to choose to be happy when it’s sunny outside, you’ve just enjoyed a nice meal with friends, and now you’re playing a sweet designer German board game, like Dominion.  These  examples are taken from points in my life. Your mileage may vary. The examples demonstrate that, very often, external factors in your life play a huge role in how happy you are. I believe it is possible to influence those external factors, but influencing them Isn’t as simple as just saying “I choose the happy path.”

A more predictive model of happiness must therefore take into account external factors as well as personal choices.   After giving this idea a lot of  thought, I came up with a model, based upon the concept of ‘Experience-Space.’  Experience-Space is the set of all possible experiences that an individual could have. Points in Experience-Space are points in both time-space and sensation-space.  In other words, a single point in experience space describes the exact feelings you feel at a given time.   To make things as easy to understand as possible, we will say that the only sensation one can experience is happiness, and that, at any given instant in life, one can make one of three choices. Why three? When there is only one sensation, Experience-Space becomes two dimensional: time is one dimension, and the experience you have is the other dimension. We can represent life with an image. Your experience of life is a path traced by a pixel through that that image from left to right.  At each step in time, the pixel can either go straight forward, diagonally up, or diagonally down.  We will label these choices straight, up, and down.

Look at this example:

Choice of a Single Dot

In this example, the person is currently happy. They have a choice to make: in the next time tick, they will be happy if they choose straight or down, unhappy if they choose up.  This is a very simple model, but it proves surprisingly powerful in generating useful predictions about how we can make ourselves happier.

Suppose you know everything about the universe, and your goal is to be as happy as you possibly can.  You start out at some initial point in experience-space, and your goal is to maximize the sum of the happiness of the experiences you have over the course of your entire life.  (Is that a reasonable goal? A question for another blog post!). Suppose that experience space looks like this:

Gradient Model Of Happiness

If this is your universe, wherever you start out, your most logical move is to always choose to go down (when possible) and then go straight along the bottom edge of the graph, when (if) you ever reach it.  That’s easy enough. Let’s consider a more complicated model of the world:

Happiness as Perfect Moments

In this model, most experiences are either slightly positive or slightly neutral. There are quite a few “great” experiences, and a small number of “terrible” experiences. These big experiences are so big that they affect you for some time after you experience them.   How would you navigate this graph, in order to maximize your happiness? The problem begins to look like an artificial intelligence.  I’m not going to go into artificial intelligence algorithms such as A* search (as much as I’d like to.) Instead, I’m going to draw to draw some conclusions from this model.

In the real world, we don’t know the entire universe ahead of time: we only know the choices that we have made, and their ramifications. In other words, our graphs look like this:

A Single Path

That’s not a lot to go on. It would be hard to take that information and build a model of the world and use it to predict where to go next.  While walking like this, you’d probably notice that some areas were nicer than others, and that the really nice areas and really bad areas tended to clump together, but you’d still have a hard time determining which areas to go towards. Suppose there are 50 people in the universe, and you all share information about the choices you have made and the results those choices have brought you. Then, your picture of the universe looks like this:

More Paths Means More Knowledge

This picture is much more complete than the picture you were able to generate by yourself.  By using information you glean from asking others about the choices they make, you can make yourself happier.

Conclusion: Talk to as many people as you can, and learn about their experiences.  Doing this talking will allow you to gain a much more accurate model of the world as a whole, in order to determine what will make you happy. Ask people about their history, and specifically about choices they have made that made them happy or unhappy.

I hope to write more on this subject in the future. Stay tuned!

Mathematically Modeling Health Care

August 3rd, 2009

With the Obama administration pushing a massive reform of our Health Care system, I figured I would share my opinion on the subject, for all of those interested.  I firmly believe that if you want to solve a problem, the best approach is to come up with mathematical models for your problem, analyze them, and do what the models suggest.  In this post, I will gradually build a mathematical model that describes health care, asking questions about the model and proposing policies reflecting the outcomes of the model.  Let’s begin!

Model Version 1: There is a universe of N individuals with two states: healthy and sick.  Let the variable t represent time, with t =  0 being some arbitrary date, say January 1, 2009. In this model, t is discrete – that is, it takes on the values -3,-2,-1,0,1,2… &c.  In other words, there are no fractional times.  At each time t , there is a certain probability p_sick that an individual will become sick. It costs c_cure dollars for a sick become healthy.

How much does Health Care cost in version 1 of the model? If we have N people, then at teach time tick, p_sick * N become sick, then the total cost of keeping everyone health is

c_total  = N *p_sick *c_cure.

In this simple model, we have only one question to ask: who pays the cost of health care? Should the individual who becomes sick pay for his own cure, or should the government foot the bill?  I contend that this this question is entirely a value judgment.   Everyone has a different opinion on what’s fair or just. We could argue about constitutionality, but that wouldn’t get us anywhere either – everyone interprets the constitution differently and different people will just claim that the constitution backs their case.  Thus, the first conclusion:

Conclusion 1: The question of “who should pay for health care” is entirely a personal value judgement.

Model Version 2:  In version 2 of the model, we add in different diseases, and choices.  Let D = {d_0, d_1, d_2….} be different diseases that people could acquire.   Note that we could consider things like  broken legs and concussions to be ‘diseases’ because people do suffer from them, and they do cost money to cure. For each d_i, there is a cost c_i to cure that disease. Note that for some i, c_i is infinite. In other words, for some ailments, there are no known cures.  Additionally, let A = {a_o, a_1, …} be a set of actions that an individual could perform.   The actions a person takes affect the probability that they catch certain diseases. For example, if you choose to drive a car to work, you increase the probability of getting any number of bodily ailments. If you eat a bag of Cheetos for lunch, you increase your probability of getting a heart attack.  Let risk be a function that takes an action a_i and a disease d_j as input, and returns p_j. In other words, risk(a_i,d_j) is the probability that you will suffer from disease d_j if you perform action a_i.
How much does health care cost in this model? It’s almost impossible to answer. You’d have to know risk(a_i,d_j) for each possible combination of i and j.   As the models get more and more complex, we see that we can’t really predict from logical principles how much health care is going to cost unless we can predict what kind of actions people are likely to take.  What we can observe, though, is that the question of ‘who pays’ becomes more interesting. If the government pays for all health care, then people have no incentive to minimize the risks they take.   If individuals pay for their healthcare, however, they have every incentive to minmize the risks that they take, reducing the total cost of healthcare.  Model 2 suggests that the best solution is to have individuals pay for their own health care, so that they minimize the amount of risk that they take.

Suppose one of the actions is ‘going to the doctor for a routine checkup.’ Clearly, this action reduces the risk of many diseases.  If individuals are forced to pay for their own health care, and rational individuals wish to minimize the cost they spend on health care, then rational individuals would go to doctors for routine checkups.  In reality, this often doesn’t happen – so something is wrong with the model. Let’s expand it.

Model 3: Same as Model 2, except the concepts of “cost” and “cure” change. Now, instead of cost being associated only with disease, each action a_i has an associated cost given by cost(a_i) Sometimes the cost of an action is positive (going to the doctor, going to see a movie, buying gas) and sometimes the cost of an action is negative (i.e. selling a house, going to work.) For each disease d_i,  there is an action that cures the disease. Let this action be called cure_i. Additionally,  the function risk now takes a third argument as input: the state of the individual at time t. In other words, if you’ve currently got a cold, then your risk of sinus infection might go up.

How does Model 3 differ from Model 2? We have removed cures as some abstract thing that happens to people, and transformed them into actions that people take. As a result, the incentive structure of the system changes.  When some diseases increase the risk of other diseases, rational people are more willing to pay to treat the first disease, in order to prevent themselves from getting the second.   We can also explain why a lot of people people don’t go to the doctor under our current health care system -  the cost of going to the doctor is positive, but the benefits are small, becuase insurance is more likely to cover catastrophic illnesses than it is to cover minor ones.

I could go on and continue to expand the model, but I won’t (although I’d find it very interesting to do so.)  The conclusion I’ve drawn from the modelling process is that healthcare is really complex, invovling many value judgments. Answering questions such as ‘who should pay for what’ and ‘how much will it cost’ is not easy to do.  In light of that conclusion, the question you should ask yourself is: “What is the best way of answering complex questions involving the value judgements of many individuals?” Economists have been studying this question for centuries, and, empirically, the answer is pretty clear – governments are notoriously bad at answering these questions satisfactorily. Markets, while far from perfect, are the best solution anyone has ever devised.

The primary problem with a Market-oriented solution to health care is that it excludes those who are unable to afford health care. I believe that the best way to handle those who are unable to afford health care is to supply them with vouchers that they can use to purchase health insurance of their own choice.  This would create competition and reduce costs. The Obama administration seems to belive  not only that the government is entitled to answer all of these questions for us, but the government is actually capable of doing so, in a fair and just manner. Believing that requires a hurculanean leap of faith in government.  If you think the government is capable of solving the healthcare problem better than markets, you must certainly believe that the government can solve the question of ‘who should produce what, and who should consume what’ even better.   Communism died for a reason: governments are not as efficient or responsive as markets. Listen to the empircal evidence of history, and make up your mind accordingly. I welcome your comments.

Simplicity vs Speed

July 9th, 2009

This is a post about programming practices and design in general. Even if you’re not a programmer, you should read this and let me know what you think.

Consider these two C++ classes:

class SimpleFrobulotron
{
  public:
 
	SimpleFrobulotron(const string &name);
	string getName();
 
  private:
	string m_Name;
};  
 
class FastFrobulotron
{
  public:
 
	FastFrobulotron(const string &name);
	void getName(string * outName);
 
  private:
    string m_Name;
 
};

The main difference between the two designs is simple: The SimpleFrobulotron is easier to understand and use, but somewhat slower than the FastFrobulotron. For example:

void printFrobulotronNames()
{
	SimpleFrobulotron simple("tweedle dee");
	FastFrobulotron fast("tweedle dum");
 
	//display the simple frobulotron's name
	cout << simple.getName() << endl;
 
	//display the fast frobulotron's name
	string fastName;
	fast.getName(&fastName);
	cout << fastName << endl;
 
}

Is FastFrobulotron really that much faster than SimpleFrobulotron? A test on my machine shows that FastFrobulotron runs in 27% of the time that SimpleFrobulotron runs in. So it is clear that there’s a trade off here: Simplicity versus Speed. Code that squeezes every last bit of performance out of the machine is harder to understand. What side of this trade off do you favor, and why?

In this case, I think the answer is obvious: returning a string from a function is much slower than assigning it through a pointer. This is a simple enough optimization that most good programmers should be able to look at the code and understand what’s going on. Therefore it’s best to make use of it. Things can get much more complicated than this simple example, though.

Writing code that does what it’s supposed to do is something most programmers can do (unless you give them the halting problem.) Writing code that’s easy to understand, however, is not. Neither is writing code that is as efficient as possible. The problem is that these two goals (simplicity and efficiency) seem to be at odds with each other. How do you balance between the two?

Another Bad Design

July 2nd, 2009

I use iTunes to manage the music on my iPhone. I went to add a bunch of music into my library, and a window popped up saying it was “Adding files.” There was a “stop” button, and a progress bar. This progress bar started off with a blue cursor on the left side, and that blue cursor gradually moved to the right. I presumed that when the blue cursor reached the right edge of the bar the work would be done.

I was wrong. Once it got to the right edge of the bar, the cursor just wrapped around and appeared at the left edge again. I understand the point of having some sort of animated graphic to indicate that work is being done, but why a progress bar? A progress bar should only be used if it shows the extent to which the work has been completed. To indicate … progress. A better design would be to have some kind of spinning wheels or gears, to make it clear that you have no idea how long you’re going to be waiting until you can listen to “I Wanna Sex You Up” by Color Me Badd. If, you know, you wanted to listen to that song.

On Genetics, Programming Languages, and God

June 26th, 2009

The genetic code is the programming language used to make living organisms.  Right now, biologists are attempting to ‘reverse engineer’ this genetic code, in order to determine how it works and to make changes to it. I (in my infinite wisdom) think they’re going about this the wrong way.

To understand why, we must first delve into the languages of computers. When humans program computers, they usually write in “high level languages”, which look like a series of mathematical formulas and instructions.  Here is an example of a simple function to compute the nth Fibonacci Number, written in a high level language called C:

//computes the nth fibonacci number
unsigned int fibonacci(unsigned int n)
{
	unsigned int term1 = 1;
	unsigned int term2 = 1;
        unsigned int result = term2;
 
	unsigned int i = 1;
	while (i < n)
	{
		result = term1 + term2;
		term1 = term2;
		term2 = result;
		i = i + 1;
	}
 
	return result;
}

The Computer cannot understand this program as it is written. It must be translated into instructions that make sense to the computer. This  translation process is called compiling. The compiled program will look different depending upon what computer it is compiled on, but all computers basically operate the same way: they can read from and write to memory locations, and they can add, multiply, divide, and subtract numbers.  Here is an English-language translation of what the compiled Fibonacci function might look like. Provided to make things more clear is a mapping of variable names to their memory locations:

n 0
term1 1
term2 2
result 3
i 4
# set the value in location 1 to 1
# set the value in location 2 to 1
# set the value in location 3 to the value stored in location 1
# set the value in location 4 to the 1
# if the value in location 4 is not less than the value in location 0, go to instruction 11
# set the value in location 3 to the result of the value in 1 plus the value in 2
# set the value in location 1 to the value in location 2
# set the value in location 2 to the value in location 3
# set the value in location 4 to the value in location 4 plus the value 1
# jump to instruction 5
# return the value in location 3

Each of the above instructions would be represented with a single word, which on a top-of-the-line modern computer is 64 bits of information. The human genetic code is also a sequence of simple instructions, interpreted not by a central processing unit, but by intracellular organisms.  Instead of dealing with changing values in memory locations, the genetic code’s instructions are for amino acids used to build proteins.  There are approximately 6 billion instructions in the human genome, making it roughly 10 million times as complex as our simple Fibonacci function.

Notice that the machine language program is  no where near as easy to understand as the C program. If I gave you a machine language program with 100 million lines of code, you’d have a heck of a time trying to figure out how it worked.  Poking around and changing single instructions, then determining what happens when you change those instructions probably wouldn’t be a good start. Unfortunately, as I understand things, that is exactly how biologists are proceeding.  They are stepping through the genetic code piece by piece,  using experiments to try and figure out what different sequences of instructions do.

There is, I think, a better approach. The key to understanding this approach is a simple fact about computer programming: It’s easier (and more fun) to write your own program than it is to read someone else’s program and figure out what it’s doing. Instead of trying to reverse engineer existing DNA code, which evolved over millions of years and is therefore probably extremely convoluted and hard to follow, we’d be better off trying to ‘write’ our own organisms.  Biologists could start by writing DNA ‘programs’ to code simple proteins.  After getting good at this, they could invent a ‘high level language’  for DNA programming (AKA GeneticC) which could be used to speed up the development progress. The next step would be to write a single cellular organism, and then more complicated organisms.

Interestingly enough, this process of building our own organisms could provide a lot of insight into the question of whether there is some being who designed us.  Once we have a better understanding of genetic programming,  we could look at the quality of the code that builds human beings. If it’s clean, neat, and straightforward,  that would be strong evidence of a creator at work. If it’s messy, garbled, hacked together, redundant and nonsensical in parts, we could conclude that the code evolved over time.  Either that, or god is a perl scripter.

What Does This Mean?

May 18th, 2009

Do you know what this means?

htons

No Cheating via Google! Click for the answer … Read the rest of this entry »

Removing SVN Bindings with Python

May 16th, 2009

I had an SVN repository on my website that I was using to store a personal project of mine.  I wanted to move the files into a different SVN repository on another website. Doing this required that I first remove all of the .SVN folders in my project. It’s got a bunch of folders, so going through manually would have been a big pain. Besides, as a self-respecting geek, I’d definitely prefer spending twice as long writing a script to automate a boring process over just doing it manually. My script, which is based upon this script here, generates a batch file that you run to clean the directories out. I would have done it directly from python, but I kept getting ‘this directory could not be found’ exceptions, probably becuase of the spaces in my folder names.

The script is below, for your edification. It only works on windows, but it could easily be modified to run on a UNIX based system. It is presented without any warranty, express or implied, not even that of suitability for a specific purpose.

import os
import sys
 
def findFileGenerator(rootDirectory, acceptanceFunction):
  for aCurrentDirectoryItem in [ os.path.join(rootDirectory, x) for x in os.listdir(rootDirectory) ]:
    if os.path.isdir(aCurrentDirectoryItem):
		if acceptanceFunction(aCurrentDirectoryItem):
			yield aCurrentDirectoryItem
		for aSubdirectoryItem in findFileGenerator(aCurrentDirectoryItem, acceptanceFunction):
			yield aSubdirectoryItem
 
def acceptSVNChildren(theFileOrDir):
	return theFileOrDir.find('.svn') != -1
 
def removeSVN(rootdir):
	"""recursively removes the SVN bindings from the directory specified in the argument"""
 
	for dude in findFileGenerator(rootdir,acceptSVNChildren):
		if os.path.isdir(dude):
			print "rmdir /S /Q", '"'+dude+'"'
 
def main():
	"""Removes the SVN bindings from the commandline dir specified in the argument.
	If no argument is specified, the root directory is used."""
 
	dirToClean = os.getcwd()
	if(len(sys.argv) == 2):
		dirToClean = os.path.join(os.getcwd(),sys.argv[1])
	elif (len(sys.argv) &gt; 2):
		print "Usage: remove_svn.py &lt;dirToClean&gt;"
 
	removeSVN(dirToClean)
 
if __name__ == "__main__" : main()

A Thought on Computation

April 23rd, 2009

I think a lot about P vs NP.  I think it’s  the most interesting problem ever, and my opinion on the subject is pretty well known.  Here’s my latest thought.

Computation is all about state changes; every computer ever built is a finite state machine of some kind.  For those unversed in Computer Science terminology, a finite state machine is an abstraction with a finite number of discrete states.  It starts out in a specific state, and when it receives input from an alphabet of discrete symbols, it changes from one state to another.  For example, a toggling light switch has two states: on and off. When you push the button, the toggle moves to ‘off’ if it was in the ‘on’ state, and it moves to the ‘on’ state if it was in the ‘off’ state.  More complex machines have more states, and more complicated rules for transitioning from state to state.

As I was saying, every computing device ever built is a finite state machine. Fingers change state from extended to contracted.  An abacus changes state when its beads are moved.  The Antikythera mechanism and Difference Engine changed state by movement of gears.  Modern electronic computers change state by modifying electronic signals.  People have proposed optical computers which operate based upon switching light sources on and off.  Note that these state changes are all discrete – gears could be said to move continuously, but they have an integer number of teeth, and therefore an integer number of possible discrete states. Electricity is the flow of electrons, and light consists of discrete photons.  Fingers are, well, fingers.

What about analog computers? Fans of slide rules might argue that they involve an infinite number of states as a result of their continuous nature.  Here I will make a conjecture:  just  as Planck proved that  energy occurs in discrete chunks, we will also come to find that time and space are discrete.  That slide rule may appear to move continuously, but I’m willing to bet that it’s actually moving in discrete jumps which are so tiny we cannot measure them. I am not alone in putting faith in this conjecture.

If computation involves state changes, a logical question is, “For a given problem, how many state changes are necessary to solve it?”  If a problem requires at least ten state changes to solve, and time is composed of discrete units, then there is a lower bound on how quickly that problem could be solved. I realize there are a lot of basic questions that would have to be answered for this theory to prove useful, but my guess is that we will eventually discover that the “minimum number of states” problem is akin to the problem of finding the Kolmogorov complexity of a string; that is to say, it is impossible to devise a general purpose algorithm that always gives the correct answer. (In fact, I think I’m going to try to prove this result myself.)

What does all of this mean for P vs NP?  Even if the ‘minimum number of states’ problem is not solvable by a general purpose algorithm, perhaps someone can construct a proof of the minimum number of state changes for a particular problem.  If someone could do that for an NP-Complete problem, then they could finally determine the answer to P vs NP.  I’m accepting bets that P = NP. Any takers?

On Creationism

April 3rd, 2009

I know this isn’t exactly a popular opinion these days, but I don’t see what the big deal is in teaching children that some scientists disagree with the idea that species evolve into other species over time.  It is a true statement.  As long as there remains one scientist who disagrees (and you can always find one guy who believes just about anything), it will be a true statement.

Here’s where I think the crux of the problem lies: Science does not deal with reality, but Scientists like to believe that it does. Science cannot describe reality because nothing can. Scientists can only construct mathematical models of reality, and test those models in their predictive capabtility by running experiments.  Why can’t science tell us about realitiy? Simply put, there’s no experiment anyone can perform which would tell us that we are not living in a video game, a movie, a book, or some child’s dream.

Evolution is a scientific theory because it makes predictions ranging from the nature of the fossils to the behavior of bacteria.  Evolution, as a theory, is an abstract model of reality that happens to make very accurate and useful predictions.  Creationism, on the other hand, makes no predictions.  It is a theory dealing purely with metaphysical truth, with the nature of the reality in which we live. This difference doesn’t imply that Creationism is somehow  objectively worse than Evolution;  you simply can’t compare the two.  One is a set of statements that attempts to describe an objective reality, and the other is a mathematical model used to make predictions about the nature of the sensations we experience. They both have their places.

My main point here is that Creationist theories cant’ be ‘wrong’ becuase they can never be tested.  Evolutionary theories, however, can be tested, and they have continually passed those tests.  That doesn’t mean evolution is ‘true’ because science can never prove anything true.  If the scientific and educated american communities would stop insisting that Science is Truth, perhaps they’d find less opposition from more faith-oriented americans.

Confessions of a Programmer

February 13th, 2009

I can’t talk about my job too much because everything we do is TOP SECRET, but I thought I’d make a few confessions / thoughts about programming.

  1. I absolutely love writing code. Probably moreso than is healthy.
  2. I spend more time than I should formatting my code so it looks pretty. I really enjoy reading code with syntax highlighting, lots of comments, and good indenting.
  3. I dislike the ternary  "<expression> ? <true-value> : <false-value>" operator. I think it obfuscates code and makes debugging more difficult. That said, I’m guilty of using it myself because I think it looks cool.
  4. I used to consider myself a ‘very good’ programmer, but I’ve learned a lot at my new job, and the more I learn, the more I realize there is to learn. Programming is like knowledge in general that way. I think this phenomenon (beginning programmers overrating their skills) is a great example of the Dunning-Kruger effect at work.
  5. I get a huge rush when I write a lot of code and it works on the first try, especially if the code involved pointer arithmetic or a nontrivial algorithm.
  6. I think programming is a great way to gain self confidence. There’s nothing like completing a project that sounded terrifying when it was first proposed to you.
  7. Python used to be, far and away, my favorite language, but I’m starting to think C# is really cool, largely because I like the .NET libraries and the Reflection capabilities.   If I do go back to using Python on a regular basis, I’ll probably switch to IronPython so I can still use . NET.   I still think Python is better for manipulating strings, largely because of the splicing syntax, but I rarely have to do that. I’ve never extensively used the pickle module in Python, but from what I remember, it was more difficult to use than .NET’s XML Serialization. Admittedly, the XML serialization syntax in .NET is kind of goofy for serializing recursively defined classes like Trees, and it can’t handle a class like a Graph without some carefull planning, but it really is cool to add a few attributes, feed your obejct to a BinaryWriter, and have the data easily persisted to the hard drive or sent across the wire.
  8. I hate the const keyword in C++ but I think it’s necessary for writing good code. The reason I dislike it is that it spreads like a virus: you add the const keyword to one function, and soon you have to add const to all the inputs to that function and then add const to the output, and const soon  your whole  const class, all of its const clients, and some other random const code you wrote is peppered with const keywords.  I like C#’s implementation of the out keyword much, much more.
  9. That is all for now. I have more code to write :)