How The Game Is Played

http://blogs.sun.com/gameguy/date/20050422 Friday April 22, 2005

The Beauty of Failure

Failure is a beautiful thing.

Failure is something to be proud of.

Those may sound like odd sentiments but someone today asked me “what one sentence of advice would you give Jonathan.” I knew instantly that my answer was “tell your execs they need to fail more.”

Why? Because an honest failure means you tried something. You made a decision, maybe before you had all the information, and acted on it. And as my parents taught me, that's a good thing. As a child I was rewarded for trying my best, regardless of the outcome. That instilled in me a self-confidence and ability to act that is an incredible advantage over those who don't have it.

Decision makers some-times lose, but the indecisive never win. There are all sorts of examples of how being willing to fail has led to success in this world. The Fuller Bursh company used to send their salespeople out with a score card. Every time they got a no, they were to tick a box off. They knew that statistically their salesmen would get 9 no's for every yes. By having them track the no's and think of them as "one more step to a yes" they made it okay to fail. And the result was a highly effective salesforce.

I attended a talk by the egineers who started Atari a few months back. The thing they listed as the single most important thing about Atari was that it was a place where it was okay to fail. And they had some spectacular failures. Anyone remember the Atari Music System? I thought not, it was a color organ you hooekd up to your TV. It was their product immediately after Pong and, as they say, they think they sold about 5. But that was okay, and it being okay was the magic of Atari and why Pong and the Atari2600 had a chance to go down in history.

The indursty I came from, the game industry, is all about spectacular risk taking. A modern single player video game takes upwards of 10 million dollars to produce. All of it is spent based on a hunch that what you are putting together is something that the public will eagerly accept. There are no formulas or rules, every rule anyone comes up with in entertainment is quickly proved wrong. About the only rule is that blockbusters are always unique, original, risky projects. But people do get rich in that industry, and thsoe who don't get rich, still get by despite failures and set-backs. But noone who is allergic to risk survives very long at all.

I said in a previous blog that Sun has the soul of a start-up, and I believe that, but indecision kills start-ups. We don't have the resources of an IBM or a Microsoft, we are not the T-Rex that can arrive at the party late and simply crush those already at the table. We are the little carrion dinosaur who can be crushed if we don't get in, grab our piece, and get out.

So what would I tell Jonathan. I'd tell him “tell your execs they have to be braver. Tell them they will get slapped far harder for missing an opportunity then for trying and failing and that they will get slapped hardest for playing conservative and under-committing to those decisions. Tell them to chose their horses and then ride them for all they are worth. But when the horse breaks its leg, shoot it dead and go look for another promising one."

In other words, tell them its okay to fail if you've given it your best shot.

Thats the most valuable thing my parents ever told me.

Happy Birthday to Duke!

Tomorrow is the 10th anniversary of Java and I started looking back a bit at my own Java history.

I began at sun almost 6 years ago as the first full-time hire on the JDK Performance Tuning Team. Steve Wilson was my manager. But he wasn't my very first manager. In a typical Sun story, Steve was a contractor working for a guy named Dave (Sorry Dave I forgot your last name. I'm awful at names.) The week I was hired, Dave decided to leave. Steve interviewed and recommended me, and then a week later I recommended him as my replacement boss.

I think having the chance to effectively hire my own manager was a good introduction to Sun culture. In my 6 years at this place I've found it to be usually egalitarian, often surprising, and sometimes just a bit bizarre... but in a good way.

I am still VERY proud of the work we did on JDK1.3. JDK1.2 was a milestone as the first Java2 but it was a WHOLE lot of new code and there were some performance issues and bottlenecks that we, along with our volunteers from the JDK API teams (and there were more of them then us) worked out and got rid of in 1.3

Honestly, most of the heavy lifting was done by the API teams, our biggest contribution was creating processes for measuring performance daily and reporting problems and regressions immediately so they could be killed before they escaped.

The OTHER part of that job, and one that I loved, was Java performance programming evangelism and education. Through talks with some key Java customers of Sun's Steve and I quickly learned that half the performance problems out there were just programmer ignorance.

Through speeches at JavaOne, user's groups and SHARE meetings, as well as the book Steve and I eventually co-wrote (http://java.sun.com/docs/books/performance) , I had the joy of helping to re-educate a lot of Java programmers. We taught them the simple mistakes they could avoid, as well as how to profile and tune code. That book is still one of my prouder achievements at Sun. There is nothing better then to have a programmer you've never seen before come bounding up to you and say with a big grin, "I bought your book and it solved our performance problems!" There is a joy of pride in that that I am not ashamed to say I absolutely love!

I can't talk about teaching people to profile and tune their code without tipping my hat to the Java VM team. One of many brilliant things the VM guys have done over the years, was to develop a solid profiler interface early in Java's life-- JVMPI. This has made it one of the easiest environments I have worked in to analyze for performance bottlenecks and definitely helped us in helping Java shed its myth of slowness.

Be that as it may, its surprising how long those myths persisted. I guess a first impression is just as hard for a language to shed as it is for a person to shed. I would say it is only in the last year or two that I have finally stopped having to correct people's mis-perceptions of Java speed. I really believe a large part of Javafinally losing the label of slowness has been due to the work I have done with Chris Melissinos since leaving the performance team . Together for more then 3 years now, we have been encouraging Java game developers and getting their work showcased. When I left Steve's group I said to him, "Steve, when I can show Quake running in Java at the same speed as C, no ones ever going to call us slow again."

At least on the desktop, I think we are finally there.

I can't leave this subject though without mentioning the Sun Hotspot VM team one last time, and our counter-part to Steve's JDK group, the Hotspot VM performance team.

These guys are amazing. Consider this: They have less then 10% of the man-power IBM has committed to Java VM development. Nonetheless they make a VM that is at least IBMs equal and I think in a number of ways its superior. They give me amazing power to work with and for that I am eternally greatful.

My latest gift from them came when I was writing the Megacorps demo for GDC. This snuck in so silently that I don't know if anyone else has even noticed. The Megacorps port was a crash 3 week project. I had to write a whole fake networking layer to clue their code to my back-end and frankly didn't have time to write carefully optimized code. In particular I ended up having to allocate a LOT of short lived objects and copies of data. Breaking the rules I had preached to others about watching allocation of garbage in tight loops, I was scared to death I was introducing gc pauses.

When I finally ran it... it ran flawlessly. Sometime between the last time I tried this and now, the VM guys have gotten short-lived object allocation to where they always said they could-- its invisible!

So going into the parties and festivities tomorrow, there are a great many people who have worked very very hard on Java. And they all deserve praise and attention... but I'm going to be drinking to Sun's VM teams.

The finest in the world.