Tech-Ed developers Barcelona : Wednesday
So yesterday I went out with Ayman Shoukry (VC product manager), Steve Texeira (VC Product Group manager), Marcus Heege (VC MVP), Siddhartha Rao (VC MVP) and an Architect from MS whose name I forgot. I’ll update when I’ve had a chance to ask Steve.
It took us a while to find a restaurant, mainly because most proposals were vetoed by one person or another, but in the end we found a nice Italian restaurant. Well, it was either that or buy a large bag of candy at point.
We had a very nice evening, had nice food, had a few beers and talked about things like compiler trivia, politics and funny on-the-job stories. They were all very friendly people. I had a really nice evening.
Time flew and I left shortly after 23:00 because the last tram to my hotel area was at 23:45, and I did not fancy having to walk the entire distance or finding a cab.
So my night was a bit short, but luckily I was able to start with the breakfast of champions. The only thing better than having a plate full of bacon in the morning is of course having 2 plates of bacon.
I did not take the coffee anymore because it was very foul stuff, whereas the coffee at the convention centre is very good.
But I did drink 2 glasses of orange juice, so that counts as vitamins.
DEV323: C# 3.0, Future language innovations
This session was again hosted by Anders Hejlsberg.
As you might guess from the title, it was about new features of C#3.0.
- C#3.0 is completely backwards compatible with C# 2 and C#1. Anything that compiles with earlier compiler will compiler with C#3 without problems.
- contextual keywords: new features like LINQ use special keywords to create statements. But these are only keywords in the statement in which they are used. This means that your code won’t break if you have a variable named ‘from’ or ‘select’.
- Local variable type inference: using the ‘var’ keyword, you tell the compiler to take the type from the right hand side, and place it on the left hand side, like this:
var myVar = new Array<int>();
Note that myVar is still strongly typed. The compiler just saves you the trouble from having to type in long type names twice.
- Anonymous types: this allows you that have strongly typed variables of which the type is inferred by the compiler at compile time by looking at what you are constructing it with.
- extension methods: the new ability to write extension methods allow you to define new instance methods for existing classes without changing those classes in any way. Very powerful feature.
- Lambda expressions: I am a novice in this area, but if I understood it correctly, lambda expressions allow you to pass code as data, removing the need to explicitly create delegates to do something inline.
- Tied to lambda expressions are expression trees. These make it possible to turn lambda expressions into expression trees that can then e.g. be parsed by a SQL generator to generate code for interacting with a SQL database.
- Object initializers: these allow you to initialize objects when they are contructed by supplying values for public fields and properties.
- tied to object initializers are collection initializers. These can be initialized at construction by supplying the data that has to be put in them. A requirement is that the collection has to implement IEnumerable, and have a public Add method.
All these powerful features together are used to build LINQ (see my blog from yesterday). Any incorrectness in my explanation is of course my own. I am pretty sure that Anders explained it correctly, but I am not that sure that I understood everything correctly after seeing it only 1 time.
DEV205: Code Access Security
To be honest, I am only attending this session because there is nothing else in particular that I wanted to see.
It was either this or DEV339: Creating Windows and Browser apps with WPF. However, I know virtually nothing about Code Access Security (CAS), whereas I already know a bit about WPF, and this should be easy enough to figure out by myself.
The nature of the software that I write for customers does not call for security measures. We typically have administrator access to the machines that the software runs on, and we are allowed to add firewall rules, do a custom DCOM or .NET security configuration, or change folder permissions to allow our applications full control.
This session is hosted by Keith Brown. For those who know Dutch cabaretiers, his sense of humor resembles that of Bert Vischer J, though not as ADHD of course.
Code from remote locations is run in a sandbox, and is not allowed to do much.
CAS protects the user from the software, rather than protecting the software from the user. CAS is there to insure that an application cannot do things that you do not entirely trust them to do.
For example, to call any native code or use the ‘unsafe’ keyword, your assembly needs to be granted FullTrust. Anything less and it will trigger a security exception.
Btw, A really cool toy is LUTZ reflector. It is a dis-assembler for .NET assemblies that will show you what the original source code looks like. You can use this tool for example to read the source code from the .NET framework classes.
Keith talked a bit more about using isolated storage and not using strong names for security because they aren’t. If you want to use strong names for versioning, you always have to use the same private key. Any cryptographic algorithm of which the private key cannot conveniently be changed is not secure.
On top of that, there is no way to recall lost or compromised keys, so string names should be thought of only in the context of versioning.
Apart from the general talk about dealing with running in partially trusted zones, Keith pointed out the assembly attribute AllowPartiallyTrustedCallers.
When used in a class library, this attribute tells the JIT that the library designers assert that this library is not doing anything that could be used as an attack vector for a malicious application.
While of course being convenient to use by the application, this also means that the library designer has to be really sure that it is indeed safe to be used in an unsafe environment. To be good, this should mean that the library developers do design analysis and security auditing etc.
DEVWD15: Hardcore .NET production debugging
This is one of the sessions that I really wanted to see because it covers –among other things – WinDbg – which is an incredibly powerful debugger.
Ingo is a very energetic speaker, and he really covered a lot of ground using different debuggers.
As with the C++ whiteboard discussion yesterday, the room was packed 10 minutes in advance, so we got an early start.
Ingo explained the basic debugging commands, and how to use them to debug applications that would not start, or leaking memory etc.
I am not going to make an overview of the different techniques over here. One reason is that I have forgotten the exact sequence of commands and actions for most scenarios by now. Another reason is that there is so much to write that I would be writing a complete article on debugging, which is not my intention right now.
I certainly learned a lot in a very short time.
Marcus’ generous offer
This meeting was attended by Marcus Heege as well. The people from Microsoft told him that they had to turn away more than 50 people during his session because the room was already full. Because of this, they asked him to repeated that session again on Thursday.
Unfortunately, he had to leave today so he asked if I wanted to host that session in his place.
However, it was supposed to be an ad-hoc whiteboard discussion. This posed the following problems:
- I had nothing to start from (no written presentation to take over)
- I had absolutely not prepared myself to do this. Extending existing projects with .NET code is an advanced topic. I know how to find my way through that forest if I am sitting behind my PC with enough time to search for solutions to the inevitable problems that will arise.
Imagine I am up there and there are people asking questions like ‘Why does my application crash / hang when COM does this and .NET is used like that.
Going ‘Erhhhhm….’ At that point would make me look foolish at that point, as well as letting down the expectations of the people in the session.
It was very kind of Marcus to suggest this, but he is an expert on this topic, and I am not.
I thought hard about it, but with great reluctance I decided to decline.
If it was merely the intention for me to give a presentation I would have taken the opportunity to go out there and do it because then I could have taken over an existing presentation + demo, practice it a bit and go Live(tm) with it.
As it was, this was just too dangerous, and too likely to end in a big disappointment for both myself, the audience and the tech-ed people.
DEV340: building data driver applications with WPF
This session was hosted by Ian Griffith.
I only attended this session because there was nothing else of interest to me, and I thought it might be nice to get some more information on this topic.
Unfortunately, I do not know more than just the basics on data driven apps.
His presentation quickly went into data binding, data context and other things that I have never used in an application, so I was out of my league very quickly.
That is why I decided to leave the presentation after half an hour so that I could write up my other experiences of this day so far.
I am sure that the quality of Ian’s presentation was OK, but it just was not a good topic for me.
Btw, me leaving early also gives me the chance to write this stuff and still be in time for the next presentation on C++/CLI.
It is delivered in room 119, which is one of the smaller ones. Given the success of Marcus’ talk, I expect that room to be packed very early by lots of interested persons.
Microsoft really needs to allocate bigger conference rooms for C++ sessions because interest is high.
DEV406: extending native C++ applications with managed code
This was just the best session I have seen this tech-ed, or possibly ever.
Kate Gregory is a gifted speaker and can keep a fast pace AND bring a clear explanation at the same time. This 1.5 hours just flew by.
This session was about the different ways in which you can move large C++ code bases to use parts of the .NET framework.
It started with architectural explanation of what this means, and then showed a number of scenarios.
If this topic interests you at all, find the powerpoint presentation on the tech-ed site because they are of high quality. The presentation is of such high quality that you can use it actually as a checklist in adding managed code to existing projects, as well as getting a better fundamental understanding of this topic.
It is also worth to note that there were a good 150 people in this room with me, leaving only 3 or 3 empty seats. As I mentioned before, C++/CLI is a hot topic.