Rediscovering the Obvious

…stumbling in the footsteps of greatness

Errors are enlightening

without comments

Specific:
SomeFrame.xaml.cs(20,26): error CS0263: Partial declarations of ‘RibbonPad.SomeFrame’ must not specify different base classes

Good! They used partial classes (as makes sense) instead of the old ASP.NET inheritance approach for defining the relationship between code generated off of XAML and the C# code that goes behind it. 

General:
I often find myself using the errors I encounter as teaching aids. I’ve run across too many developers that see that they made an error of some sort, barely glance at the text, and then start hacking away at code to ‘fix’ it without ever actually fixing it.

The most common example used to be the naming collision message when you don’t put either ‘new’ or ‘override’ on a method defined as virtual in a base class. The message is somewhat cryptic, but if you read the whole message you realize it should be ‘override’ in the vast majority of cases. However, the message displays the word ‘new’ early on, so people just tend to use that, the warning goes away, and a bug is introduced.

Note: I’m pretty sure the compiler output changed in .NET 2, so this specific case doesn’t apply as much as it used to. If anybody wants to post the exact error/warning text in a comment, please do… I don’t have a .NET 1.x complier installed anymore.

 

Written by erwilleke

March 5th, 2007 at 10:12 am

Posted in Uncategorized

Leave a Reply