Whatsa matter buddy? Yous gotta problem with Javascript?

After more than 10 years as a professional software developer I have decided that you can write good code in any language…or bad code.

I’ve seen great assembly language, bad Java, scintillating Visual Basic, poor Python, ludicrous lisp, crisp Hypertalk, and even some very good Javascript.

David Chelimsky asks What’s the Problem with Javascript and all I can do is nod my head and state “I concur”.

Javascript allows you to create classes, subclasses, and even has studly regular expression support that would make a Perl user feel right at home.

Many languages suffer from what can only be considered “the AOL” effect. When AOL really took off, (slightly) longer time internet users considered AOL users to be worthless. Some of it was that they didn’t understand [http://www.dtcc.edu/cs/rfc1855.html netiquette], but it was also that their entry onto the internet was considered too easy. They weren’t smart enough, or technical enough, or elite enough to count like ”’real”’ internet users.

Programming languages are the same way. Lisp and C++ users regularly look down on programmers using almost any other programming language because the barrier of entry to Lisp and C++ is high. Mastering difficult languages, and anything else with a high barrier of entry, should result in feelings of pride, but they also often result in feeling of superiority over others.

When I started doing web development, I felt the same way about Javascript. I had mastered C++, Lisp, and many other languages. Perhaps I would do a little client side validation in Javascript, but certainly nothing more.

It turns out Javascript is a pretty nice language. It has a fairly modern runtime: easy, built-in arrays and mapping types, garbage collection, a well designed library, and the ability to manipulate almost anything in a client browser. With a little more study I discovered that the prototype based object system was very handy for developing classes and subclasses and the syntax for doing so was only slightly more awkward than Smalltalk, Java, or C#.

These days I am asked to, and am willing, to write code in many languages I once thought beneath me.

Today if someone were to say about me “Writes good code regardless of language.” I would proud.

Any developer worth hiring should be.

A Moral for the Madagascar DVD

Being a parent forces me look for the message behind a movie. Pixar movies consistently support themes of friendship, family, and individuality while DreamWorks movies like Shrek 2 have disappointed with decidedly weak messages further compromised by sexual innuendo (do we really need Pinocchio to talk about a thong?).

So it was with some uneasiness that my family went to see Madagascar at the local theatre last year. By the time the final credits rolled I was relieved by not having to field any “thong” questions, but I wasn’t impressed. Despite looking I couldn’t really find any strong message, good or bad.

Fast forward to Christmas 2005. As part of the Christmas festivities at the Morehead household, my children were gifted with a copy of the Madagascar DVD which has now been watched, listened to (while I drove the car), imitated, and repeated more times that I care to try to explain.

After repeated viewings I can now say:

  • The movie is more enjoyable that I originally thought, even after repeated viewings.
  • I like the penguins — probably a little too much (I only realized this as I blurted out that they “Aren’t creepy!” at an extended family gathering).
  • Baron Cohen’s (better know for the Ali G television show) performance as King Julian the Lemur probably saves the movie from mediocrity.
  • Even though it is hard to find, it has a moral after all, and it is a good one.

So what is the moral? To fully appreciate it, I have to recommend the Christian book Wild at Heart: Discovering the Secret of a Man’s Soul by John Eldredge. Wild at Heart‘s thesis is that the two extreme’s are often seen in men’s behavior: the ‘nice guy’ and the ‘macho man’. Neither extreme is healthy; instead Mr. Eldredge proposes “authentic masculinity”, big words that are better summed up as “good dangerous”. Being “good dangerous” is not being macho or wimpy, but having a solid passionate core that is willing to take risks for that which is truly meaningful. This is what the title calls “Wild at Heart”.

And “Wild at Heart” would also be a fitting subtitle for Madagascar. At the beginning of the movie Alex the Lion looks macho to the citizens of New York, but he is really living a shallow, passive, actor’s existence being careful to “never bite the hand that feeds you.” Once thrown into the wild, Alex must confront his fundamental carnivorous nature. This confrontation jolts Alex from passivity into the opposite extreme of being overwhelmed by his appetite. The climax of the movie is when Alex harness his wildness by being “good dangerous”; feared and respected by his enemies, but loving toward his friends.

This is a message I support. All men, young and old, need both the passion and the discipline to be “good dangerous”.

I only wish the message were told more clearly.

Work Recognition

Right before I left my old job, I got an award for being an “outstanding contributor” in our engineering group. To be honest it felt good to be given an award, and even better it comes with an iPod, an iTunes gift certificate, and a plaque.

You can tell a non-technical person wrote the award letter though, because it didn’t say what kind of an iPod it was. That is like telling a wine enthusiast they will be getting a bottle of “red wine”.

In any event, I was very surprised, and pleased, and yet it immediately brought to mind the times in the past I had not won similar awards. Not that I expected to, but I can always dream can’t I? Part of the reason I left soon after was that they were putting in a new “incentive” system which requires that the vast majority of workers will be told they are average and be awarded accordingly — how is this an incentive system?

As usual [http://www.joelonsoftware.com/articles/fog0000000070.html Joel on Software has a bead on this issue].

Somehow I think that management is caught up in the idea that managing software developers is just like managing a sports team; that the pursuit of excellence is all about “winning the big one”. Maybe there is something about winning it all, but that isn’t how players or teams become great.

Players and teams become great because they love playing the game. They love the feeling of a performing well, or making a great play, or maybe even just tackling someone.

You can read what makes players tick in the old [http://www.findarticles.com/p/articles/mi_m1208/is_35_225/ai_77811426 Sporting News article] from 2001.

To me hockey players are the ultimate love of the game group:

“Growing up we always played baseball, football and basketball. One day, the guys said we should try hockey. Wow! What a blast! You had the hand-to-eye coordination of baseball, the hitting of football and the stops-and-starts stamina of basketball. I thought to myself, `Why should I fool around with the other sports when hockey gives me all of the best of the other sports?'”

–Islanders goalle Rick DIPietro

Every year the [http://live82.ihwc.net/english/ IIHF World Championship] is held. Think of it as a mini-Olympics for hockey. The best hockey players play in the IIHF World Championship every year, even during an era when the US Olympic baskball team can’t even attract players who actually are interested in playing.

Even though I stumble around on my recreational league hockey team, I still love it.

And any decent software developer is the same way. They love writing software. Sure, they work at your company because they need the money, but they write great software because they love doing it. Period.

So as far as I am concerned all these corporate incentive plans, plaques, and awards for working weekends and cranking out ugly code can go into the trash can, the recycle bin, or /dev/null.

But I’m not giving back the iPod.

The Truly Ecumenical Pope

As usual Orson Scott Card says something better than I could ever hope in his World Watch column Why I Miss Karol Wojtyla:

John Paul II, more than any other Pope, united, in feeling if not in fact, Christians who take the divine Redeemer seriously. That’s the “ecumenical movement” that means something, in my opinion.

Even though I am not a Mormon or a Catholic, I feel the greatest kindred spirit with those Christians whose faith demands (quoting Orson Scott Card’s column again)

…some real and rational degree of sacrifice, obedience, and adherence to faith…

so to Karol Wojtyla and Orson Scott Card I can only follow with an simple Amen.

Self critique and the surgeon

How the best surgeons realize they make mistakes and try to figure out how to improve is the subject ofa recent article by the always engaging Dave Thomas of Pragmatic Programmers fame.

As a software developer I find that on every project I look back and I am disappointed by some design decision or implementation choice that didn’t turn out as cleanly as I had hoped.

In my current role as a software architect (a title and position I ironically am not a fan of) I worry that it is easy to unravel the feedback loop as more time is spent in meetings, design sessions, and writing emails. Once you start down the path of less hands-on work how do you truly understand the consequences of the design decisions that have been made so you can improve?

Even the most fundamental truths about software development are easy to forget, like that software development is rarely easy, and shouldn’t be. Just seeing the results from a management point of view, which must happen from time to time in order to effectively delegate implementation, the process looks much smoother, like a mountain range at 30,000 feet. But the smoothness is an illusion.

Management uses phrases like “keeping you hand dirty”, but I still think in terms of being a “real software developer” so I can help make better software.

I only want to work with other developers who are constantly trying to improve. The developers that cause me the most grief are those that are content to do things the same way over and over again regardless of the results.

The good news is that most of the excellent team I work with share my passion for improvement. In the past two years we have gone from non-repeatable builds and misuse of source code control to a smooth build process and logical branch management. Recently we have added RSS feeds of both builds and CVS checkins. To top it off we now have lava lamps to keep tabs on build results (as a mature product we have several active branches/supported versions so we need lots of lamps).

Autopilots off, feedback loop closed, self critique ongoing — who’s with me?

Robert Martin hits the nail on the head about craftsmanship

Robert Martin, of XP fame, really hit the nail on the head in this [http://www.butunclebob.com/ArticleS.UncleBob.TheNextBigThing article].

His basic premise is that what the industry needs is more craftsmanship and professionalism, and not another silver bullet to go chasing after.

I may post his last paragraph to my cube wall. Part of it reads:

I hope the next big thing is the growth of professionalism and craftsmanship, and the realization that these are the attributes, not documented process or raw manpower, that will make our industry productive, accurate, and respected.


Late Night Lego Fishing

Ever had a moment when you suddenly realized that what you were doing was absolutely crazy?

It happened innocently enough, my son, during his bath, managed to drop a small lego piece down the bathtub drain and he was really disappointed (that happens often). For some reason after the water had drained, the piece was still visible under the grate (which usually traps slightly larger lego pieces, hair, and other valuables above the grate).

In any event, I started by bending a couple of my daughter’s bobby pins and using them as mini-chopsticks which which I could try and pull the lego out (the holes were too large for actual tweezers). After a few minutes I had to give up and get the kids dressed and off to bed.

Later that night I continued my quest to retrieve the small worthless piece of plastic. Half an hour later I decided the bobby pins weren’t going to work, and I was even having trouble imaging what angle the lego could possibly fit.

Suddenly I had a mental of a lego swirling as water rushes past it and then randomly finding the precise angle that it could pass through the grate. “If only I could do the reverse” I thought.

Then it struck me: the vacuum cleaner could do it reverse.

Five minutes later (at 12:30 AM I might add) I had the bathroom door shut and was turning on and off the vacuum cleaner. It was able to pull the lego piece back up against the grate and I was hopeful that with a few more tries would be enough to have the lego sucked into the empty vacuum cleaner where it could easily be retrieved.

Suddenly, my wife opens the bathroom door and isn’t happy.

“What are you doing?” she asks.

At that moment I was rendered speechless. It started off logically enough, but somehow I had become convinced that running the vacuum cleaner in the middle of the night with my wife sleeping in the next room to retrieve a lego was a good idea.

All I could was apologize and go to bed.

Not my smartest moment.

By the way, I did get the lego piece out the next day. The vacuum cleaner got it half way through the grate and a pair of needle nose pliers finished the job.