Burn Jet Fuel, Plant Trees
This weekend I ran across an interesting article about Google business policies in China. However, what I found interesting in the article had nothing to do about China. It was what Sergey Brin, co-founder of Google, had to say about offsetting carbon emissions. It is well know that the Google co-founders fly in a private Boeing 767. Mr Brin is concerned about the impact his jet travel is having on the environment due to carbon emissions. He is taking care of this problem by “offsetting” his carbon emissions.
“What does offsetting his carbon emissions mean?”, you may ask. I had never heard of this concept, so I did a little research. One of the best references I found of course was on Wikipedia. They identify the subject as a “carbon offset”. The Wikipedia article gives pretty good information on carbon offsets and also lists some sources of criticisms in order to give a balanced view. In short a carbon offset is something you do to negate the carbon emissions that you personally create. One such thing is planting a tree. You can read the Wikipedia article for a more scientific definition.
To be fair to Mr. Brin, he is quoted in the article as “not really being sure about the efficacy of such programs”. The article reads as if Mr. Brin is going to release more information on what he is specifically doing at a later time. I’m not going to give my opinion on carbon offsets either. This isn’t a political blog and this subject definitely appears to be in the political arena. And I’m too new to this subject to have a valid opinion anyway. I simply find the entire subject fascinating and think that we will be hearing a lot more about this in the future. The subject is sure to have large political, social and scientific ramifications.
Ice Covered Trees and Software Quality
I had so much fun writing Temporary Trees and Software Decay, I thought I would write another article comparing trees to software. If you love trees and software, hopefully you can bear with me.
Recently, the St. Louis area experienced two severe ice storms. Not all areas were affected as badly as others, but unfortunately the area where I live was hit hard. The real damage occurred to the trees in the area that had been covered with a half of an inch or more of ice. I was lucky and only had one tree that received any significant damage. Some nearby areas weren’t so lucky and looked like a tornado had torn through the area. It was a shame to see so many beautiful trees damaged or completely destroyed.
In my yard I had three types of trees in relation to these ice storms.
- I had strong trees like the oak. The oak is very strong and did not give at all to the ice. Too bad oak trees takes so long to grow.
- I had trees that were not as strong, but very flexible like the maple. Many branches on my maple were touching the ground. I didn’t think my maple was going to make it, but luckily its branches returned to their normal positions a couple of days after the ice was gone.
- I had trees that were not strong and not flexible, like my willow. My willow lost many large branches. It clearly appears to have been damaged. The damage wasn’t so severe that I’m going to remove the tree, but I have considered it.
What does any of this have to do with software? Let’s see.
- Strong trees like the oak remind me of software that is designed correctly and according to specification and simply works great. Like the oak tree, high quality software takes longer to create. Sometimes this is OK, but sometimes the business environment doesn’t afford this luxury.
- Less strong, but flexible trees make me think of software that is designed quickly, but with “best practices” and good leadership. This is often what many of us strive for. Software that can be developed quickly, with quality and meets requirements is in high demand.
- Less strong trees that are not flexible and often break are similar to programs that are thrown together quickly, without quality processes and do not meet requirements. Unfortunately, some of the most beautiful trees fall into this category. I don’t know if the same can be said for software. Often it is better to throw away weak and inflexible software than to maintain it. However, like temporary trees, sometimes software is written quickly to take care of a short term problem that does not warrant an expensive or significant development effort. If so, its important to know when this is the case.
Be sure to know what kind of software you are building - oak, maple or willow. Hopefully, when you are trying to build an oak or a maple, you don’t end up with a willow. Its also good to know what kind of software you have deployed in the past. You don’t want to wait until an ice storm to find out.
Pick Your Java Poison: XML or Annotations?
Support for annotations is one of the biggest new features in Java 5. Since annotations can eliminate or greatly reduce the need to use XML for expressing metadata and configuration data, naturally a debate has arisen as to which technology is better. Some believe that XML is evil and should never have been invented. Others believe that annotations are a passing fad and were only added to Java because C# had them first. Ruby on Rails has also put a lot of pressure on the Java community to make it easier configure Java applications, with its “convention over configuration mantra”. I’ve been using annotations (as well as Java 5), for about six or seven months now, so by no means am I an expert. I thought it would be interesting to research the topic and develop a list of when to and not to use annotations and XML.
When to use annotations:
- You despise XML and are looking for new ways to express your metadata.
- Your metadata is related to a single class or method.
- Your metadata is fairly static and will not need to change at runtime.
- You want to see your metadata encapsulated inside of your objects.
- You are looking to take advantage of special annotation features supported by the JVM.
- You are looking for ways to access metadata within your Java code using native language commands.
- For specifying default metadata.
- Several of the popular frameworks are using annotations and you want try them out yourself.
When to use XML:
- You are happy with XML and are not looking for a new way to express metadata.
- You think that the addition of intelligent defaults to many of the most popular frameworks is good enough to warrant the continued use of XML.
- Your metadata is related to multiple classes.
- Your metadata is not related to a class or a method at all, but to a higher level of the application and therefore aren’t a good solution for what you are doing.
- Your metadata will change often. Configuration data is a good example of this.
- Your metadata needs multiple implementations.
- You want to see all of your metadata defined in one location.
- Your metadata needs to change at runtime.
Unless you are dead set against using annotations at all, then I suspect you will end up using some combination of XML and annotations to support your metadata and configuration needs. EJB3 is a good example of this. EJB3 uses annotations to set nearly all of its features where it makes sense, and XML can be used to provide alternate implementations and overrides if necessary or when annotations aren’t appropriate.
Has anyone reading this has written any guidelines or standards on the use of XML vs annotations? Have an opinion on this topic? Please leave a comment to this post. This would be a great topic for sharing ideas.
Update 1/24/2007: I just added a couple of new items to list for default metadata and metadata that needs to change at runtime. Thanks for the comment Alex.
Keep IT Simple? Of Course!
I’m always amazed when I see a study whose findings are something that most of us in the trenches have known for years. In this case, the study is about simplicity and keeping the number of operating systems, databases, applications and data centers to a minimum. Obvious stuff, huh? Ever work somewhere that has every computing platform known to man under one roof?
Fast Words
![]()
I think its noteworthy when I find a new Web site that merits a bookmark on my browser’s toolbar. Well, actually when it not Google, Gmail, My Yahoo!, etc.. I found one today… NinjaWords. Its simply an online dictionary like many of the other online dictionaries out there. However, its very fast and very clean. And there’s no gaudy advertisements. Did I mention that its fast?