Scott Hanselman

.NET 2.0 - What's the difference between System.Collections.Generic.Collection and System.Collections.Generic.List?

August 1, '04 Comments [1] Posted in Programming
Sponsored By

Anyone want to tell me what's the difference between System.Collections.Generic.Collection and System.Collections.Generic.List?

  • Collection<T> looks like a list, and it even has a List<T> internally.  EVERY single method delegates to the internal List<T>.  It includes a protected property that exposes the List<T>.
  • List<T> uses an array (T[]) internally and includes all this great anonymous delegate/predicate stuff like Find() and FindAll().
  • They both implement IList and ICollection.

Another weird one, Microsoft.VisualBasic still has the oddball Collection class that implements ICollection and IList.  Presumably this type exists only to help VB6 developers make the transition?

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

"Neo, there is no boolean." - Web Services, Product Releases, Travel and Famous Bloggers.

July 29, '04 Comments [3] Posted in ASP.NET | Web Services | Ruby
Sponsored By

A bit of a random, but nice day.

  • Rory joined Microsoft as a cartoonist for MSDN.  There's some presenting in the job description as well.  Congrats Rory.
  • The Portland Nerd Dinner was lovely, as usual.
    • Thanks to Jim Blizzard for the free books.  Jim represents everything that is good about Microsoft.
    • Thanks to Chris Sells for being so approachable about all things Longhorn.  Chris also brought a crew along from the O'Reilly Open Source Convention.  There were a few people who we having iBook Drum Circles that couldn't make it, but I DID very much enjoy meeting and talking to Sam Ruby
    • Sam Ruby was a kind, soft-spoken and very insightful fellow who told me a number of great insights into ATOM and the making of a new "standard."  Such things, if they are good, seem to take off with a life of their own, don't they?
  • I'm heading to BAY.NET tomorrow (PDX->SFO) to talk about Web Services and darnit if I'm not nervous to meet Simon Fell.  I'm looking forward to talking to him (and the group) about the chaos around null, nil, specified and "just not there."  I predict a blood bath of newbie confusion.  Fully. 
    • Is it null?"
    • "Yes, nil"
    • "But it's there"
    • "No, it's there, but it's marked nil" 
    • "Is it specified?"
    • "It's both specified and it's nil" 
    • "So if it's not there it's nil and not specified"
    • "No if it's not there, it's specified but nil itself is then unspecified."
    • "But is the boolean false then?" 
    • "There is no boolean"
  • Anyway, I shall try my best for the talk to not suck egregiously.
  • Had a big internal release of a magical thingie I've been working on all this time and we're all a titter with excitement.  Inconvenient that I'm travelling the same day, but Patrick Cauldwell has the whole thing on lockdown, so I know we're solid.  (I am disturbed though that his 9-year-old thinks Breakin' was better than Breakin' II: Electric Boogaloo. At least we agree on the tour de force that was Krush Groove.)

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

ASP.NET Compiler Error 128 and Microsoft Support

July 27, '04 Comments [3] Posted in ASP.NET | XML | Bugs
Sponsored By

I'm having a heck of a problem with a particular box and a dev site that's running ASP.NET.  We're getting:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: The compiler failed with error code 128.

This, along with a lovely compilation dump that shows the source of the Global.asax (the text file, not the Global.asax.cs code-behind.)

I've been working with Microsoft Premier Support but I'm getting pretty frustrated as the general message is "ya, this is obscure, it rarely happens and noone knows why."

Here's what I've collected about the problem so that it may help folks in the future.

Error Code 128 is a core Windows Error ERROR_WAIT_NO_CHILDREN that can happen when a CreateProcess() call fails - like starting the compiler to dynamically compile a page.  This error is mentioned in KB articles 155011 and 156464, as well as 184802 which implies it's a problem that happens running out of desktop heap.

Folks that have "fixed" this for themselves have done one or more of the following:

  • It's been said, but not conclusively that it's been fixed by applying the 821156 ASP.NET June 2003 Rollup Hotfix
  • It has also been said that running your Windows 2003 IIS 6.0 process in IIS 5.0 Isolation Mode fixes it.
  • It has been said that removing the Web App's folder(s) from the scrutiny of your Virus Scanner fixes it.

I've found cases of this happening on Windows 2000 and IIS5 with .NET Framework 1.0, as well as many on newer configurations.

I'd be interested to hear what someone on the ASP.NET team has to say about this problem, as I've found documentation of it happening on and off over the last three years.  Certainly there must be an ASP.NET team member who can say, "Oh! Ya, that.  You need to flip the bizzle and restart the universal kishkey..." or something.

Anyone else ever see this issue and solve it?  Personally, in ~3.5 years of messing with ASP.NET this is a first for me.

UPDATE - SOLVED: It was a funky ISAPI Filter that was sitting ahead of the ASP.NET ISAPI Extension. There is a slight architecture difference for ISAPI filters with IIS 6.0. 

UPDATE #2 - MORE INFO: From the Support KB 327611 "IIS 6.0: ISAPI Filters for Earlier Versions of IIS May Not Load" - I wonder if this was involved?

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Use of Posters and Flow Charts in Lieu of Prose for Documentation - Is a Visio is Worth a Thousand Words?

July 22, '04 Comments [0] Posted in XML | Web Services | Tools
Sponsored By

We've got fairly powerful (but some say, complicated) Code Generation process that uses XML Schema along with (with thing) an interesting use of WSDL with an alternate binding.  Voyager is our flagship snazzy eFinance Server and using standard modelling tools (XMLSpy, VS.NET, etc) one (business person, computer wonk, whoever) can sit down and model all their Domain Objects, Request and Response Messages in XSD (nouns) and associate them with actual Voyager Operations (verbs) in WSDL.  Then rather than using a SOAP binding (if they were to talk to a Web Service with these messages) they can use a Voyager Binding in WSDL.  Then we run a Code Generation process on the WSDL/XSD and generate all the C# objects, messages, proxy layers, Word Documentation, yada yada yada. 

All this is built into our Continuous Integration Process so when one checks in an XSD into the Version Control System those artifacts are automatically built and made available to others.

Since this is a fairly complex experience to the non-XML initiated, a lot of prose has been written and a lot of hand waving happens to explain this process.

Some users though felt the prose was, well, too prose-y, and wanted a quicker way to grok the material. 

So, I spent two days in Visio creating a 44" by 34" poster (FOUR 11" by 17" pages or one big Plotter plot) that has the source of the XSDs, the source of the generated objects and stacks, as well as diagrams describing the relationships between objects when they exist in a running process. 

People can look at the code generation progression as well as the composition of elements:

  • Declarative XSDs (multiple ones, lots of imports, namespaces and custom attributes)
  • Generated C# code
  • Assembly names, class names, .NET namespace names
  • Resulting compiled assemblies
  • How those final build artifacts exist in a running system

I've finished the first draft (this screen shot is to give you an idea of the scope and size of this poster) and will share it with the team tomorrow. 

How often do you or your groups create one large diagram instead of writing one or more large documents?  When are architecture & design posters useful and when are just trouble?

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The Computer Back - Pain and the Programmer

July 19, '04 Comments [31] Posted in Programming
Sponsored By

I'm on my butt today.  More specifically, on my back.  This weekend my lower back seized up - just one muscle it seems, as the back turns into butt.  It's amazing how a little stabilizer muscle can go nuts suddenly and mess up your whole system. 

I call it "Programmer Back" as there are a handful of other folks that sit in front of a machine all day that have had this problem. 

It seems the symptoms are nearly universal:

  • Everything is fine, often for months.
  • A seizing happens and you drop to your knees.
  • Often you can't stand without help, or if you do, you're bent over like an old person.
  • If you don't move, you're OK, but bending over, or rolling out of the bed become impossible.
  • It lasts for as little as 3 days or a much as a week and a half.

Some say ice, some say heat, some say massage.  Still others advocate chiropractic.

Have you had Programmers Back?  How do you deal with it?

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

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