PDC, Day Two

| | Comments (13)

So far, so awesome. :-)

I got enough sleep last night to make me more alert and active today. About 12 hrs worth of sleep, to be exact. :-P So I got to the conference today and was able to sit down with Olive D'Hose of the shell team and pick his brain about everything from why the start menu behaves the way it does in Vista to how things work internal to Microsoft. For those of you who are interested in this sort of thing, the shell team at Microsoft has about 20 project managers, 60 engineers and 100 testers. That's just for the shell team. Wow.

After talking to Oliver, I wandered around the different tech lounges and listened to random people explaining interesting things. But I didn't have too much time since I was itching to get to my first session: Accessibility and Automation.

Oh man, what an awesome set of APIs! The new UI Automation framework is absolutely superb, especially when compared to MSAA. It lets you expose your UI programatically, so that you can script your entire UI (for testing purposes, for example), and is much easier to implement than the MSAA stuff. Instead of having to implement a single, monolithic interface, UIA is split up into multiple interfaces that build off one another. So a push button doesn't have to implement methods for listboxes. I don't think I can stress how much I am in love with this new API -- it's extremely powerful and really easy to work with. It's also being backported to XP and 2003, as well as Vista. Wahoo!

The C++ optimizations session was pretty interesting, though it did focus solely on VS2005. I got a few interesting ideas from it that I plan to present to Mars to see if he's got ideas on it. Things like profile guided optimizations and supporting OpenMP so that we can have a much more optimized code generator and parallelization.

After that session, I was supposed to go to the new Avalon and Graphics session, but I skipped it due to running into Matt Pietrek and Sarah Ford. I had an excellent conversation with Matt about Win32 linkers and got some good resources from him. I BSed with Sarah for a little while about how her family is holding up in Waveland, but since she was about to start a Halo 2 game, I didn't get the chance to talk to her about accessibility too much. But that's ok since I contacted Thomas about stuff.

But I didn't "waste" my entire day in the tech lounge (though I certainly could spend entire months there picking the brains of my programming heros). I made it to the C# innovations session, and got a ton of great ideas for language features. I'm going to keep Mars busy forever at this pace! There's a lot of interesting concepts coming for C#, including a brand new concept called extension methods (I shit you not, we beat them to the punch this one!), lambda functions, anonymous type-safe data types, and object initalizers. All of it was very impressive, and certainly worth looking at for REALbasic.

The next session I went to pretty much told me what I already knew -- you can't use most of the new stuff without using .NET code. There's some interop services, but you still need an MS compiler to access them because you need to initialize the CLR. Yech. So I left that session early and tracked down Anders Hejlsberg (the designer of C#) and got to talk to him for a few minutes about language design. It was truly amazing to be able to talk to him; he's an extremely intelligent and articulate.

After the conference, I went out for a nice dinner with my sister and got lost in LA. Let me tell you, lost in St Augusta, MN is a lot easier than lost in downtown LA. :-P But I made it back safely, so it's all good.

My second day here, and it's been great.

Any questions?

13 Comments

Yes. How is an object initializer different from a constructor?

A few things I'd like to see RB pickup from C#:

1) /// commenting of methods, classes, objects, etc. (or VB.net ''' if you have powertoys installed). It goes a long way toward documenting a large project plus its nice to have those tips come up as you are calling items.

2) The +=, -=, etc. operators. Hey they are nice to have when doing math on a deeply nested object... so you don't type yourself to death. ;)

3) I'd really love to see a object browser like the one in VS2003 (ctrl+alt+j). It can really be helpful to introspect a class, esp if it is code that you didn't write.

Cheers!

Kev

Object initializers are one line ways to initialize objects with data (from a client perspective)..

imagine a class with properties/getters&setters/accessors whatever your flavor... you call new or the constructor, then you go through and use the accessors to set the data.. ending up with multiple lines of code.

With initializers, you can pass in a parameter => object style definition to initialize an object with one line of code easily... imagine

Person p = new Person{FirstName => "Jake", LastName = "Good"};

rather than

Person p = new Person();
p.FirstName = "Jake";
p.LastName = "Good";

now, you may argue that you could just include those parameters in a constructor, but that doesnt help with serialization, as most modern deserializing processes have to have a default constructor with no arguments to be able to reconstruct an object, then it will use a reflection device to set the parameters...

with some thought, you can see how initializers can help out with that scenerio and others (:: cough :: unit tests :: cough ::)

btw, Ruby has had this since it's conception... the best part about something like this.. is that if you construct your web applications the right way, you can collect your data in the form... create the correct "array" or initializer hash, and just pass that straight to an object initializer to get your fully fleshed out object. Kinda neat IMHO

in Ruby on Rails, you can create a for.. and the variables from the form get put into a params hash... so creating the object on the POST is as easy as saying

Person p = Person.new(params[:user])

@John -- Jake beat me to it, he's correct about object initializers.

Wait.... PDC is in LA? As in Los Angeles? In other words, Southern California?

Correct, Los Angeles, CA. Why do you ask?

So, an initializer is a built-in constructor that builds an object from an array/dictionary?

No, it's a statement block that takes named parameters that correspond to properties on the class and sets those properties automatically. So when you call new Foo, it calls the Foo constructor, and when you call new Foo(2) { X = 1 }, it calls the Foo constructor, passing in the value two, and then calls Foo.X = 1

Because you're just $7.08 of gas away from me.

Okay, granted, the way it works and the syntax is very different (definitely in REALbasic, since you can't create a dictionary with {x = 0, y = 1} syntax), but if you look at it generally it's almost the same.

Maybe.

@Seth -- you should have said something earlier, we could have gotten together!

@John -- Sorta kinda not really. A dictionary is a collection of key/value pairs. Object initializers are simply named property value assignments. You can't just initialize properties that don't exist (it'd throw compiler errors). I guess I view the two concepts as very different beasts. :-)

Eh. I had school ;^)

Leave a comment

Disclaimer

I'm currently an employee of REAL Software. My blog is mine. The opinions represented in this blog are mine as well and may not represent my employer's opinions. All original material is copyrighted and property of the author.

REALbasic® is a registered trademark of REAL Software, Inc. REAL SQL Server™ and Lingua™ are pending trademarks of REAL Software, Inc. All rights reserved.