Monday, February 02, 2009

Jeff and Joel Say Quality Really Doesn't Matter That Much. Uncle Bob Disagrees

Joel Spolsky has a transcript of part of a podcast with Jeff Atwood where they say various odd things about software development, including:

  • "And I find, sadly, to be completely honest with everybody listening, quality really doesn't matter that much, in the big scheme of things."
  • Robert C. Martin's SOLID principles sound like "extremely bureaucratic programming that came from the mind of somebody that has not written a lot of code, frankly."
  • And, "The longer I think about this, the less I care about code hygiene issues."

Robert C. "Uncle Bob" Martin gives them a much-deserved ass-reaming in his response.

Friday, January 09, 2009

Debugging Deadlocks in SQL Server Sucks Less These Days

I'm debugging deadlocks in SQL Server 2005. I hate debugging deadlocks.

The good news is that debugging deadlocks in SQL Server 2005 sucks a lot less than it did in SQL Server 2000.

Bart Duncan expresses the difference well:

Turn on trace flag 1222 with "DBCC TRACEON (1222, -1)" or by adding "-T1222" as a SQL startup parameter. This trace flag is a new trace flag in SQL 2005, a much improved version of the tried-and-true -T1204. If you’re running SQL 2005, you should be using 1222 instead of 1204 unless you have deep-seated masochistic tendencies. Alternatives to 1222:
  • If you are using SQL 2000 or SQL 7.0, you’ll have no choice but to fall back on the older -T1204.
  • There’s a "Deadlock graph" Profiler trace event that provides the same info as -T1222. Feel free to use this instead of -T1222 if you’re on SQL 2005. But don’t waste your time with the "Lock:Deadlock" and "Lock:Deadlock Chain" trace events that are in SQL 2000, as they provide an unacceptably incomplete picture of the deadlock.

Hooray!

That quote is taken from the first part in an excellent three-part series on debugging deadlocks in SQL Server 2005:

Also, there's Basic SQL Server Deadlock Debugging over on Tog's Blom.

I also like the Troubleshooting Deadlocking section in Inside Microsoft SQL Server 2005: Query Tuning and Optimization by Kalen Delaney.

Wednesday, May 14, 2008

JavaScript: The Return [no LineTerminator here] Statement

I was just reading JavaScript: The Good Parts by Douglas Crockford, and came across this statement:

I always use the K&R style, putting the { at the end of a line instead of the front, because it avoids a horrible design blunder in JavaScript's return statement.

A while back, I was introduced to using closure to help get rid of unnecessary global variables in JavaScript by a friend at work, along with the book Pro JavaScript Design Patterns. Instead of something like this:

var myString = 'hi';

function doStuff() {
    alert(myString);
}

You write something like this:

var myNamespace = function() {
    var myString = 'hi';

    return {
        doStuff: function() {
            alert(myString);
        }
    }
}();

But, because I like BSD style, I did this, with line breaks before the opening braces:

var myNamespace = function() 
{
    var myString = 'hi';

    return 
    {
        doStuff: function() 
        {
            alert(myString);
        }
    }
}();

When I tried to call doStuff, I promptly got the JavaScript error "myNamespace is null or not an object."

After much head-scratching and debugging, I learned the hard way that ECMAScript defines the return statement like this:

return [no LineTerminator here] Expressionopt ;

Let me put that a slightly different way:

return [!!!NO LINE_TERMINATOR HERE!!!] Expressionopt ;

And that's the story of how I became a convert to using K&R style when coding JavaScript.

Wednesday, April 23, 2008

Avoid Resharper 4.0 Nightly Build 775

If you're trying the Resharper 4 beta nightly builds, I just thought I'd warn that I had trouble with build 775 from 11 Apr 2008, which is currently the newest build marked "Works here". When I installed it, the Resharper items, such as "Find Usages", were disabled in the context menu. I found the issue discussed in the Jetbrains forums, and they said they fixed it in a later build.

Now, I'm using build 780 from 18 Apr 2008, and it's working well for me so far.

Tuesday, January 22, 2008

Amazon Kindle Email Support Does Not Suck

In all fairness to Amazon, I need to explain what happened after my last post.

The bf contacted customer service by e-mail again, and explained his long wait on the phone.

Amazon apologised, and sent a new battery to try.

That didn't fix things, and we let Amazon know by e-mail.

They sent us a new Kindle, and explained we had 30 days from receiving it to return the malfunctioning one.

We received the new one. It works great. We'll be sending the old one back.

And everyone lived happily ever after.

Sunday, December 30, 2007

Amazon Kindle Phone Customer Support Sucks

My bf bought a Kindle. My opinion is that it's a very nice e-book reader. There are a lot of reviews out there that think it should be prettier or flashier or do more.

But they are wrong. It's an e-book reader. And it does that job very nicely.

As long as it's working.

Our Kindle seems to be having some issues with the battery—just flat-out really bad battery life, even with the wireless off. Some people have speculated this is because the device is draining too much power when the screensaver is on, and that things work better if you turn it off between reading sessions.

Okay, fine. But rather disappointing from a device you just paid $400 for.

Our Kindle has another issue, though, where if you leave it in the screensaver and not plugged into an outlet, it often won't wake up from the screensaver. Getting it back to life involves various resets, battery-poppings, and always needing to get it plugged back into an outlet.

And it's not that the battery is dead. When it wakes back up, it shows the battery as having plenty power left.

This rendered it unusable for the bf to take on his trans-Atlantic flight to see his family for Christmas.

That's not acceptable from a device you just paid $400 for.

The bf contacted customer service by e-mail. They said that from his description, they couldn't tell if the problem was in the Kindle itself, or just in the battery, and he needed to contact them by phone. Fair enough.

When he got back to the States, we did that.

For Kindle customer support, Amazon has a system where you enter your details into their online support site, and then support calls you at the phone number you provide—you can choose immediately, or in a few minutes. We chose immediately, and indeed were immediately called.

Only to be put on hold until a support representative was available to take our call.

I expected this. I understand this is how customer phone support works. You usually have to wait a while. But you know, if your business has a system sophisticated enough to have support call the customer back like that, they could actually make it so that support only calls when they have someone free to handle the call.

It's just a thought.

The bf and I passed the phone back and forth, waiting for a human. (Our speaker-phone died a terrible death a while back.)

Every few minutes, a pre-recorded voice broke through the music, saying the things those pre-recorded voices usually do, including that someone would take our call within a few minutes.

We passed the phone back-and-forth like this, waiting and waiting.

FOR THREE HOURS.

THEN THE SUPPORT SYSTEM HUNG UP ON US.

Furthermore, we are not the only people this has happened to. In the Kindle discussion forums on Amazon, at least one other customer said something similar had happened to them.

Amazon, I know you're a big enough company that you don't care how one customer feels, or even a few.

BUT RIGHT NOW, I'M REALLY PISSED OFF AT YOU.

The bf and I are still deciding if we will try getting through to the Kindle phone customer support again, or just send the thing back. (We're still within our 30-day return window.)

Right now, we're favoring the latter.

Friday, December 21, 2007

Customers Do So Care What Your Code Looks Like, They Just Don't Know It

Over at Coding Horror, Jeff Atwood claims "Users couldn't care less whether the underlying code is pretty."

Baloney.

The article sparked lots of responses noting that customers do care, because ugly code is often hard to maintain, and code that is hard to maintain often leads to more bugs, as well as to longer implementation times both for bug fixes and for the new features that keep you ahead of your competition.

But yes, in a short-sighted way, Jeff is right. Customers often don't appear to care about quality until something bad happens.

  • They don't care about the bad quality of cheap toys from China, until they find out they are hazardous to their children's health because the toys contain too much lead.
  • They are so enamored with the bling of their SUVs that they don't think about quality until news headlines start shouting about rollovers.
  • And, they don't care about ugly, unmaintainable code until your product has a showstopper bug and it takes you forever to fix it, because you can't figure out how to. Or, until a competitor has a feature that your customers are dying for, but that it takes you forever to match, because you can't figure out how to integrate it into your ugly codebase.

Whoops! It turns out that customers care about quality after all.

So yes, customers do care, it's just that they are so dazzled by promises of features and the potential for bargains that sometimes they forget—until something bad happens.

As always—and I think this may really be part of Jeff's point anyway—there has to be balance. Take the time to write maintainable, quality code so you don't end up in the "whoops!" situation. But on the other hand, don't stare at your code editor, re-refactoring for hours on end just to write a masterpiece.

Saturday, December 15, 2007

Gutsy Gibbon on My ThinkPad T61

Recently, I bought a new ThinkPad. Much to the chagrin of the bf, I didn't start using it right away. It sat on a pile of boxes while I planned my attack.

See, I wanted to reinstall Windows—to get rid of crapplets—before I filled the disk full of stuff.

And, I wanted to set up the machine to dual-boot Ubuntu.

I wasn't entirely successful with the clean XP install. I mostly followed the guides listed below. But I must have done something wrong, because after my install, Windows would only start in safe mode. And when I looked at the install log, it was complaining about several crucial DLLs not being right. (I no longer have the error messages, because I cleared them out, or I'd list them here for posterity.)

But then I remembered that the bf and I had actually bought an OEM XP CD to install under Parallels on his MacBook. Oh yes, I could use that!

So I did, and everything was happy.

Once past that hurdle, I followed the article My Ubuntu Installation on Thinkpad R60: Dual boot with WinXP to set up the dual-boot.

It only took me 3 tries.

The first time, I managed to download a bad Ubuntu installer image. The lesson learned there was that before burning a CD and trying to use it to install an operating system, you should check the MD5.

The second time, I missed that it didn't keep all the attributes about what I wanted to do with my partitions from the first time. The partitions (obviously) were still there, but I missed that I needed to re-fill-out some of the details about how Linux should use them.

The third time, it worked like a charm!

Now, let me tell you, Linux has come a !!!LONG!!! way since the last time I looked at it—which was something like SUSE 7.1.

Quite a lot of things really did work, right out of the box.

I followed the guide Installing Ubuntu 7.10 (Gutsy Gibbon) on a ThinkPad T61 at ThinkWiki—very helpful.

I had a few travails—which if I'm feeling motivated, I'll post about later—but I'm amazed at how many things are working:

  • Wireless networking
  • Printing to an IPP HP LaserJet printer on the network
  • VPNing into work and remote desktopping into my work computer
  • Suspending (well sometimes anyway)
  • Automounting network shares

I want to give a big shout-out and "Thank You!" to everyone in the Linux, Ubuntu, and ThinkPad community who helped make this possible. It's beautiful.

And I even let myself order the Tux Babydoll T-Shirt from ThinkGeek in celebration.

Cheers!

Sunday, April 01, 2007

Physical World Hyperlinks

You know the feeling when you read about something, and think, "That's cool. I want to be a part of that."?

I just read the New York Times article about physical world hyperlinks.

I want it, now. I want to build it, now.

Ooh, and I just found semacode.org.

Tuesday, December 05, 2006

Please UnSuggest Some Of My Favorite Books To Me

I saw the story about UnSuggester on Slashdot. Obviously, since I love books and LibraryThing, I couldn't wait to give it a try.

When I typed in my favorite novel, Jane Eyre, the first two items UnSuggester unsuggested were Fowler's Patters Of Enterprise Architecture and Freeman & Freeman's Head First Design Patterns—two of my best-rated tech books that I have on my bookshelf.

lol.