Nov
13
posted at: 3:46 PM
jQuery
Hanselman touched on the jQuery topic a little bit and basically said that if you're not using it yet, you should be.
In a separate session, I was able to capture some tricks that I wasn't previously aware of (and this one in particular may be obvious to others). The one I'm going to start using immediately is an easier way of referring to the current element in an anonymous function. Before, I was doing something along the lines of: $("#" + this.Id + ") when I could have easily done something way easier: $(this). This solves some issues I was running into with my method where the element didn't actually have an ID, which forced me to be a bit.. uh.. creative in how I referenced elements.
Much of the talk I attended on jQuery focused on utilizing JSON to do full client-based web service calls with jQuery and incorporate them into an application. I'm generally not a big fan of JSON and this approach, as I like to have a middle tier server side in a web form or class library to act as a business logic layer. Having to incorporate business logic into javascript is not a practice I've ever been a big fan of, and I think the other developers at my organization would agree.
Additionally, there was quite a bit of focus on jQuery's extensibility and the updated support from Microsoft for the library. jQuery is actually the first open-source library that not only has Microsoft embraced, but that they officially offer support for. This means that you could call Microsoft for developer support like you usually do (does anyone do this? I didn't even know they had phone support for developers), and they will be able to answer technical questions about jQuery. This is fricking awesome, and could be the first step for Microsoft opening it's arms to the open source community, which has brought success to the other 900lb gorillas in the software space.
ASP.NET AJAX Challenges and Solutions
This talk kicked off with a brief history of AJAX, and the mandatory reference to the Adaptive Path essay in early 2005. It's fun to think about how far technology has come inĀ three years to make AJAX easy. I remember working with my boss at the time for three full days just trying to get a proof of concept going right after that article gained traction. I'm so glad to not have to do anything with the XmlHttpRequest javascript object anymore.
The speaker also touched on how native AJAX breaks the back button and prevents bookmarks. I don't entirely agree, as we're doing some pretty slick stuff with permalinks and re-initializing state using dynamically generated javascript. I'm more interested in how the upcoming ASP.NET AJAX release is going to fix the broken back button. He eventualy addresses this solution by touching on serializing the page's state in the QueryString.
ASP.NET Ajax SP1 is shipping with a history feature in the script manager, so that you can utilize the API to manage the back button state. I'm not sure how much effort is actually involved with this, but I'm sure it's easier than doing the url serialization method. Regardless, it means more work for a feature that most users probably haven't come to expect. Another thought I had would be saving page state at the data layer based on user rights. Then urls would look nice.
.NET 3.5 Tips, Tricks, New Features etc.
The session regarding what features are new with 3.5 really became more of a discussion about the differences between the latest version of C# and VB.NET. And yes, I realize that 3.5 has been out for almost a year now, I attended with the hope up I could pick up a few tricks that would make me a faster coder.
VB.NET actually has a background compiler to speed up the compilation process, whereas C# does not. Eventually we will see it in both langauges, though, which will reduce compilation time. I'm all about speed, so the sooner we can see this happen, the better. There haven't been any announcements about the next version of .NET, so I'm going to assume this is quite a ways out.
Partial method support, similar to how partial classes work, was discussed. I see this a lot like a lazy way to do method declarations with interfaces. I don't really use interfaces, though, so to each his/her own.
Extension Methods were discussed, something I've seen a little bit about but haven't tried yet. Extension Methods are really a way of allowing you to override methods from classes that were not previous marked as virtual. This is particularly useful if you need to provide your own implementation of a method from the framework, or in a library or assembly that has been sealed.
Object Initializers serve as a blatant reminder that I need to use them. This probably doesn't make me code faster, but it looks so damn pretty. Shorthand is always nice to save space and make code more readable, and the best part about them is they are self-evident, in that even if you didn't know what an Object Initializer was, you would understand what is happening just by reading it. Basically, they are just a shorthand way of initalizing properties of an object, just like how you can use shorthand to populate values into an array as you create it.
Silverlight
The InkAnnoation presentation control is pretty cool. It allows you to have the equivalent of MSPaint in your Silverlight app. I could see collaboration software using something like this for whiteboarding, especially if you built it do continuously save the real-time generated xaml server-sie. I guess it works well with tablet PC's as well, so it could add value if you do a lot of presentations.
Utilizing Vista's built-in handwriting recognition could be pretty cool as well, but I can't think of any way this would add any immediate value presently.
In a separate session, I sat through the whole talk hoping to get more detail on Dependency Properties, which was something I had battled with in some Silverlight apps I worked on earlier this year. Unfortunately, the presenter ran out of time, so I'll have to dig through his examples the next time I hop back in to the Silverlight world.