Scott Hanselman

Cargo-cult programming

March 04, 2004 Comment on this post [2] Posted in XML | Web Services | Movies | Africa | Bugs
Sponsored By

Some great reminders to folks about cargo-cult programming by Eric Lippert.  This concept was taught to me in college, I think in a CST115 class.   Boy is it the truth.   Sometimes programmers try to make excuses for not understanding the how - "I don't need to understand SOAP, I'm not a plumber."  Well, I'm not a professional plumber either, but I do own a copy of the Consumer Reports "How to fix anything in your house."  Does that make me a plumber?  Hardly.  Just a guy who knows that water flows through pipes.  If not, I'm just an amazed townie who thanks the magical water gods when I get hot and cold running water upstairs. 

During the Second World War, the Americans set up airstrips on various tiny islands in the Pacific.  After the war was over and the Americans went home, the natives did a perfectly sensible thing -- they dressed themselves up as ground traffic controllers and waved those sticks around.  They mistook cause and effect -- they assumed that the guys waving the sticks were the ones making the planes full of supplies appear, and that if only they could get it right, they could pull the same trick.  From our perspective, we know that it's the other way around -- the guys with the sticks are there because the planes need them to land.  No planes, no guys. 

The cargo cultists had the unimportant surface elements right, but did not see enough of the whole picture to succeed. They understood the form but not the content.  There are lots of cargo cult programmers -- programmers who understand what the code does, but not how it does it.  Therefore, they cannot make meaningful changes to the program.  They tend to proceed by making random changes, testing, and changing again until they manage to come up with something that works. 

Read the three-part (and counting) series here: Part 1 Part 2 Part 3  [Brain.Save()]

All this talk about cargo-cults and Mort/Elvis/Einstein reminds me of the Programming by Coincidence stories.

Do you ever watch old black-and-white war movies? The weary soldier advances cautiously out of the brush. There's a clearing ahead: are there any land mines, or is it safe to cross? There aren't any indications that it's a minefield---no signs, barbed wire, or craters. The soldier pokes the ground ahead of him with his bayonet and winces, expecting an explosion. There isn't one. So he proceeds painstakingly through the field for a while, prodding and poking as he goes. Eventually, convinced that the field is safe, he straightens up and marches proudly forward, only to be blown to pieces.

The soldier's initial probes for mines revealed nothing, but this was merely lucky. He was led to a false conclusion---with disastrous results. [The Pragmatic Programmers]

Being a Mort or an Einstein isn't about VB.NET vs. C#.  It isn't even about VB6 programmers without CS degrees.  It's about caring how code works.  Not just for caring's sake (although it helps) but because it makes you a better, more well rounded, and ultimately effective programmer.  So, here's MY cargo-cult-programming-by-coincidence story:

My sister in law immigrated here from Zimbabwe.  She's a teacher, in her thirties, but had never driven.  So, we took the Prius over to the parking lot and practiced for days.  We finally got to parallel parking, and she just wasn't getting it.  It just didn't make sense to her.  So I said, "imagine how the front tires turn left and right when you turn the steering wheel." 

"The front?" she said.  "What difference does it make?"  Turns out she didn't realize that the front tires were the ones that turned.  She'd imagined ALL FOUR tires turning left and right when the car turns.  I insisted that, no, on cars, it's just the front wheels that turn.  She didn't believe me until she got OUT of the car, and watched me parallel park.  She was utterly amazed that the back tires stayed straight and followed the front ones. 

"You didn't know this?" I asked.  She said "I never gave it any thought.  I assumed they all turned, and never asked the question again." 

Certainly this assumption became a problem when trying to 'debug' the process of parallel parking. 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

DevDays 2004, Portland, OR Reminder

March 03, 2004 Comment on this post [0] Posted in Speaking
Sponsored By

A reminder, I'm speaking at DevDays Portland this year, doing the 4th Web session, "Developing Secure Web Applications - Examining an End-To-End, Hack-Resilient Application"

I'll be taking apart Microsoft's OpenHack application.  Should be a blast, please do check it out, it's a fantastic value at only $99.  It's a security focused agenda this year, which is a refreshing change.  All of the DevDays talks across the country are including more 3rd party speakers, and Portland is no different.  We've got a star-studded (well, neither studs nor stars, but still) line up. 

If you're in Portland, bring your development team.  I'll hang out and chat with y'all 'til it's dark!

 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Clemens got Slashdotted, site not quite holding up?

March 02, 2004 Comment on this post [3] Posted in ASP.NET | DasBlog
Sponsored By

Looks like Clemens got slashdotted.  Funny, I submitted the link to his letter, and was rejected.  I wonder how many people did the same before Hemos submitted it himself. 

Looks like Clemens site isn't holding up as well as mine did.  I'm getting timeouts from his ISA server:

10061 - Connection refused
Internet Security and Acceleration Server

I can't tell if dasBlog having trouble under the load, or if it's just a bandwidth/hardware thing.  I run my site at ORCSWeb (highly recommended) and I didn't even notice the slashdotting from a performance point of view.   I think that dasBlog scales just fine for 99% of folks needs. 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

My next big purchase...

March 02, 2004 Comment on this post [5] Posted in Programming
Sponsored By

Oh yes...when will my tax refund come...I must have the QuadDisplay from Tiger.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

What to think about before getting your eyes lasered (LASIK)

March 01, 2004 Comment on this post [4] Posted in Musings
Sponsored By

I've received a bunch of emails congratulating me on getting my eyes lasered.  I've also got a lot asking questions about the results and my philosophy around the process.  This post was actually going to go out as the 4th email response, but here is it as a post instead.

Yep, I was a -9.25, that's like 20/1600.  Now (3 weeks later) I'm actually "officially" 20/20 in both eyes, but IMHO the right has some glare at night.  I'd say I'd like to be 20/10 or 20/15, but it's never effortless, is it? I'll let you know how it settles in a few months.  :) 

I will say, it's CRYSTAL CLEAR in the day time, but at night there are some "Comet Tails" on things like LEDs and there are areas of extra high contrast, like looking at a TV in the pitch black.  I have been researching this for years. Make sure to have a WaveFront 3d Topology on your eyes, and that the guy who does the surgery has done at least 10,000.  My guy has done 21,000 and had 7 problems.  If they won't get stats, don't bother with them, IMHO.

I'd totally do it again, but I'll give you these warnings:

  • ASSUME you will need a 2nd surgery to get it perfect. Just assume that.  If you don't, good for you, but best to expect the worst.
  • Know that your eyes will LITERALLY change from day to day, and sometimes from hour to hour as they heal.
  • TAKE the percoset after the surgery, from 3 hours to 6 hours afterwards you will experience a great deal of pain like hot sand in your eyes.  Best if you sleep through it and miss the whole thing.
  • ASSUME you will need to wear glasses for reading and driving.  (see above ;) )  
  • ASSUME you will get to 20/40, where you can go to the mall and walk around, but might not be able to read subtitles at a foreign film.  (same reason)
  • YOU WILL have visual artifacts around lights at night and in low light situations, small auras and comets.  I can still drive at night, but sometimes it's irritating.
  • It takes 6 months to REALLY know how your eyes will end up. 
  • When you are > 40, you WILL need reading glasses.  LASIK has zero to do with presbyopia.
  • If you are hyper-detail oriented and you'd regret it if you didn't see 100% perfectly, don't bother.

Overall, I'm very happy with the results, and it was $3K (total) worth spending.  Plus, I'm going to deduct the whole thing.  If you do happen to go to my guy to get your eyes lasered, be sure to tell them I sent you.

The other thing that's interesting, is that while everyone says that you'll wake up and revel in the fact you can see the alarm clock, that hasn't struck me as interesting.  What's REALLY amazing is being able to see the shower drain and your feet.  20 years of glasses and I've never actually seen water go down the shower drain.  After my first shower with new eyes I had to clean the bathroom. 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.