Designing great frameworks training: Rich Type System

Continuing on the weekly series, today we posted the session on A Rich Type System. Thanks for watching the last week’s session on naming conventions and coming that chat… Last week we had over 90 people at the chat. If you missed it there will be a chat transcript posted soon. The technical content of the presentations are going to start ramping up fast from here on out.

A couple of notes on this sessions:

I am interested in your thoughts on Value and Reference types.. do you agree with me that many developers on the platform can be very productive and happy on the platform without really understanding the distinction between value and reference types? (slide 5).

Funny, listening to my self read code… for a line like: “int i = 123;” I read that as “int i gets 123”. I guess “gets” comes from my history with Pascal… how do you think it is mostly read?

I think it is very cool that you can look at the source code for int\Int32… it is just a value type, you could write one of your own. Check it out int32.cs

Slide 16 talks about generics, sense I filmed this, we decided to added generics to the CLS in the .NET Framework 2.0 (Whidbey) time frame (before Longhorn).

Slide 20 talks about the now infamous naming convention for generic type parameters. Again, my data is out of date. Kris has the latest guideline here. I must say it is a bit odd to hear me vigorously defend our “old” K, V model… I must say I sound pretty convincing. J  That said, I am very happy with the new model we have, I think it fits in much better with the overall model

Slide 27: The obvious question many of you will want to know is how to get a list of all the optimizations the JIT does. The short answer is that we don’t produce such a list to ensure that we are free to change the JIT as we move forward and moves to different processorts. The thing you should do in your code is to measure, measure, measure… don’t assume “smarter” code is better. Write the code in the obvious, easy to read way, then measure and optimize. More on this in Rico’s talk in the next few weeks.

Slide 27: I confirmed it, we do this optimization on accessing chars out of a string as well as arrays. For all intents and purposes, the JIT treats instances of System.String just like a char[] for exactly this reason.

Slide 30: Good news on the catch{}, vs catch (Exception e) differences. We are very likely going to address this in Whidbey. That is we will wrap exceptions that don’t inherit from System.Exception in a class that does inherit from System.Exception…. Look for more data on this post Beta2.

Slide 36: First, an interesting thread on localizing for developers… Lots of good comments here: https://blogs.msdn.com/brada/archive/2005/01/24/359983.aspx#FeedBack

Slide 36: Brian Harry and I recently spoke about error messages for exceptions. He made a good point that sometimes end users to see exception error messages. This is particularly true when you are building an end application. So for most “system” or “framework” level exceptions target the message at a developer, but for application specific exceptions expect for an end user to see them.

Slide 36: UE = User Education… they are the folks the write the documentation for the product.

Slide 56: Did anyone happen to use a very early, pre-beta release of the .NET Framework and actually see the PrinterOnFireException? I would be interested to hear if anyone actually spotted this…

General question: how do you like the questions at the end? Are they helpful for you to understand the material?

Rich Type System
Learn what rich constructs from the CLR's type system are available and appropriate for developing APIs. Also, learn when to use reference over value types, delegates, exceptions, attributes, and many other important features.

[300k]

I will be in a chat room on 2/2 1pm PST to answer questions and hear your comments on this topic. The Q&A part of these classes is always my favorite part; I hope you will take time to come.

[Sign up for the chat]

Sign up for coming chats…

2/4 - Member Types [Sign up for the post session chat]

2/11 - Designing Inheritance Hierarchies [Sign up for the post session chat]

2/18 - API Usability [Sign up for the post session chat]

2/25 - Designing Progressive APIs [Sign up for the post session chat]