• Eric Gunnerson's Compendium

    I'm worried

    I usually don't post on stories that are related to politics, but I'm going to make an exception for this.
  • Eric Gunnerson's Compendium

    We've got blogs...


    A number of new C# bloggers have showed up this week, and I promised I'd give some “props” for all my “homies” before they entered the “blogsphere” and are“assimilated”.(”Word!”)

    (And yes, if you're wondering why they all showed up at once, we decided to incentivize them (a word especially for Joe) to give blogging a try). (What do you think of my new “happening“ style of writing? Is it “money“, or is it “whack“?)

    Please treat them kindly, and give them warm milk and cookies if they appear tired or cranky. Some of them haven't posted yet.

    The following list is in order of number of posts:

  • Eric Gunnerson's Compendium

    Misc Athletic stuff


    Saturday morning, I did a 90 minute ride, and I am happy to say that I have finally gotten used to my new pedals (SPD-SLs), and new shoes (Nike <whatevers>). Very comfortable, and a lot easier to get into and out of than my old normal SPDs. You can even walk on them (a bit) without danger to your bones. The ride was 36 degreees and a bit windy, which takes a bit of planning, but is better than than 30 degrees I rode in over the new year. At the end of February, I'm planning on riding Chilly Hilly, a short but hilly tour of Bainbridge Island. Later this summer, I'm hoping to ride RSVP.

    Sunday I spent skiing with my family, where I had only one comical fall. I say “comical” because I fell at speeds exceeding 2 MPH while trying to skate over to my ski class. The big news of the day is that my 9-year-old daughter skied two *long* runs (1300 vertical each) of somewhat cut up blue, and then at the bottom of one skied a bumped-out black diamond, only falling once when she hit some ice. It's going to be only a couple of years before she can ski better than her parents (who, with all modesty, are starting to be able to ski a bunch of terrain they previously were insufficiently skillled).

  • Eric Gunnerson's Compendium

    Anders Inteview: Generics in C#, Java, and C++

    Part VII of Anders' interview series on artima is up...
  • Eric Gunnerson's Compendium


    You can access the microsoft blogs that are currently on on Mine is at

    The msdn address is probably more likely to persist in the long run, so it's a better choice than the ASP one.

  • Eric Gunnerson's Compendium

    Comparing CLR, Mono, SSCLI and JAVA Performance

    Comparing CLR, Mono, SSCLI and JAVA Performance
  • Eric Gunnerson's Compendium

    Testing the C# Compiler


    How many tests does the C# compiler team have? Take a guess, and then go read Gus' post “Testing the C# Compiler”.

    Gus used to work for me when I was the C# compiler test lead, and he became test lead when I went to the gray side to be a PM (in case you're wondering, marketing is “the dark side“). The quality of the C# compiler is a testament to his team (though I'll take a small amount of credit for setting some initial direction)...



  • Eric Gunnerson's Compendium

    Rocketry and Soccer...


    Early in September, I got a injury on my big toe while playing soccer. Well, it wasn't while playing soccer, it was practicing soccer, but those are really the same thing. Actually, to be honest, it was while coaching soccer, which still requires a fair amount of soccer skills.

    Okay, so I got kicked by a 9 year old, but she was big for her age.

    The result was that I couldn't kick my with my right foot for about a month, which gave me a great chance to improve my off-foot play (which, to be frank, needs a lot of improvement).

    Fast forward to about a week ago, when I found that that toenail had fractured 3/4 of the way across. If I didn't do something, it would rip all the way through, fall off, and I would probably miss at least a day of skiing. What I needed was some way to keep it together until it grew out.

    That night I got thinking about rocket building, and tonight I spent about 10 minutes adding an epoxy reinforcement to the nail.

    I did consider reinforcing it with a bit of fiberglass, but that seemed a little over the top. Perhaps carbon fiber would be a better choice.

  • Eric Gunnerson's Compendium

    Destructors and Finalization revisited


    Most of the commentors on my destructors and finalizers post figured out the reason why we went with the destructor syntax - so that we could ensure that the base class destructor gets called. A few comments on the comments:

    Jeroen Frijters has some comments on what's wrong with C# finalization. It is true that there isn't a guarantee across other languages that the right thing will happen here - this area and the whole Dispose() area are ones where it would have been nice to come up with a cleaner way to support these comments.

    Finally, a comment on choosing the destructor syntax. It is true that we're overloading the destructor syntax to mean something different (to some, subtly different) from what it means in C++. We did the same thing with the “new“ keyword - it means something different in C# than it does in C++.

    I think we made reasonable decisions there. One could choose to make the opposite choice, but that would require you to come up with new keywords, which is a surprisingly hard thing to do (feel free to engage in discussion on what those should be in the comments).

    Another question for the comments. Do you like the “why does C# do this?” format, or would you prefer me just to tell you why we do something?

  • Eric Gunnerson's Compendium

    C# Coding Guidelines


    I've been in a discussion today with one of our customers on good C# coding guidelines/standards, and I confess to not having any good references to give him.

    He was nice enough to send me a link to one that he thought was good, which happens to be by Juval Lowy at iDesign.

    If you have other coding guidelines that you think are good, feel free to add the to the comments, and I'll try to get them up on our C# dev center.

  • Eric Gunnerson's Compendium

    Helmet == Good


    I've put in a ton of miles on my motorcycle, and a fair number on my bicycle, and thankfully, never found myself in a situation where I needed the helmet that I was always wearing.

    Yesterday, however,while skiing quickly (and fairly well, I might add...) down a somewhat chunked up blue (a dark blue, if you care...), I caught an edge, popped off my right ski, pitched forward, and whacked down hard on the back of my head, into a rather hard slope. And then twisted around, and popped off my left ski. Certainly my worst fall of the year so far, but I ended up with a slightly sprained left thumb, and some overstressed neck muscles.

    Helmets are good.

  • Eric Gunnerson's Compendium

    Whither "Ask a Language Designer"?


    Simon wrote:

    “Any chance of the "ask the designers" column starting up again on your MSN community site?”

    The answer to that question is “Yes”, I'm hoping to get something more regular than once a year up there in the near future, but I haven't said anything because we have a bit of a history of overpromising in that area.

    If you have a question that you want answered, please add it in a comment

  • Eric Gunnerson's Compendium

    A Glove Story


    I've been working the past few nights wearing a pair of IronClad gloves. Nice, comfortable, and no problems tossing around 2x4s or sheets of plywood. I can even open a can of my favorite beverage without taking them off (okay, I'll confess, my favorite beverage is STP).


  • Eric Gunnerson's Compendium

    Why destructors and not just Finalize()?


    In one of the comments, Niall said:

    “I am curious as to why the C# syntax for a finalizer is the destructor syntax. It doesn't bother me one way or another, but I am still curious.”

    So I thought I'd devote a bit of time to that question.

    Say I'm writing some code that wraps some sort of resource. Here's the code I might write if C# didn't support the destructor syntax (and the class already has implemented the Dispose design pattern:

    class MyClass: MyBaseClass
        IntPtr myResource;
        ... lots of stuff here...

        protected override void Finalize()

         protected override void Dispose(bool disposing)
            // free myResource here...

    That seems pretty straightforward. What's wrong with the code?

    The answer is the reason that we have a separate syntax. Please post your answer in the comments.

  • Eric Gunnerson's Compendium

    ...unreceptive to change...


    In my “Minus 100 points” article, Shawn took me to task for the reasons why we didn't put 'with' in the language.

    Unreceptive to change is, when I think about it a bit, probably a true statement. We are fairly unreceptive to change - it took a lot of customer feedback to get us to change our stance on accessibility for properties. I don't think that is necessarily a bad thing - I think the best languages were designed either by a single person or by small groups, and I'm not a big fan of languages designed by committee (Ada comes to mind...). The C# Language Design Team is a benevolent dictatorship - we all have our say, but Anders is the overall custodian of the language design. I think that's important if a language is going to stay true to its philosophy.

    On a specific issue, we might appear unreceptive for a number of reasons.

    The first reason is that your request is probably not the first time we have heard such a request. We do take note of them (see property example above), but in most cases we've already spent a considerable amount of design time on the issue (by that I mean hours). In the case of 'with', we looked at what other languages had done, how well the construct worked, and then made the call on whether we thought it would be good to add it. We have a considerable amount of language design experience and familiarity on the team, which means we generally know the prior art fairly well. I'm sorry if this comes of as arrogant at times - we're working at doing a better job of communicating in this area.

    'With' was a very conscious decision, especially because it's present in both Pascal and Delphi, Anders' previous babies (okay, Pascal was really Wirth's baby, but Anders was involved with one of the more popular variants).

    As I said, we might choose to add it in the future, but given the divided nature of the customer feedback that we get, it's likely that we'll stay where we are.


  • Eric Gunnerson's Compendium

    Funny post about google searches

    Rory Blyth posts these thoughts about google searches...
  • Eric Gunnerson's Compendium

    Minus 100 points


    When I switched over the C# compiler team, I had hoped that I would be able to give some insight into how the design team works, what decisions we make, etc. Language design is a very esoteric field, and there's not a lot written about it (though “Design and evolution of C++“ is a pretty good read). I had hoped that I would be able to do this with concrete examples, as that makes it much easier.

    I've been watching for candidate topics to write about, but haven't yet come up with any good ones. One of the problems is that features have a tendency to morph in design (and in whether they'll make it into Whidbey) as time goes by, and it would be bad for me to say, “we're talking about doing<x>“ and then have us decide it wasn't a good idea. Or, for us to decide that <x> doesn't fit into our schedule, or it would break existing code, or any of the other reasons that might cause us to pull a feature. We're generally not comfortable really talking about those things until the feature is in somebody's hands.

    In lieu of such an example, I've decided to write something a bit more abstract about how we look at things.


    I've been spending a lot of time answering customer questions about why we do (or don't) have certain language features in C#. (as an aside, yes, we will be getting more of this online on the C# dev center).

    In some of those questions, the questions asks why we either “took out” or “left out” a specific feature. That wording implies that we started with an existing language (C++ and Java are the popular choices here), and then started removing features until we got to a point where we liked. And, though it may be hard for some to believe, that's not how the language got designed.

    One of the big reasons we didn't do this is that it's really hard to remove complexity when you take a subtractive approach, as removing a feature in one area may not allow you to revisit low-level design decisions, nor will it allow you to remove complexity elsewhere, in places where it support the now-removed feature.

    So, we decided on the additive approach instead, and worked hard to keep the complexity down. One way to do that is through the concept of “minus 100 points”. Every feature starts out in the hole by 100 points, which means that it has to have a significant net positive effect on the overall package for it to make it into the language. Some features are okay features for a language to have, they just aren't quite good enough to make it into the language.

    A feature like expression filters in VB is in this bucket. Yes, being able to put a condition on a catch is somewhat more convenient than having to write the test yourself, but it doesn't really enable you to do anything new.

    Being able to have property accessors with different accessibilities was another example of this. We had some experience with users being able to specify different levels of virtual-ness (virtuality?) on different accessors in an early version of the language, and it was a really confusing feature, so we elected to remove it. We felt similarly about differing accessibilities, and so we left it out of the 2002/2003 versions of the language, but we got *so much* feedback from customers that we re-evaluated the utility of the feature, and decided to add it to the language in the Whidbey version.

    One can argue that we should perhaps have come to that conclusion earlier, but I don't think that being cautious is a bad thing when doing language design. Once you add a feature, it's in the language forever.

    I should also probably note that this isn't the only reason features don't make it into the language. Some features provide enough utility in the abstract, but when we go to come up with a workable design for the feature, we find that we can't come up with a way to make it simple and understandable for the user. That means that in some cases we like a feature in the abstract, but it's not in the language.

    There is also another class - features that we don't want to get near the language. But that would be another post.

  • Eric Gunnerson's Compendium

    New Toys


    For the holidays, I picked up:

    • A Taiyo edge R/C hovercraft. A real-live hovercraft with all the maneuverability and controllability of a real hovercraft (ie not a lot). Lots of fun, but it's really hard to drive. Though the drive fans reverse, if you really need to turn around and thrust in the opposite direction. Downside - the batteries only last about 10 minutes.
    • A “super bowl“ Electric football. Electric, not electronic. I never owned one myself, but some of my friends had them. The current version has updated teams, but still the same old buzzing playfield and the same old somewhat randomized movement (a bit like junior-high football). It will be travelling to work to amuse my co-workers (“wow, that's almost as boring as Pong...“).
    • A Rush in Rio DVD, which I have not yet had time to watch.

    I also bought (for myself) a Zilog Z8 Encore Development Kit. This is either destined for a future holiday light project, a linear motor (I'd like to build a “marble-track“ like display, but I want it to run automatically and I don't want to build a chain-style lift. Or, perhaps something else.




  • Eric Gunnerson's Compendium

    Holiday Letter


    Every year, I attempt to write a humorous holiday letter. Here's the 2003 edition, for your perusal - and with any luck, enjoyment.


    Holiday Letter Reloaded – Gunnerson 2003

    Now with 30% fewer laughs!


    I hope you are well during this holiday season. I had resolved after last year that I would attempt to write something humorous every month (note that I’m not saying that I would write something humorous, merely that I would attempt to), but like most resolutions, I didn’t keep to it, so I’m pretty much starting from scratch, and I’m late.

    Our New Arrival

    On July 15th we welcomed a new 6 pound addition to our family. Now, you can say what you want about pets. Go ahead, I’ll wait. Done? Okay. As I was saying before you interrupted, pets provide a lot of benefits, but you can’t deny that they can make things a bit messy (yes, go ahead and deny it, if you must…). Our two cats (official motto: “eat, sleep, poop, and shed”) certainly bear that out.

    While I’m not looking to replace them, it would be nice to have a pet that provides companionship and entertainment, but is a little lower maintenance. Or – let’s dream a little – perhaps one that actually makes life easier for you.

    Enter Alfred. Alfred is our roomba. Unless you spend your time as inefficiently as I do, you probably don’t know that a roomba is a robotic vacuum cleaner. Set it down, turn it on, and it vacuums a room for you.

    Now, some may think that a robotic vacuum cleaner is not a true pet. They are wrong.

    Top 8 Reasons why Alfred qualifies as a pet:

    1.      It has a name.

    2.      If you leave things out, it messes them up.

    3.      It’s unpredictable. Have you ever sat and watched a cat play with a feather for 15 minutes. That’s nothing – you’ll find yourself following your roomba around, wondering what it’s going to do next. For half an hour.

    4.      It knows when it’s messed up. One day, after it broke a picture that I had stupidly left out (see reason #2), it went into our room and hid under the bed.

    5.      You remember the whole pet rock thing, right?

    6.      You can get college credit for studying them

    7.      You force other people to watch it do tricks. Now, some say that “clean” isn’t much of a trick, but when the other residents of the house can only perform “run away and hide” and “yowl until you feed me”, I say that “clean” starts looking pretty good.

    8.      When it does something cute, you take pictures of it.



    Equine Insanity  (Equinsanity?)

    Loyal readers may remember that last year Samantha took up horseback riding. Kim and I had a long discussion where we came up with some ground rules around Samantha’s interest, including the very important “we will not buy a horse” (craftily phrased as, “You could ride all the poor horses that other people don’t have time to ride?”).  This worked will for several months, until Kim started taking lessons. Now, the house is carpeted with tack catalogs, and dinner conversation revolves around ‘cantering’. This has me more than a bit concerned. Two bits, or perhaps even three bits concerned.

    To be fair, Samantha has started learning some of the things that should one day make her a crackerjack stablehand (ie “somebody who earns her lessons”). She’s starting with the simple things, like getting horses tacked up, brushing them, washing them, but my guess is that in 6 months, she’ll be replacing their shoes and driving them to the vet for checkups. As long as I don’t have to buy a horse trailer.

    Crisis Planning

    As many of you know, next April I will be 40 years old. Though only ¼ of the way towards my planned lifetime of 160 years, it is a major milestone, and the traditional age at which the male of the species has a “mid-life crisis”.

    I don’t want to be unprepared for this, so I’ve decided to take the bull by the horns, avoid the dilemma, and give the horse a drink.  My crisis will “push the envelope” enough to make people doubt my good judgment (perhaps that doesn’t really push the envelope…) while still carrying a reasonable chance that, with a good lawyer, jail time will be minimal.

    It wasn’t easy coming up with something, as doing so clashes with my innate laziness.

    Fate smiled on me, however, in the form of a bonus I got from my job. Not a monetary bonus, nor a fruit basket, nor even a commemorative “thanks for showing up for the last 5 years” clock, but an extra 20 pounds, courtesy of stress and a hectic schedule. (To be fair, my “eat ‘til bedtime” diet probably didn’t help).

    If I worked things right, I could kill two birds with one activity. Bicycling would meet the fitness goal, but I had to figure out how to make it meet the “poor judgment” requirement. It turns out you can do this if you merely gradually escalate the “Insanity quotient” to the proper level. Read the following items, and my guess is that you’ll hit that point by the third one…

    1. Riding for an hour at lunchtime.
    2. Riding to Bothel and back on a sunny summer day.
    3. Adding extra steep hills to your 30 mile ride for “fun”.
    4. Riding the 56 miles it takes to go Lake Washington on a windy day.

    This approach was quite successful, with about 600 miles of riding during the summer, culminating in a 66 mile ride in early September. It’s not clear, however, if it counts towards your crisis if your wife and daughter ride 44 of those miles. I’m still waiting for the sanctioning body to rule on that issue.

    Doctor in the House?

    Samantha and I are very proud of Kim’s performance in school this year. She’s getting good grades in all her classes, and though she still has problems with her language at times, her deportment has improved noticeably. This year of classes will be followed by research, a dissertation, and exultation, if everything goes right.

    That’s all for now. If you want to keep track of what I’m up to, you can read my weblog at It’s a combination of job related items and some of my other hobbies, such as really bad jokes.

    Eric, Kim, Samantha, Tastrophe, Earl, and Alfred

    The Challenge

    It was a typical hotel room, with a typical bathroom, except for a small placard:

    Together we can save millions of gallons of water from chlorine and detergents

    You decide

    Leave towels you wish to re-use hung up or on the rack

    Towels you leave on the floor will be washed.

    Conservation takes care of everyone

    Help us make a world of difference









    I had to help. Millions of gallons were at stake.

    After I showered the first morning, I dried off, and then went to hang my towel. Intrigued by the obvious lack of a towel rod, I carefully searched the bathroom to determine where to hang my towel. Did I miss it, distracted by the attractively arrayed display of toiletries? No. Time to re-consider...

    Obviously, the placard wasn't interested in working with people who gave up easily, but rather with those who could operate in a towel rod-hostile enivironment. The secret had to be one of camouflage. There was a towel rod, but not an obvious one.

    Once I realized that, the solution was easy. I put my towel over the shower curtain rod, and confident in success, I exited the area.

    I returned several hours later, only to find that my towel had disappeared. What had gone wrong? I retraced my steps, and realized my error. In my haste, I had ignored the regulations, and had neglected to arrange the towel to maximize the evaporation coefficient. I went to sleep, confident that the next day would bring success.

    When the time came to try again, I carefully draped my towel over the rod, arranging it in the proper manner. Before leaving I performed a standard towel check, and everything was fine.

    I returned that afternoon only to find the towel gone again. Knowing that my procedures were correct, the only alternative was that I had  misunderstood the directions. As I re-read them, there it was, staring me in the face. That morning I had draped my towel over the curtain when I was supposed to have hung it instead. That had to be it.

    That night, my mind was in turmoil. Would I be given a third chance? If not, would I be responsible for the wastage of millions? Could I live with myself if that happened?

    Sleep came with difficulty.

    I was jittery that third morning. I left the towel placement for the end, so I wouldn't mess it up accidentally. I don't know how it happened, but I left the room, leaving my towel lying on the floor. My lack of attention to detail sealed the fate of many gallons.

    I now must live with my failure.


  • Eric Gunnerson's Compendium

    LOTR Review


    This afternoon, the C# team went to see LotR: Return of the King. I should preface this by saying that I'm not a big Tolkien fan (or a fan of fantasy in general). Note: There are some spoilers in this post.

    It's not a bad film, but contrary to Scoble, I don't think it was very good. Here are my issues:

    • There was enough fluff to cut this down to 2:30 from 3:00 hours, easy. The first hour had very little action and could have been trimmed down without affecting the movie
    • The movie has 4 endings, all with pull-back shots and stirring music. First, the bad guys are vanquished. Then Aragorn (sp?) becomes king. Then, the hobbits return to the shire. Then, Frodo leaves. Then Sam has a final scene. 5 endings.
    • The military tactics are pretty poor. You have a bunch of trebuchets on your fortress, but you let the enemy attack you for 15 minutes before you start using them. You have a force attacking your front gate, and all you do is crouch inside, waiting for them to break through. Where are the platforms to drop burning oil on your attackers? Where are the murder holes in the gatehouse? Where are the arrow loops? Could you at least put some of your archers on the top of the wall?
      Or if your cavalry is decimating your opponent and you're confronted by warriors mounted on huge beasts, do you use your superior mobility to continue to rout the footsoldiers, which will be easy because they've broken? No, you stop chasing the footsoldiers, and instead try to attack the huge but slow beasts. Stupid.
      It always bothers me when people do stupid things in movies.
    • Too many confused fighting closeups.

    If you're a bit LoTR fan, this may not bother you.


  • Eric Gunnerson's Compendium

    SpaceShip One breaks the sound barrier


    Burt Rutan is a national treasure. Scratch that. Burt Rutan is a global treasure.

    Rutan, the designer of the Voyager aircraft that circumnavigated the world on a single tank of gas.

    His most recent project at Scaled Composites is an attempt to with the X Prize, and has once again come up with a very innovative design. In their most recent test flight, SpaceShip One became the first private non-government vehicle to break the sound barrier, on a short (15 second motor burn) that took it to Mach 1.2 (930 MPH) and 68,000 feet.

    The press release is here.

  • Eric Gunnerson's Compendium

    My lights are done...


    delta a few miscellaneous strings that will go up in the next day or so, my holiday display is complete. I think I'm up to about 4000-5000 lights so far.

    There are three main displays:

    Santa and the Sleigh

    An animated Santa, run by an 8-channel homebuilt animation controlling sporting a Motorola HC11 microcontroller. Santa has 6 blue landing lights that flash, then Santa, sled, and reindeer appear, and then Santa goes up on the roof.

    Santa in the day

    Sleigh and reindeer from behind

    Rooftop Santas

    Santa at night


    Going up the roof

    Up on the chimney

    Tree O'lights

    The tree of lights is just that, a tree made entirely of lights. The controller is the same system as before, but this time it's running a 16-channel system.

    Tree in the daytime

    Hooking up the lights

    To see the tree in action, look at the whole-house view pictures at the bottom.

    Multi-colored house lights

    This grew out of my observation that having single-colored house lights was boring. So, the house is outline with a “light cable“ made of 4 different strings of lights - one each of red, green, blue, and white - hooked up to a special 4-channel controller (once again, based on the 68hc11) that supports dimming. The house is green one minute, blue the next, with a few chaser light effects thrown in. Here's what the controller looks like:

    I took some AVIs of Santa and the tree, but they didn't come out too good and are too big to fit on my website, so you'll have to satisfy yourself with a view of the whole yard.

    The balls of light in the foreground are 100-light balls that are hung on a 30' spruce in the front yard. The tree of lights is the huge blaze of light on the left side. Oh, and the large white light above the tree is the moon, which I ordered special for the night.

    Here are directions if you're in the neighborhood.

  • Eric Gunnerson's Compendium

    Garden d'lights 2003 - Bellevue Botanical Gardens


    Every year, the Bellevue Botanical Gardens bring out the lights. They do a wonderful job of creating plants out of lights.


  • Eric Gunnerson's Compendium

    Review: Space - A Journey to our future


    Today, I took my 9 yo daughter and a friend of hers to the Pacific Science Center, to see the “Space” exhibit. The girls liked it, but I'll only give it a C grade.


    • A functioning IR camera with a display screen, but with no useful instructions with what to show. I had to take the girls in front, show them how their fingers were cooler than their hands, and then have them unzip their coats to see how much hotter their bodies were.
    • Some interesting exhibits (a moon rock, a mars meterite)


    • Very disappointing age-appropriate displays. You want to show kids the different kinds of planetary probes, so you display them with the names of the missions. As if kids have any idea (for example) the difference between Viking, Magellen, etc. Even worse, for earth-orbiting satellites, you list the names of the satellites.
    • A 'trip to mars' section that is, in my mind, a total waste of space. First, you walk down a tunnet to a martian-like surface (okay), where a person directs you to touch an actualy martian meteorite. Okay, that's a bit cool, but there wasn't any depth beyond that. You then go into a 10 meter wide simulation of a martian colony. In cubbies on the side, it has a) a sleeping bunk, b) a fake galley, and c) a two-station computer where you fly an ROV over to investigate “interesting sites“ and shoot probes at that. A very bad video game with no obvious reason and no science tie-in.
    • Too much money spent on shiny and clean exhibit design. Too little money spent on people who understand education and making a subject interesting.
    • A “space bike“ simulator, with three recumbant bike-things like spokes in a wheel. You like down, buckle in, and then the machine spins around which you watch an LED display above your head that displays only “0000“, so you don't get sick. You can pedal if you like, but it doesn't do anything, so I have no idea why they bothered with the pedals. Two minutes, and then you're done.
    • A mock-up of a Saturn V stage, with some well-done launch pad effects and some sonic effects as well. And the point was?
    • Here are the pathetic teacher's resources for the exhibit.

    Overall, a huge waste of effort.

    As part of the Space them, their are showing “The dream is alive” and “Destiny in space” in the IMAX theater. We went to Destiny in Space, which is undoubtably the worst of the IMAX space films. IMAX films do best when they stay close to an actual action, but this film spends tons of time on poorly-explained planetary eye candy.

    We also saw two demos - one on supercold (liquid nitrogen), and one on combustion. Both were far better than the space exhibit.

  • Eric Gunnerson's Compendium

    Here there be tigers - operator overloading and conversions


    I came across a discussion in the last few days that I thought I would share with you. It concerns the following code:

    class Utility
        public void Process(object o);
        public void Process(string s);

    and then a call to Process that passed in a string.

    C# does permit this sort of overloading, and it has some complex rules (see in the spec for the details) to decide which is the better conversion, and therefore which function will be called. The rules are complex - I wrote our compiler conformance suites for this, and I still have to diagram it to get it right.

    It's string here, which probably didn't surprise anybody. For classes, the rules will prefer the more-derived/more-specific type.

    But what about the following:

    public void Process(int i);
    public void Process(uint j);
    ushort x = 55;

    Which method is called?

    The answer is “Process(int i)“, and this happens because, the language always prefers conversions to the signed types over conversions to unsigned types (a preference one way or the other is required to make things coherent in the presence of both signed and unsigned types).

    Behavior like this can be more than a little confusing to users of a class. As language designers, we have to make sure that there's a well-defined behavior in cases such as these, but that doesn't mean that you have to create such cases.

    My advice:

    Think deeply before overloading on two types that have conversions defined between them. If you do need to overload on numeric types - say you're writing something like String.Format - then you need to overload on all the types.

Page 41 of 46 (1,144 items) «3940414243»