comments edit

You’ve no doubt heard me rant against premature optimization in the past, but Eric Gunnerson points out another “Premature” action to be avoided, “Premature Generalization”.

His discussion centers around a very specific question of whether to use private properties to access private fields, or just allow access to the field. Note this discussion pertains to fields that are not publicly accessible via property nor direct access.

The place you’ll often see premature generalization is when inexperienced developers start applying Design Patterns everywhere. If you need to instantiate a factory, implement an adapter class and use a bridge to the toilet just to take a dump, then you probably live with a developer with a premature generalization problem.

Like optimization, generalization is good when it is applied judiciously in the right places. With optimization, one should measure measure measure before applying optimizations. With generalization, I typically suggest that a developer must feel the pain first before generalizing. That simply means that the lack of generalization is starting to cause more work than it saves. In my experience, this often boils down to the rule of threes. If you have to implement something a third time, refactor it.

For example, suppose you have an import tool for some system and as far as you know, you’ll only have to support one import client. By all means write an importer specific to that client. Now your boss tells you to implement an importer for another client. Write that one specific to that client. Once again your boss tells you to implement an importer for yet another client. At this point a pattern has been established. Your boss is a liar and you’ll probably need to implement importers for many clients. Now is the time to refactor the code and generalize the concept of importers. Maybe create a plug-in model or an Import Provider.

[Listening to: Cass & Slide / Perception - Sasha - Sasha: Global Underground: Ibiza [2 of 2] (9:27)]

comments edit

It wouldn’t be fair to point out the mistakes of other developers being lazy without pointing out that I have been very guilty of this myself. The point of the post is not to trash another person’s coding habits, but to present an ideal to work towards. Sometimes, intellectual “laziness” is absolutely necessary as in the example presented in the comments of that post.

When I started off as an ASP developer (remember VBScript?) I needed to store name value pairs within a cookie. So I started off storing a string like so in the cookie.

Response.Cookies("ChocolateChip") = "name1=value1,name2=value2,..."

But I ran into an issue that some of the values contained commas, so I chose a delimiter I was sure would never be in the content…

Response.Cookies("ChocolateChip") = "name1=value1*&*name2=value2*&*..."

And proceeded to write a butt load of string parsing code to insert and extract values from the string, making sure not to insert duplicate names, etc…

Of course later, I got around to reading more about Cookies in ASP.NET and I discovered that you can create cookies with keys. So the ugly code above became…

Response.Cookies("ChocolateChip")("name1") = "value1" Response.Cookies("ChocolateChip")("name2") = "value2" '...

Had I spent a few extra minutes up front reading about cookies rather than programming by intellisense, I would have saved myself a lot of time. In the end I ripped out my code and used the built in mechanism.

<blatantLie>To my defense, I was only five at the time and I had been hit by a bat earlier that day so I was seeing double.</blatantLie>

comments edit

Lazy A while ago, Jeff Atwood wrote about the merits of laziness for successful software developers. Lest this become the mantra of sub-performing developers everywhere, I wanted to follow up with a clarification.

It’s fine to be lazy as he describes in the article, just don’t be intellectually lazy. What do I mean by this? First and foremost, when you are writing code, make sure you really understand what the code is doing. The classic illustration of mental laziness is encountering an off-by-one error.

When encountering the error, the lazy developer would simply append a “

  • 1” to the end of the stament, re-run the code, and if it seemed to work, move on. Or they might change a “< x” to “<= x” For simple cases, this may be the correct solution, but the problem arises when the developer doesn’t take the time to evaluate why the error was made in the first place. Sometimes, the simple fix only works for a narrow range of inputs and masks a larger error.

This solution is merely one example of a whole class of anti-solutions I call “Try It and See” solutions. The developer simply moves code around a bit and crosses his fingers to see if it works.

Off-by-one errors are only the tip of the iceberg. This class of anti-solutions often come up when when a developer is using a framework such as ASP.NET in which he is unfamiliar.

On a recent project, I noticed one of the developers had put nearly all of the page logic within the PreRender override. I asked the developer why he put it there, since the proper place would have been in OnLoad. He replied that OnLoad was too early to run that code because the controls didn’t have their settings from the inline control declaration within the aspx file.

Hmm, I’m pretty sure they would be there by then I told him, and he said in his experience, they are not. So I emailed him the order of events within the ASP.NET page lifecycle and pointed out that the method AddParsedSubObject happens after the constructor and way before OnLoad is called.

I believe that he did encounter a weird problem a long time ago with control declarations not filtering through, but rather than dig into the problem and really understand what was going on, he simply moved the code to PreRender, saw that it worked now, and cleared his hands of the problem.

I can understand that on a rush project, there’s a temptation to simply try things till they work and then move on, but you will save more time in the long run if you take a break and dig into the problem to get a real clear understanding of what is happening.

Likewise, spend time getting up to speed on the framework you are using. For example, ASP.NET has a usable form validation framework. Learn it. Use it. There’s no point in wasting time writing your own framework for validation unless you know the ASP.NET validation framework inside and out and really need to work around its limitations. And if you are going to write your own, consider buying a package first such as Peter Blum’s validation package.

So once again, be lazy, but not mentally lazy. Write unit tests up front where they make sense. Learn the framework you are using. Understand the code you are writing or debugging. And in the long run, you’ll be making your life (and your coworkers lives) easier. Perhaps that’s the true laziness.

comments edit

dsc00687 I am back from our first Board of Director’s meeting in San Francisco. The sheer amount of legal formality required in conducting business as a corporation is really quite interesting. They aren’t kidding when they say it will increase the amount of paperwork you deal with.

Just as an example, my business partner Micah needed to open a business bank account a few days after incorporating. He approaches the teller and she informs him that she needs to see the minutes to a company meeting.

Not one to be carrying the minutes to all his meetings in his wallet, Micah was in a bit of a bind. However, one of the bank employees had the proper form to fill out for the minutes to a meeting. However, by law, there has to be a minimum of ten days and maximum of thirty days notice to the shareholders of a company before a shareholder meeting may commence.

So you can see the conundrum here as in this situation, Micah had only given himself about five minutes notice, well under the required ten days. Fortunately, there is a waiver form a shareholder can fill out to state that he or she did not receive the ten days notice, but that it is just fine with the shareholder. So as the sole shareholder, Micah had a quick meeting, filled out the minutes, filled out the waiver, and got the damn bank account open.

comments edit

Mathematicians and Computer Scientists know that the Donald that has had real impact in our world is Donald Knuth, not Mr. Trump. He is a giant in the industry and very well respected.

He’s also tireless and persistent. Consider this, he has been working on his seminal work, The Art of Computer Programming for 43 years and he figures he has 20 more years of work left. Volume 2 of the work, Seminumerical Algorithms, formed much of the backbone for my college thesis on pseudorandom number generation.

So it is with great amusement that I read his letter to the w3c flaming them for depracating certain html elements and attributes. Good find Dare!

comments edit

dsc00694 Akumi and I decided to turn the business trip into a short weekend getaway. After the meeting, we all went out to Espetus, a brazilian churrasco place. Each table had a simple dial. Turn it to green and the waiters with the sticks keep coming to your table offering slices of sweet glorious meat. Turn it to red to put a temporary end to the gluttony. Needless to say, it took an extreme amount of willpower to turn that dial to red once we set it to green.

The next morning, Akumi and I ate at a fantastic Dim Sum place, the name escapes me right now but we have the card somewhere.

Once again gorging ourselves, we were pleased to have a bill with a grand total of just some pocket change over twenty bucks. What a deal!

We then met up with an old friend of Akumi’s and the friend’s wife. The friend is a product designer and works for the very well regarded IDEO. His wife works at a marketing agency and is responsible for the Banana Republic account. They are what are known as “creative types”.

After a great time with them, we checked out some stores, I played with the PSP at the Sony Metreon, then we headed over to Oakland to catch a plane back. Now I’m up way too late for my own good hacking away at this blog. Good night.

comments edit

Just got back from the PDC Underground at the Westin Bonaventure which had its fair share of great and not so great grok talks. I went with Micah and Jon and met a few people I’ve only been acquainted with via subscribing to their blogs.

One is Jeff Key who is a heck of a funny guy. Also met Stuart Celarier who had a long day overseeing the BOFs and didn’t arrive at the Westin till past midnight.

Also making a quick appearance was Don Box sporting a shirt with “WTF?”. I thought he was pimping The Daily WTF but he informed me that it stood for Windows Transaction Framework. WTF?

Of course I ran into the ever friendly and communal Adam Kinney.

comments edit

Walt provides this interesting look at how blogs have some influence within the Senate confirmation hearings for Judge Roberts.

One of the Senators, who had read the blog (or more likely, whose staff had read the blog) asked Judge Roberts which type of umpire he would be…

More interesting than the substance of this exchange is that blogs are actually influencing the Senate confirmation hearings for one of the most important positions in our government!

Now I just need to get these Senators to read my blog so they can ask the really pertinent questions such as:

  • Are you an “in-y” or an “outy”?
  • Boxers or Briefs?
  • Tastes Great or Less Filling?
  • Mac, Windows or Linux?
  • Will you be the first Supreme Court Justice in history to have a blog? (editor note: Yeah, right.)
  • Value Type or Reference Type? And if Reference Type, in which circumstances would you implement IDisposable and in which cases would you choose to implement a finalizer? Please frame your answer by considering how the power of Eminent Domain figures or doesn’t figure into this discussion.

The public wants to know!

[Listening to: Porcelain - Moby - Play (4:01)]

comments edit

Well I’ve kept this relatively quiet long enough, but since Jon Galloway spilled the beans, I might as well mention it. I am no longer an independent consultant.

Yep, I am rejoining the corporate rat race as an employee complete with W2…but with a twist. I have accepted a position as Chief Technology Officer of VelocIT (pronounced the same as “Velocity”). The twist is that I am also a co-founder and part owner of VelocIT, so it makes the idea of being an employee again much more palatable. ;)

I was hoping to save the announcement till we had a real website, but that could take a long time with the sheer amount of work we have already. So until then, I’ll just make my blog the unofficial de facto VelocIT website.

This has been a dream of mine for a long time now. It’s a chance to conduct a grand experiment in how my business partner Micah and I think a company should be run. For example, I am a big fan of transparency and open book accounting. I just don’t see how restricting the information your employees have access to helps them perform better.

I am also a big fan of the ideas in Growing a Business by Paul Hawken.

If you haven’t read it, I highly recommend it. One of his main points is that simply following a standard generic business model does nothing to distinguish a business from the hundreds of other carbon copies. Instead, a good business should reflect the values and personality of its founders. It should be as individual as you are. Think Ben & Jerrys and you start to get the picture.

He also talks a lot about trusting your employees. For a long time I have seen many companies make the mistake of not trusting and empowering their employees to make decisions. Now I have a chance to really put my money where my mouth is and attempt to push responsibility and trust down and see what happens. Obviously this requires that we make a great effort to hire people deserving of trust and capable of handling responsibility.

We have already identified one of those people in Jon Galloway who will be working with us as a contractor and who we hope to eventually hire on as an employee. I’ve read his blog for a while and he is obviously a top-notch developer and a pretty decent fella as well.

VelocIT is at its core, a consulting shop, but we are focusing on being Solution Architects. When I described VelocIT to my former CEO (and current client), he remarked, “Oh. So you’re like a portable CTO.” That hit it right on the mark. Although we can handle any point in the technology project lifecycle, our strong point is partnering as a portable CTO. As such, we constantly seek the most cost effective solution for our clients. Custom software development will usually be the option of last resort, and usually only to tie together and integrate various systems. If custom development is needed, well you found the right people.

If you’ve read my blog for a while, you’ll know that I am a big fan of open source software. I am a firm believer that there are viable business models with open source software. Just take a look at chapter 1 of this pdf book, Open Source Development with CVS to get some ideas.

In the short term, my involvement with such OS projects as RSS Bandit and Subtext will suffer a bit (But don’t worry Dare and Torsten, I’ll get that Help thing done soon). But in the long term since we plan to leverage open source software such as Subtext, DotNetNuke, Blue Whale CRM, etc… in projects where they provide the most value to our clients, I foresee making more contributions to them in the future. We just need to staff up and free me up to remain more high level than the day to day coding I am doing now. Don’t get me wrong, I love writing code, but I prefer writing open source code.

So in the meanwhile, wish us luck and send me an email if you need our services haacked at gmail dot com.

comments edit

Perhaps I have a skewed view of reality, but I get the impression that software geeks are leading the charge into building the next generation of social software. Does it strike anyone else as odd that nerds are the ones defining the technologies and interfaces for people to become social? Is this some sort of Revenge of the Nerds we plan to inflict on the “cool” social butterflies who spurned us in our youth?

Maybe they are not so visible, but I would expect to see the technology leaders pushing the social software revolution to publicize their top notch sociologists alongside their technologists. Hey, we love your tech-guy’s fantastical AJAX framework, but is it really fostering social networking and community growth? How are you measuring that? Where is your Chief Sociologist Architect?

comments edit

UPDATE:Well it turns out that half of WebHost4Life’s servers didn’t have enough backup juice to stay up. Guess which half my blog was hosted on? Yep! But it is back up now (which is obvious otherwise you wouldn’t be reading this).

Umm… sorry folks. I may have tripped on the power cord leading into Los Angeles. I plugged it back in quickly. My power was only out for around a minute, but others have been down much longer.

Yahoo news has the more detailed story.

comments edit

I distinctly remember sending a memo to my body years ago that illness is no longer permitted. But here I am with a persistent cough and lack of energy. I think I’ll have to let my body go and hire a new one.

comments edit

I learned through Mr. Wagner that my former employer just announced the first ever million dollar skill game tournament.

To win the tournament one must be the best all-around at their three most popular games, Solitaire, Zuma and Bejeweled 2. These games are among the most popular “casual” games around. Casual gaming is the term used for games that do not target the hard-core gaming audience such as Half-Life and Quake. The typical casual gamer is a thirty year-old mother in the midwest.

burningman comments edit

I caught a brutal cold on my return from Black Rock City, so I haven’t been much in the blogging mood. But I’m starting to feel better (or the glass of Sake is really working its magic) and thought I’d post a quick blurb about the trip.

For those of you who have never heard of Burning Man, the wikipedia has a pretty decent entry on it. For more information, I would also recommend checking out the Burning Man website. For an über geek perspective, check out Chris Sell’s writeup.

To me, Burning Man is a temporary community that comes closer than any other community I have been apart of to embodying inclusion. Radical Inclusion is one of the ten guiding principles of Burning Man. It may sound somewhat utopian, but it works pretty well in the small scale.

First, before I forget as I tend to do, let me post a link to my photos from Burning Man hosted on Flickr. Just seeing for yourself is another great way to learn about it.

The thing that most impressed me about Burning Man my first time was the sheer amount of creativity that seemed to explode across the desert. Again, this year I was not disappointed.

What set my second time apart is that I knew more what to expect. Thus I was more prepared to be involved in the festivities. Burning Man blurs the line between participant and audience. There isn’t a sense of “Oh THEY are performers and we are the audience.” Oh no no. Everyone is a mix of both.

Black Rock City Jail

To that end I enjoyed diving into the scene with a costume here and there such as this Black Rock City Jail jumpsuit. It was perfect for the Orange party, with its squadron of orange nazis who only allowed those fully in orange to enter.

Hang Loose

For our annual luau, I made sure to bring my aloha shirt. Somehow I had inadverdently made orange a bit of a theme for me this year. I would have taken even more photos but my camera choked on some playa dust and stopped working. That sucked.

I won’t go into much detail about Burning Man this year, but I will mention that one of the more memorable highlights were seeing such big name DJs as Paul Oakenfold and Tiësto perform. True to Burning Man spirit, they performed for free and paid their own way to the event. Tiësto even made a donation to the hosting camp as they were in depth from all their efforts to put on such a good show. You have to realize these guys regularly command somewhere in the $30K to $40K range for a two hour set at a normal club.

Trike Closeup

Among other highlights was the fact that this was my buddy Kyle’s first time. I’m pretty sure he had a good time. It is late and I leave you with a pic of the trike that our buddy Dane built. That’s me in the front pedalling these lazy fools around.

comments edit

I arrived back in Los Angeles last night from Burning Man where I spent the week in utter ignorance of the true scale of Hurricane Katrina. Only today have I started to grasp the immense scale of the destruction.

Normally, I am a very dispassionate reader of the news, but maybe having been in a place that practices radical inclusion and community, I feel a deeper connection to my fellow humans. As I read the paper today, choked up with emotion a few times. The photos and accounts were gut wrenching. At the same time, I also grew deeply angry, as many others have.

It boggles the mind why it must take such a devastating catastrophe before action is taken. My gut reaction is to pillory the administration, but I’ll leave that to the pundits. Actions speak louder than rants and do a much better job of making one feel better.

Recently, we’ve been trying to sell our HDTV on CraigsList. My wife had the great idea to donate the proceeds to the Red Cross after being moved by news accounts of what was going on in New Orleans. She mentioned such and the TV was snapped up immediately by a woman who used to live in the Big Easy.

Now I am looking around wondering if there is more junk around here we can sell and donate the proceeds to the Red Cross or Habitat for Humanity

If you feel you don’t have money you can afford to donate, consider selling that piece of junk laying around in your closet gathering dust. You don’t need it anyways and a little bit of cash is helpful.

If you are looking for other ways to help, check out the Katrina relief homepage on Craigs List.

personal comments edit

My former coworker who wrote that 2600 article I mentioned recently sent me this link to a GameSpot review of SkillJam Arcade.

This is the last project the both of us worked on while at SkillJam. We essentially developed all the back-end support and integration into the existing tournament engine for the mobile version of the games. It is quite satisfying to see our work reviewed in a major online publication. Most of the work I have done in the past wasn’t geared toward the consumer market and thus wouldn’t be featured by any reviews.

comments edit

Remember that online games are written by humans and thus are subject to the bugs and flaws that humans are so good at introducing.

This was made quite evident by an article for the current issue of 2600: The Hacker Quarterly that a former coworker of mine wrote. It’s an interesting read and I encourage you to check it out, though it is only in print on dead trees.

In this article he describes a flaw that became apparent to him within a newly released BlackJack game on the Paradise Poker website. In BlackJack, when the dealer is showing an ace, the dealer offers the players the option to purchase insurance. This is a way for the players to pay to cut their losses should the dealer have ten (10, Jack, Queen, or King) in the hole.

On this particular online game, he noticed that when the dealer did have a pocket ten, there would be a noticeable pause before he was prompted with the Insurance request. When there wasn’t a pocket ten, the prompt appeared immediately.

After doing some quick calculations, he realized this bit of information gave him an edge over the house. He ended up playing the next seven hours exploiting this bug and made a nice chunk of change during that time.

Obviously I don’t know what caused the flaw in the game, but my guess is that there was some calculation the system needed to make to determine whether or not to offer insurance. That calculation may have taken more time to perform in the situation the dealer had a ten.

Let’s pretend I am right (not a huge stretch as I am always right) and think about that for a sec. The code itself may have been completely correct in the sense that it did what it was supposed to do. It was the amount of time the code needed to execute that ended up being the tell. No different than when a poker player twitches when holding a great hand.

The fix may have been to change the execution profile of the code so that it made the same pause no matter what was in the hole. Talk about a challenge for game developers. Not only does the code need to be bug free in syntax and semantics, but they now need to worry about the execution profile for their games.

Who knows if there are several other timing flaws like this in other games. It didn’t even require my friend to hack into anything. He simply observed the timing disparity. Now imagine if he was running a timing program specifically designed to look for other timing flaws. Something that would notice discrepancies down to the millisecond.

comments edit


If you’re heading off to Burning Man this year and want to swing by and say hi (and have a drink), we’re staying in Hysteria (the outermost ring) between 8:00 and 8:30. Our camp will be clearly marked with these camp identifiers.

Today I’m in San Jose staying with my friend Kyle ready to get a bit of work done. Tomorrow bright and early we’re heading off to the BRC.