C# Trivia Quiz Part 1 – Answers

C# Trivia Quiz Part 1

I did warn you that these would be trivial. Here are the answers:

Language Details

1) How many loop constructs does C# have, and what are they?


for, foreach, while, do

Or, perhaps, that's only two, given that for and foreach and while and do are variants of each other.

2) What is the difference between “ref” and “out”?

From the runtime perspective - and the perspective of other languages - there is no difference between the two - they are both "pass by reference".

In C#, "out" means:

  • The caller doesn't have to assign a value to a variable for it to be considered definitely assigned after the call

  • The callee must assign a value to the parameter.

C# and the Runtime

3) What does



Why would you use it?

This gives a name to an indexer. Because the C# syntax never shows the name, it doesn't matter to C# code, but it does to VB code. By default, the indexer is named "Items". If you were adding an indexer for a string, you might want to call it "Characters". Or, perhaps "DramatisPersona"...

C# and other languages

4) You are a troublemaker in a group of Java and C# programmers. What should you say?

Two words:

"Checked Exceptions"

Checked exceptions have been - and still are - one of the hot topics between the two communities, with lots of strong opinions.

I like these resources:

Does Java need checked exceptions? (Eckel)

The Trouble with Checked Exceptions (Hejlsberg)

Java theory and practice: The exceptions debate (Goetz)

My opinion is that checked exceptions address an issue that isn't high on the list of issues that need to be addressed, and impose a significant burden (both in language complexity and in programmer busy work) while doing so.

Real Trivia

5) How many conference rooms has the C# language design team met in over the years?

One, a small conference room in the second floor of building 42.

Okay, that's not strictly correct - there been a few meetings elsewhere - but at least 95% of the meetings have been in that room.

How were you supposed to know this? Well, Anders has said it publicly at least once, and I think he did in this video (well worth it even if he didn't say it in that one).

6) Which of the following are not spare-time pursuits of mine? 

  • Pursuing a doctorate in cat juggling with a concentration on Persians.

  • Trying to cut down a tree with a herring.

  • Studying the airspeed velocity of unladen swallows

  • Preparing a monograph on the rise of cross-dressing vis-a-vis the 1970s sketch comedy

  • Being a slightly embarrassed Roomba watcher

All MSDN columns include an author bio at the bottom ("Reginald Codesqueezer is an evangelist in the programmer kitchen accessories group at Microsoft, where he is working on the release of CodeWok 2.0.")


Way back, when .NET was young, I wrote a chapter for a .NET book about the C# language (sometime shortly after my book was published). I don't remember the book or really what the chapter was about, but I do know that the publisher asked me for a bio, I forget, the publisher asked me again, and I sent off something that I thought might be funny, which showed up in the book.


Which leads us to the answer, easily verified with a search engine ("eric gunnerson cat juggling"), which is that these are all spare time pursuits of mine, making this a trick question.


When I started writing my MSDN column, I had a pretty blah bio, but after a while, I wondered how much attention my editor was paying to what I wrote, so for the last few columns, I started changing the last line of my bio.


The bio in my current book ends with, "In his spare time, he enjoys skiing, cycling, home improvement, microcontroller-based holiday decorations, pinball, Halo2, and writing about himself in the third person", which my Apress editor really liked.

Power Users

7) What does typing the following do:



a) Nothing

b) Print an error message

c) Compile the latest version of my multi-player version of SpaceWar!


The C# team had a problem. Every day, posts were showing up on our internal discussion group saying, "When I try to compile this program, it's complaining that it can't find this class, but I have a using statement". Or, they would say, "this code works when I compile it in Visual Studio, but it doesn't work from the command line".


The problem was that the compiler only referenced mscorlib.dll and system.dll by default, and you really can't do anything of interest without referencing other assemblies. It didn't show up in VS because when you create a project in VS, it adds a default set of assembly references to the project.


So, we needed a way to fix that. We considered some elegant solutions so that all compiles wouldn't have to pay the price of opening a bunch of assemblies that weren't necessary, but it turned out that the perf cost wasn't significant.


So, we decided to add a response file. The concept of response files wasn't original - VC++ has supported them for quite a while - but I do think the concept of having a default response file was new. If you find csc.exe on your system (mine lives at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727), you'll find that there's a csc.rsp file there that lists all the "default" assemblies. You can edit that file if you want, or you can put your own csc.rsp file in a directory.


Interestingly, because the response file is just used as input to the compiler, you can put filenames in there too, which means the correct answers to the question are "b" or "c".


The addition of the default response file fixed the command-line problem, but led to the reverse problem, since VS (for perf reasons, IIRC) didn't reference as many assemblies automatically as the command-line compiler did.


SpaceWar! rocked, BTW.


Ancient History


8) What was the name of .NET before it became .NET?


Next Generation Windows Services (NGWS), pronounced "Nugh-was" (though rarely pronounced at all).


This marketing name was replaced by the elegant and much-easier-to-say ".NET", which would go on to confuse millions of customers worldwide.


9) Current Visual C# PUM Scott Wiltamuth was the PM for the C# language during the first version, but often worked remotely because of a long commute. How long was his commute?


Around 8 hours - 6 hours on the plane, and an hour at either end.


Scott worked remotely from Hawaii, and did a pretty remarkable job doing so.


Comments (13)
  1. David Grant says:

    Was the term "COM99" before or after "NGWS" ?

  2. Matt Davis says:

    I had fun with this one… I had a few different answers to some things though…

    1) Isn’t the answer 5 (counting goto)?

    2) Aren’t there some special runtime cases (eg remoting, COM interop and P/Invoke arg marshaling) that don’t require that the caller’s current value be marshaled to the callee in the case of "out"?

    4) The Java vs C# religious flame-war that first came to my mind was Java’s "virtual by default" behavior (checked exceptions was right behind).

    Thanks for the trivia- always fun!

  3. KJK::Hyperion says:

    What about "COM+ Runtime" (the still ubiquitous "Cor")? and "COM+ 2.0" (which was used to describe the extensions to the PE format)? did they come before or after NGWS?

  4. MSDNArchive says:

    Actually, the language design meetings I’ve been to were in a small conference room on the second floor of building *41*.

  5. ericgu says:

    David, KJK:

    There was COM99, COM+, COM 2.0, but IIRC they didn’t refer to the whole system the way NGWS did.


    1) Goto is not a loop construct. You can use it for loops, but it’s more general-purpose.

    2) With interop, the compiler trusts that your definition is trustworthy, but you can lie.

    4) Yes, that’s a good one, too.


    Shhh!!! Now the protesters will now which building to show up at!

  6. Actually .NET has grown from COM+ 2.5, ASP 4.0 and NGWS. COM+ 2.0 was introduced in W2K as the successor of COM+ 1.0.

  7. I have read it somewhere in an interview can’t remember who it was, someone from the CLR team…

  8. Miral says:

    If you’re going to eliminate "foreach" and "do" because of similarity to "for" and "while", then you have to eliminate "for" for the same reason, leaving only a single loop construct.  It’s possible to write everything using only "while"s, though it looks a bit ugly in some cases 🙂

    And the default indexer is called "Item", not "Items".  Presumably so that you can go someCollection.Item("foo"), which sounds a little more natural than someCollection.Items("foo").

  9. Leon says:

    ‘you might want to call it "Characters". Or, perhaps "DramatisPersona"…’

    good one.

    "Actually, the language design meetings I’ve been to were in a small conference room on the second floor of building *41*."

    … and the only other people in those meetings were the janitor and your secretary’s cat? I’m afraid your invitations might have been tampered with KJK.

  10. Olivier le Pichon says:

    What about Omniware for a pre .NET name? Colusa have been bought by Microsoft in 1996 and I think COM97 was the first MS name.

  11. Olivier Le Pichon says:

    Mary Kirkland spoke about COM+ in volume 12 number 12 of MSJ (December 1997) but it’s only because the shift to ORE (Omniware Runtime Environment ) was not done?

Comments are closed.

Skip to main content