Friday, June 30, 2006

Hear, Hear, Trey!

Trey has a nice post responding to a victim of the MUP.
Case in point, I'd say.

"State Sponsored Piracy"

This article is about the French government's own Equalization of Opportunity Bill (spoiler, Em). If Apple does pull their iTunes service out of France, I will buy an iPod instead of the Dell Jukebox I was planning on getting.

--Hat Tip, John for the link, and the relationship to the EOB.

Thursday, June 29, 2006

Philosophic Detection: Environmentalism, Religion and the MUP

The MUP (Malevolent Universe Premise) is the often unstated, emotionally held idea that the universe is inimical to man. In this view, the universe is a dangerous place where any joy is fleeting, to be destroyed by the coming disaster--where pain, despair, and death are the common, and pleasure, happiness, and life are the rare.

On the surface, it's obvious how environmentalists relate to the MUP--they routinely see in every scientific/industrial advance the seeds of the destruction of all humanity. Everything men do to try to better themselves results in more alienation, disease, and death. Their solution (when they're consistent) is to leave industrial society and live like Rousseau's "noble savages" in "harmony" with nature.

But the level of acceptance of the MUP by environmentalists is much deeper, and has more significant cognitive consequences than what I've already alluded to. This was made apparent to me when I was talking to J., a friend of mine who is no longer an environmentalist, but used to be a card-carrying member of the Sierra club. We were discussing the dependency of modern industrial society on oil. He sounded the usual worry of "what are we going to do when we run out of oil?"

"We'll use a new resource," I said.

"What about when we run out of that?"

My response was that there is really only one natural resource: man's mind. It is the task of man's mind to discover, produce, and consume the requirements of his life and happiness. If oil becomes scarce, man will put his mind to the task of discovering a new source of energy. (In fact, we already have one that the environmentalists oppose--nuclear energy.) J. was not able to immediately accept this idea--to my knowledge, he still has not; but I think it's just a matter of time until he does--but he was unable to offer any rational argument against it. His response basically amounted to "I disagree."

I thought about this quite a bit--why is it so hard for him to imagine that man could actually produce the long-term requirements of his life and happiness? That's when it hit me--the MUP. He had accepted the idea that man, through accident or malice, could easily destroy the entire human race through any attempt at progress. He could not accept the idea that man is capable of elevating the entire human race through a process of sustained productive thought.

Environmentalists and other anti-science people often exclaim "what arrogance man has to 'rape' the earth of her natural resources, to think that he can play God." I used to think they did this in an attempt to portray man of small stature. That idea is contradicted by the fact that when it comes to man's destructive power, they portray him as a juggernaut. Get it? When considering man's productive capacity, they say he has none; but when considering his destructive power, suddenly man is a super-villain the likes of which Stan Lee never imagined. It's not that they need to portray man as small--it's that they need to portray industry, productivity, and the reasoning scientific mind as destructive. Since these things are man's means of living, this means that man's life is inherently self-destructive! The universe, to them, is a place where every attempt by man to live and be happy will only rain destruction and punishment. His only option, in their view, is that man must renounce his arrogance (industry, science), and prostrate himself before a more powerful authority (Mother Nature, God), hoping that his life will be merely miserable, instead of an exercise in terror and grief.

In most people, this is not an explicitly held viewpoint--but it exists nonetheless as an emotional color on their thinking. It's easier for them to accept tales of man's self-destructive capacity--they regard it as unfortunate, but common. It's nearly impossible for them to imagine tales of man's heroism--they regard it with suspicion, and sometimes a tinge of fear.

This is part of why philosophy is so important. Philsophy can answer the question "What kind of universe do I live in?" Is the MUP rational? Or is the universe the kind of place where man can live, and be happy? My answer to that question should be obvious, but for the record, I believe in a benevolent universe--not in the sense that the universe is out to help me in some way, but in the sense that it is the kind of place that I can understand, live in, and achieve my happiness.

Sunday, June 25, 2006

The cost of convenience

I wasn't always a white-collar worker earning a decent living. I used to work in fast-food restaurants, factories, and whatnot. During those years, money was hard to come by, and too easy to spend. I would wait in line at the cheaper gas station to save 50 cents, or shop for groceries and clothes at Wal-Mart because the prices were cheaper.

Nowadays, I earn enough money that I don't really have to worry about money too much. I'm still not rolling in it--I can't just go spending hog-wild and expect to have anything left. I'd love to have a couple of 19" flat panel monitors for my computer, but my savings isn't where it's supposed to be right now, so--delayed.

But, without really noticing it, my shopping habits have changed. I go to Target for my basic clothing needs. I buy gas from the pricier place. I buy groceries from Publix. All of these places are a bit more expensive than my former choices, but not by much. The reason I started choosing them was because they are more convenient. I don't have to wait in line for gas at the pricier station. I don't have to work my way through narrow crowded aisles filled with screaming children at Target and Publix. Further, I find that the general quality of items available is better at Target and the Publix Deli. This makes sense of course--Wal Mart's entire business model is devoted to "cheap"--and there was a time when that was of primary importance to me. I'm glad it was there for me when I needed it, but that time is gone now. Between the crowded aisles and the long lines, Wal-Mart literally isn't worth my time.

Lesson: convenience has a cost--it's about 50 cents for gas, and about $5 per person per week at retail/food establishments. Sounds great to me!

Bush's New Executive Order

Here's the link to "Executive Order: Protecting the Property Rights of the American People" I'm not sure how this plays out against the recent Supreme Court decision on eminent domain.

"It is the policy of the United States to protect the rights of Americans to their private property, including by limiting the taking of private property by the Federal Government to situations in which the taking is for public use, with just compensation, and for the purpose of benefiting the general public and not merely for the purpose of advancing the economic interest of private parties to be given ownership or use of the property taken. "

This clause only applies to the Federal Government, so it doesn't do anything about cases where it is the state and county taking private land for private use. Further, I thought that one of the key arguments in the recent Supreme Court case was that taking private land for private use could be considered "public" use if it provided enough "common good" to the community. So, to my friends that have greater legal knowledge than myself I ask the question: "Does this order actually accomplish anything?"

Friday, June 16, 2006

If ever you needed proof...

... that modern art was intellectually bankrupt:

Knowing what you're talking about

I can name the 6 major Objectivist virtues off the top of my head. Granted, 6 is 4 less than 10, but you'd still think that someone that's so interested in the 10 commandments would know them. Colbert proves that that just ain't so.

Tuesday, June 13, 2006

Thursday, June 08, 2006

Epistemology and Agile Software Development

Non programmers probably will not get anything out of this post.

Epistemology has long been a favorite subject of mind. I’m fascinated generally with how the mind works, and reading Introduction to Objectivist Epistemology was an electrifying read for me. As a software developer, I continually strive to find better ways to write code. For the last six years, there has not been a single week when I have not looked at code I wrote just a couple of months before and thought, “that’s crap.” About a year and a half ago, thanks to my friend the Philosophical Detective, I read Agile Software Development by Robert C. Martin. It was the Atlas Shrugged of my software development career. Lately, I have been devouring books on design patterns and refactoring. Mostly I’ve been focused on the Martin Fowler related books due to the respect I’ve gained for him while reading his blog. During all this reading, I have been intrigued by the relationship between software design and technical epistemology. I’m going to talk a little about two elements of Agile Software Development, Design Patterns and Test Driven Development, in this blog.

Design Patterns

In his book Patterns of Enterprise Application Architecture, Martin Fowler quotes architect Christopher Alexander on what a pattern is: “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use the solution a million times over, without ever doing it the same way twice.” To rephrase, a pattern is a conceptual solution to a conceptual problem, where both the problem and the solution differ in their particulars from concrete instance to concrete instance. Martin Fowler continues: “a pattern is a chunk of advice, and the art of creating patterns is to divide up many pieces of advice into relatively independent chunks so that you can refer to them and discuss them more or less separately.” Further, “Once you need a pattern, you have to figure out how to apply it to your circumstances. A key thing about patterns is that you can never just apply the solution blindly… you see the same solution many times over, but it’s never exactly the same.” Fowler then emphasizes how important it is to give patterns a name: “patterns create a vocabulary about design, which is why naming is such an important issue.”

Let’s step back for a moment. Software development is an inherently logical and creative process. As developers, we are given some basic tools to work with that are constants in just about every programming language. These are variables, statements, conditional constructs, and loops. In languages such as COBOL, that’s all there is. All variables are global, and processing proceeds in sequence from one instruction to the next. This is great for small programs that just do one thing—but if the program achieves a certain level of complexity, it begins to overload the mind—to bust the crow, so to speak.

In more advanced languages, variables, statements, conditionals, and loops began to be organized into self-contained reusable code constructs called functions. Functions can be called over and over again—they always do the same set of instructions in the same order, but those instructions are only written once. Functions had the advantage of allowing you to consider a single set of instructions as a unit. This had the effect of organizing and clarifying the logic of the code. It had a further side-effect of enabling programmers to write ever more complicated programs: by organizing our logic into functions, we can treat whole pieces of logic as if they were single statements. The relationship to first-level concepts should be clear to any Objectivist.

In OOP Languages, you can go a step further and organize functions into objects. An object in an OOP language is of a higher order of complexity than functions, much as abstractions from abstractions are of a higher order of complexity than first level concepts. There are a few kinds of objects than can be created, and a few ways to create them—but there are millions of programming problems to solve. In my first couple of years as a developer, I thought objects were the conceptual height of software development. I didn’t know about Design Patterns at the time, and had yet to struggle with the decisions of when to use inheritance, or polymorphism. I would have to say, as an aside, that I overused inheritance.

Design Patterns make programming fully conceptual. Patterns focus not only on the abstractions describing programming constructs, but also on abstractions that describe common software problems and solutions. Since patterns are not limited to particular software constructs, they are not limited to any particular programming language, environment, or time. They assume an OOP language as a foundation. This is a requirement since you cannot have a conceptual solution to a problem without a conceptual tool. Patterns have a name, an intent (think definition), and are usually described with an example—much like a dictionary provides you with a sample usage of a word it has just defined for you. The example is a simple one so that the essential idea can be easily seen, but must be adapted to your particular solution. The result for the programmer is a new concept to use to solve development problems. Patterns can themselves be organized into more complex patterns, thus making them open-ended for extension and discovery.

Test Driven Development

Test Driven Development is the practice of writing a unit of code that generates an error because some feature of the program is not present, or does not work correctly. It is important to write the test code prior to attempting to implement the feature. Thus, when you write the test, it will immediately fail. Now that you have a test for the feature, it is time to write the feature. When the test for the new feature passes, and all other tests for all other features also pass, you are still not done. You must now look at your code, isolate similarites to other code, and refactor. A unit test should be no more than a few lines of code (I try to limit myself to 10 lines) so that what is being tested can be easily understood (in other words, don’t bust the crow of the reader).

Since a requirement of unit tests is clarity, you are forced—before you write any code—to think about how the code should look so as to “read” clearly. I actually read the code aloud so that I can hear how it sounds. The code must read almost like English. You have to think carefully about how you name objects, functions, and variables, so that the name itself identifies what it does. Gone are the days when you abbreviate everything--long function and variable names are fine if they're needed to describe what they do. In short, you have to encapsulate a piece of programming functionality in a “unit” of code. This makes every feature of your system executable in only a few lines of code. This requirement alone has huge implications for how you design your class libraries: you must keep your classes small and lightweight, and make interaction between your classes easy and open-ended. Each class should have one responsibility. All of these pressures are in place before you ever write the first line of code! The unit test “defines” how the code will work.

During the implementation phase, you are just trying to get the test to pass. You’re not worried if the code is pretty, if it’s organized, if it’s the best design. You’re just trying to get something together that actually works. This is analogous to “chewing” a concept, in my opinion.

During the refactoring phase, you are looking for ways to more deeply integrate your new code into the existing code base. This may mean breaking your new code into smaller functions or objects, extending existing objects to handle some of the functionality of your new code, etc.. Regardless, the refactoring phase is analogous to integrating the concept after it has been defined and chewed. The refactoring phase could be a tempting one for some programmers to overlook--after all, at this point the code works, so why toy with it? Because software must have integrity. If you cheat your design on this feature, then you'll cheat on your next one. Before you know it, your program will be a mass of repetitive, slightly different, unmanageable spaghetti-code. Refactoring is the principle that keeps your code integrated.

Another benefit of unit testing is automated regression testing. This is the easiest benefit for project managers to see, but I think the further conceptualization of the code is by far the best benefit. I make heavy use of the automated regression testing--but I find that because the code is conceptualized so well before I write it, I rarely have to make large structural changes to the code base. Of course, since all the features of the app are unit-tested, I can make those changes freely when necessary.

Closing Thoughts

One of the most interesting changes that has taken place in the last couple of years, since I started practicing TDD and studying design patterns is how seldom I use inheritance. When I first started programming in OOP languages, I used inheritance to add functionality to existing objects a lot. The result was that I would have an inheritance chain 5 and 10 layers deep. One of the things that TDD and Patterns forced me to learn was when a class has too many responsibilities. I had to learn to create new, smaller classes, and define interaction patterns between them instead of relying on inheritance to solve my problems. I’ve reached a point now where inheritance is pretty near the last solution I reach for when trying to solve a programming problem. I’m not saying that inheritance is bad—I’m just observing that it’s not nearly so great a tool now that I have access to more powerful abstractions to use in my code.

Saturday, June 03, 2006

X3 Review

Overall rating: 2.5 out of 5

Spoiler Warning.

X-3 was a major disappointment to me. When I walked into the theater to see the first X-Men movie, I was expecting just another cheesy superhero flick. The opening scene in German-occupied Poland during WWII destroyed that expectation. It was powerful, emotional, and moving. It set a tone, that as much as this movie was going to be about superhero's, it would also be about people. The second sequence, where Marie nearly kills her boyfriend with a kiss confirmed that feeling. From then on, the film focused on telling the story of some people that have discovered that they are different in fairly serious way from everyone else. It focused on the distrust between normal people and mutants, yet it confirmed the humanity of both. The parallels to racism and homosexual haters was everpresent, but not overstated. Still, the primary conflict of the first film was not mutants vs. people, but mutants vs. other mutants that wanted to launch a pre-emptive strike against the normal people.

The second film continued the tradition of the first. Again, the film was about people. It introduced a couple of new mutants, but showed marvelous restraint in that regard. The new mutants were given the same care and attention to storytelling as were the original cast, and the story of the original cast was extended somewhat. There was more action in the second film, but it also had a lot of story from the first film propping it up.

The first two films were done by Bryan Singer, director of The Usual Suspects (one of the most tightly crafted movies I've ever seen), and producer of House. Singer did not do the third film because he was busy working on Superman Returns. Were I FOX, I would have waited.

The 3rd movie is all-over-the-place. Rumor has it that the script was being re-written daily--and it shows. It's like they couldn't decide what story to tell, but it also looks like that knew exactly what action sequences they were going to shoot. I use the term "story" loosely--there are actually two separate, independent story arcs that were slammed together, but not integrated.

The first story concerns the development of a cure for the Mutant X gene. Of the two, this is the most interesting. A pharmaceutical company has developed a cure and made it available to anyone that wants it. It raises an interesting question: who wants it? If you had the chance to change something fundamental about yourself, would you do it?

The war-mongering mutants see this as a dire threat and warn that the cure will be used as a weapon--which it is--against the attacks of the war-mongering mutants. Magneto's bunch see's any mutant that takes the cure as a "traitor to their kind." This is interesting because now Magneto has become the racist bastard that he's always accusing everyone else of being. The other mutants see it as a matter of personal choice. This is all good fodder for storytelling, so what went wrong?

The story wasn't told. It was used merely as an excuse to get to the next action sequence.

This movie was overloaded with mutants. Whereas Bryan Singer had taken care to introduce new mutants with the attendant screen-time to make them real and human, Brett Ratner just threw them at you right and left. Angel was a couple of minutes of the movie, and as much as I enjoyed Kelsey Grammar's performance as Beast, like Angel, it was wasted screen time. In fact, the Beast story had real potential.

We're given the sense that this movie takes place some time after the first two. There is an a Ministry of Mutant Affairs in the government, headed by a Mutant--Beast. Beast later leaves his post in the presidential cabinent over conscientious objections to the cure being used as a weapon. This could have been really exciting, dramatic storytelling. Instead, it was mentioned as an afterthought, after it had happened.

Even the opening scene displayed what was wrong with the movie. In the first film, we open on Poland. In the second one, we open on an attack on the President by a mutant in the White House. In each of the first two movies, the opening scene was relevant to the plot of the movie. The Poland experience explains why Magneto wants to launch a pre-emptive strike against humans. The attack on the President leads to Presidential authorization of the search at Xavier's school which ---you get the idea. The opening scene in X-3 considered qua action sequence was quite good--but it was unrelated to anything that happened later in the movie.

My final gripe is that all the mutants are now over-powered. I don't remember Storm being able to jump 5 stories in the first two films, or Wolverine for that matter. No attention was paid to making sure that the characters were the same as in the first two films.

I did like the movie--in the same way that I might watch an Arnold Schwarzenegger action flick--as a mindless action story where story is an excuse to watch things blow up. That has its place, but after X1 and X2, I expected more from X3.

Friday, June 02, 2006

Imogen Heap Live in Concert: A Review

I saw Imogen Heap perform in Atlanta a couple of weeks ago. The venue was the Variety Playhouse. I haven't been there since I went with my buddy D. some 12 years ago to see Sarah McLachlan on the Fumbling Towards Ecstacy tour. It hasn't changed much.

The venue is relatively small--seating exactly 681 people according the fire marshall. This is nice because it means that there isn't really a bad seat in the house.

Zoe Keating opened for Imogen. Zoe is a solo cellist, making use of some modern effects processors. She relied very heavily on a looping machine. She would play something, which would be recorded by the looping machine and replayed over and over. Then she would harmonize against that, slowly building a whole piece of music. It's an interesting idea, but it doesn't really work that well. As you listen, you find yourself waiting for her to have built the actual music so you can enjoy it. She had some interesting musical ideas, but the over-reliance on looping detracted from my ability to enjoy it.

Enter Imogen Heap. First of all, the woman is just downright beautiful. Even through the big-wild hair and crazy make-up and loud clothing, you can tell that there's a beautiful woman on stage. I was a little concerned about going to see her live because she is just a solo performer--and worse she's a solo performer playing as a whole band. I was worried that she would be stuck behind her keyboards and it would be difficult to enjoy the show. Boy was I wrong!

She started the show with an a-cappella version of "Just for Now." Imogen uses a lot of the same looping technology that Zoe Keating did, but in Imogen's hands it never felt contrived. Each pass through the loop enhanced what was already a nice piece of music to start with. Zoe illustrated what the technique was. Imogen illustrated what could be done with it in the hands of a master.

The arrangements to many of the songs she performed were quite different than what you hear on her albums. It's clear that the arrangements were designed with the live show in mind. Imogen would play for a bit, building something that could then be allowed to play on its own for a minute--then she would grab the mic and dance out from behind the keyboards, crooning and wailing where appropriate. I was impressed with how vibrant and active she was on stage--at how this one woman commanded your attention for a full 2 hours. I was shocked at how loud the music was, and at how hard it rocked.

Imogen Heap is a wonderful song-writer and musician in her own right, but that doesn't always translate into a good performer. She is a masterful performer. If you get the chance to see her live, don't miss it. She is amazing.

$