I just watched this interview with Anders Hejlsberg for the first time. This is truly an amazing interview. It’s rather long, about 1 hour, but it is so worth it. I’m not giving anything away… you’ll have to just watch and enjoy.
I am giving a few things away: trip down memory lane, putting big parts of software development history into perspective,
Since Anders has been so versatile, influential and still humble, this is a must watch for anyone in the software field. To quote Research Channel:
This episode features industry luminary, Anders Hejlsberg. Before coming to Microsoft in 1996 he was well noted for his work as the principal engineer of Turbo Pascal and the chief architect of the Delphi product line. At Microsoft, he was the architect for the Visual J++ development system and the Windows Foundation Classes (WFC). Promoted to Distinguished Engineer in 2000, Anders is the chief designer of the C# programming language and a key participant in the development of Microsoft’s .NET Framework. In this show, Anders is joined by a surprise guest. This episode of ‘Behind the Code’ is hosted by Barbara Fox – former senior security architect of cryptography and digital rights management for Microsoft.
(PS: how a video published in the C# 3 era can be so current <g>).
And if you feel for more, here, here, here, here and here are some more, are a few lists of videos where Anders speaks.
From a historic perspective, I like these most:
Thanks to Danny Thorpe and John Skeet, I learned something about C# initialization order.
I knew there were differences between declarations having their initial value set at the point of declaration, and inside a constructor, but not about all of them.
So I observed the initialization order while stepping through code, but the virtual method behaviour was new to me.
In the .NET 1.x past, the WinForms designers in Visual Studio .NET and Visual Studio 2003 would put the C# or VB.NET code containing the form code as the InitializeComponent method of the top most class monolithic C# and VB.NET files that also contain the user code (for events and such).
As a side note, with a bit of effort, you can generate the Windows Form Designer generated code yourself as this answer shows. This is for instance convenient when you have form definitions in a different technology and want to convert it to WinForms, WPF or another form of designer based .NET code.
I long time ago I wrote a short manual for co-workers on converting the monolithic files (for people interested, it is below).
Every time I use regular expressions (or post about them), it makes me think about the classic RegEx post by Jeff Atwood: to compile or not to compile.
Array initializers can be specified in field declarations (§17.4), local variable declarations (§15.5.1), and
array creation expressions (§14.5.10.2).
The array initializer can end in a comma, which makes some things way easier (boy, I wish I had this in other programming languages).
From Nick’s answer:
It has no special meaning, just the way the compiler works, it’s mainly for this reason:
[FlagsAttribute]
public enum DependencyPropertyOptions : byte
{
Default = 1,
ReadOnly = 2,
Optional = 4,
DelegateProperty = 32,
Metadata = 8,
NonSerialized = 16,
//EnumPropertyIWantToCommentOutEasily = 32
}
[/language]By comment request: This info comes straight out of the ECMA C# Specification (Page 363/Section 19.7)
“Like Standard C++, C# allows a trailing comma at the end of an array-initializer. This syntax provides flexibility in adding or deleting members from such a list, and simplifies machine generation of such lists.”