About Adam Young

Once upon a time I was an Army Officer, but that was long ago. Now I work as a Software Engineer. I climb rocks, play saxophone, and spend way too much time in front of a computer.

D & D

A slew of popular sites have posted homages to Gary Gygax, one of the original creators of Dungeons and Dragons.

Like many geek kids, I was in to D&. Note that we always referred to it this way, not by the full title. Aside from Dungeons and Dragons being to unwieldy to say, we didn’t need all those extra syllables. It was D&D and we knew what we meant.

Steve Graber, older brother to my friend Brian, got us introduced when we were in, I’m going to guess fourth grade. Steve had learned to play with a mythical friend of his that I never ended up meeting. He was a 12 year leading a group of us 9 year olds on our first adventure. We played in the shed house My. Graber built in the back yard. It had a large picnic table that we all could fit around. It was Our Place. Oh, sure, there were not “keep out” signs, but no-one would come in there.

I was already in to Science Fiction. My Dad had worked on the Apollo Project back before. He taught my Sister and me about gravity and how solar system objects revolve around each other. I was drawing space ships and playing Star Wars. But the D&D game fired my imagination with the added dimension of Fantasy.

I’ve always been a reader. I was way above grade level before I ran into D&D. So I can’t claim that the game got me reading. But it did direct me at history. The monsters of D&D lead me to mythology, first Greek, and then Norse. From King Arthur and the Knights of the Round Table I learned about weapons and castles, horses and armor. Other sources lead me to Greek Phalanxes and Roman Legions.

I won’t claim that D&D alone put me on the road to applying to West Point. But D&D certainly was encouraged the ideal of Chivalry. The numbers and data tracking appealed to the budding computer scientist in me. The books were great fuel for my reading furnace. The Paladin and Ranger characters, coupled with the physical training I got from Wrestling, made a pretty convincing ideal.

I came across an old Dungeon Masters (DM) Log I had. It recorded many of the adventures I lead when I was 10-14 years old. I always ended up DM, I guess since I was always arraigning games. While you get to play as a DM, you need to keep a part of you reserved, preventing you from fully immersing in the game. I enjoyed orchestrating the games. I think this, too, was a form of leadership training that helped bring me to applying to USMA.

One thing that has waned over the years has been my interest in the fighting aspect of it. It is harder and harder for me to enjoy a game that simulates killing, even if it is wretched, evil creatures. The profession of soldier makes you aware of killing, even if you never have to perform the act (I never did). The concepts of Good and Evil as Absolutes are too easily thrown about. I’ve seen the potential to do evil (in Hebrew Yetsir Ha Ra) in my own soul and realize that to many people, I would be considered evil. I do still love the concepts of Law and Chaos, but find them to be complimentary, both required for any system to work. I’ve also realized that the game has to be tailored to the ability levels of the characters or they will be quickly killed off. The universe is not so nice as to only push adversity in our way that is just difficult enough to force us to grow, but not so bad as to maim us for life. As a new Dad, I have a newfound respect for life, especially in its most vulnerable stages.

The Game of Dungeons and Dragons provided me with a great outlet It proved to be a wonderful seed for creativity, and a great learning tool for data management.

Musings

Don’t hit publish on the blog when you just want to save a draft.

Big Builds are Bad. Software should be developed and distributed in small packages. Linux is successful due to things like apt, yum, and yast.

Interface Specifications need to be more specific.  Just saying that something is a string is not really helpful if that something needs to conform to a pattern.

Programming and blogging requires sugar in the brain.

Interviews are tricky…on both sides of the table. Career fairs are worse.

C++ Has a lot of magic in it. Can we make type level programming more transparent?

Microsoft purchasing Yahoo would be good for Google, but bad for just about everyone else.

Being a Dad is really cool. Even when it sucks, it is great. Sometimes kids refuse to go to sleep. This leads to sleep deprivation, but also leads to really wonderful moments in rocking chair in the middle of the night.

Pool is a great Geek game. Lower left-hand English is neat.

Snowshoes are good off the trail. Not so good on the trail. If your going on the trail, take the cross country skis. Snowmobiles smell funny.

New Hampshire winter weather is still as brutal today as it was when I left the area in the early ’90s.

It is hard to sing a Jazzy version of Old MacDonald had a Farm.  It is harder to do after the tenth repetition while trying to get a child to fall asleep.
If you listen to Children’s CDs long enough, you will develop favorite children’s songs. I like the hippo song.

Is there really a difference between the Ethernet and SCSI protocols? I don’t know, but it would be fun to find out.

The compiler is your friend. Let it check your work for you.

Why write code on a white board if you have a computer available? Especially if you have an overhead projector?

Where do the local peregrine falcons sleep? Where would they be sleeping if we hadn’t built up the whole area?

If I could have a redo on which language to take as a Sophomore, I would probably would have liked to take Chinese. Russian and Arabic would also do. German was not a good choice for me.

If Bush Senior had insisted on pushing to Baghdad, it would have been my generation in this mess as opposed to the current set of junior officers. Instead of Haiti, I would have gone to Basra or something.

There are too many interesting topics in the world to pursue them all, or even a small fraction of them.

Every philosopher I’ve read, especially the ones I disagree with, ave said something that is valuable and true.

No matter how old you are, when you get together with your parents, you revert to teenager status.

This list should never see the light of day.

Layout of the oil situation in Iraq

Not sure if I should post this or not.  So many people are in a better position to really understand the situation than I am.  Really, what I want is for people to respond to this to expand, clarify, correct and elucidate me.

Maybe we won’t be in Iraq forever. Maybe the real yardstick we need for success is the amount of oil flowing out of the country. Iraq is producing a small fraction of it’s capacity. If it ramped up to several times it’s prewar amount, it could be the largest producer in the world. Considering the current cost of oil is $3.00/gal at the pumps in Massachusetts, It is possible that there could be a healthy dose of currency flowing into Iraq that is not coming out of the US Treasury. There are several factors at play:

Sunni-Shiite-Kurd political contention. If any one of these groups gains power over the majority of the Oil revenue, it will be significantly threatening to the other two.

OPEC. The nearest nations to Iraq are the ones with the most to lose from a large capacity, non-OPEC nation in their midst. Iraq is a founding member of OPEC, but it may not be perceived as an independent entity by the others, and more as a puppet of the US. Any move to substantially increase oil production will bring up the global supply, drop the price, and decrease profits across the board.

China and India: These two nations are growing fast, and demand for Oil from these nations has kept the cost of oil high. Both have a vested interest in increasing global supply to decrease price.

France: Much of Iraq’s pre-war debt was owned by France. The US invasion changed France’s relationship to Iraq from insider to outsider. They have their own problems with Muslims both at home and across the Mediterranean in Algeria.

Australia: Currently planning on pulling out of Iraq. Fewer troops to patrol means a higher possibility of successful insurgent attacks.

Russia: Russia is now a huge supplier of Oil to Europe. While Russia is not a part of OPEC, it still has a lot on the line in terms of Oil Revenue.

Turkey: Oil revenue to the Kurds means more money that can flow over the border to Kurd separatists in Turkey. However, stability on Turkey’s southern border will be beneficial to Turkey overall. Mosul, in Northern Iraq, is one of the most violent locations, with a major operation underway even as I type this. Turkey has performed operations across the border into Norther Iraq targeted at Kurdish fighters.

US Economy: The cost of maintaining troops in Iraq may prove too high. The US may have to withdraw before a critical mass of oil extraction infrastructure is in place. The US is anticipating the oil influx. Most of the companies that will benefit from Iraq oil are based in the US or Britain, and thus have a lot to gain. The US President and many in his administration are primarily oil-men, but with the election coming up, that may change.

Middle East Nations: Saudi Arabia and Iran both have a vested interest in supporting their allies in the Iraqi Government. If A Sunni Majority again emerged, it would be more closely allied with Saudi Arabia. A Shiite Majority would be allied with Iran. Either case would lead to increased domestic strife and a decrease in oil production. With a Sunni majority, Iran would have the “moral high-ground” of supporting Shiites against their oppressors. The reverse would be true with a Shiite majority and Saudi Arabia supporting their side. I realize that this is a vast oversimplification, but the a part of the broad trends.

The path forward needs to walk a tight rope of a balance of power that will lead to stability. Both sides need to believe that they have more to gain from getting oil set up than they will lose in relative power and status. But even if Iraq is able to produce a substantial quantity of oil, it won’t necessarily work wonders for Iraqi society. Typically, Oil is run by a few companies. It may be possible that an Iraqi Wildcatting culture will grow up, but that can’t happen until there is a long term education amongst Iraqis in oil extraction. Oil has several offshoot industries. So there should be growth of the competitive/cooperative spirit that is the product of a healthy capitalist system. But it will still be centered around a single industry with major fluctuations based on global events. If we look to Saudi Arabia, we see that oil wealth does not necessarily carry with it human rights.

Here is a dark scenario. Iraq will get enough of its oil infrastructure up and running to make US involvement essential, but not stabilize enough that we can pull out. We will have a force in Iraq in perpetuity, drawing fire and making enemies. That force will be essential to defending the Oil extraction facilitated in Iraq.

I don’t know what will really happen. I certainly don’t have the perspective to see that clearly. Just trying to layout the situation based on the limited info that I have.

Wrapping a boolean return value with an exception

I am currently working with a long block of code that uses && (logical and) to a long list of functions. The idea is to run all of the functions and short circuit if any of them fail. The problem is that there is no consistant mechanism for error reportin. If any of the functions fail, I have no way of knowing which one. This is my planned approach.

#include <iostream>
#include <stdexcept>
using namespace std;

bool invert(bool val){
return !val;
}

#define attempt( X ){ if (!X){ throw runtime_error(#X);}}

int main(){
cout << “OK” << endl;
try{
attempt(invert(true));
}catch(runtime_error& re){
cout << “runtime_error exception:” << re.what() <<endl;
}
return 0;
}

Ayn Rand and Robert Pirsig

A younger friend at work has recently completed reading Atlas Shrugged. He is fairly close to the age I was at when I got enthralled with Ayn Rand. Something about her writing appeals to the emerging man. “You can do anything. The world will try to hold you down, but you can create.” At the time of my transition from Army Officer to civilian programmer, nothing was more comforting to hear.

Continue reading

Why virtual, why not

Using a non-virtual method in C++ is syntactic sugar:  It doesn’t allow you to do anything you could not as easily do BY using a static member function and passing in the object instance as the first parameter.  If you don’t fully qualify the name of the function, the type checking of the first parameter will make sure you call the right version, or at least get a compilation error until you do fully qualify.The only reason you would need to use one is for template programming, where some classes have the method you wish to call as a virtual, and you want to be consistent across all classes passed to the template.

This is not to say that all non-virtual functions are bad, just an observation about what the language  provides.

Affiliate links

I keep getting comments from people along the lines of:  I just found you on Google search and added you to my Reader.  When I follow the links back to their web pages, they are marketing sites.  This is my blanket apology to all people who send such links:

I am more than willing to post your responses, and give you the links back you so desire.  But this blog has a minimum requirement for comments:  You have to show that you read the article, and then contribute something to a discussion on the topic at hand.  Note that just reading the article is not enough.  I am not going to make this a vehicle for spam.

If you are genuinely interested in the topic, by all means post, even if it is just to ask for more information.  I will certainly try to answer your question.  But again, don’t just fire off questions hoping to get the affiliate links.  I’m sorry, but that is just not how I am managing this site. The questions have to be something where the discussion would expand on the topic of the post.

I suspect that Google is smart enough at this point to identify blog sites and filter out links from them when calculating web page standings.

Integrated Development Environments

I understand now why so many people that have cut their teeth on C coding in Unix/Linux hate C++.  A coder can get her job done in C without needing significant tool support.  An editor, a build toolchain, and limited reverse engineering support a-la objdump and you are good to go.  Tag support makes navigation a lot easier, and suddenly, you have decent productivity.

When I started in the professional world, I learned C++ using Microsoft Visual Studio.  I had, prior to then, been a big fan of Borland for Pascal, and had even purchased a copy of Borland C++.  But, unlike the MS product, it did not then have an integrated debugger, and my learning curve was quite steep.  MSVC took me through the steps, provided decent navigation, and easy to use wizards for MS technology.  I did have the frustration of trying to work through libraries without having the source code, but this wasn’t the VC developers fault.

When I left the MS world for the Java world, the first thing I noticed was the lack of an IDE.  I was just so productive with all of the tools integrated, that it took me a while to get used to coding in EMACS. I had long since learned the value of stepping through code after I wrote it to make sure it was doing what I expected. Using gdb, while effective, was much slower than an integrated debugger.  It wasn’t until I got my hands on Intellij’s Idea that I felt a return to the productivity I had under MSVC.

When refactoring support hit in Eclipse, I was stunned at the ease of maintaining code.  I can’t say enough about this, and may try to recreate some of my earlier writings on Refactoring in order to show how valuable the approach can be.  Suffice to say, it is now a go-to tool for coding that I miss when forced to do without.

Now I am trying to figure out how best to do C++ development on Linux.  etags just does not handle context well enough, and CScope’s navigation is fairly clunky.  I’ve got a demo of Visual Slickedit, and the Eclipse platform with C/C++ support built in, but I have yet to find a smooth working environment.  My problem comes from dealing with an alien code base, tightly coupled dependencies and byzantine makefiles that I haven’t had time to spelunk.  I’ve not been able to get automated refactoring support to work and even base navigation is problematic.  As I work out the solution, I will  record my approaches here so that I will be able to recreate them in the future.