Showing posts with label devday. Show all posts
Showing posts with label devday. Show all posts

Saturday, 14 August 2010

A Good Day

Yesterday had an inauspicious start when the alarm went at 6am. I woke my wife up (again) when getting dressed. And when I got to the station I didn't have time to go to the shop and get a paper to read on the train.

But then...

The ticket inspector had an unexpected sense of humour.
A totally hot woman sat next to me on the train.
I wrote a StackOverflow answer on the hateful editor on my phone. 
And it was accepted.
Getting off the train I bumped into an ex-colleague I haven't seen for four or five years.
I got to spend the whole day getting my geek on watching ScottGu present on VS2010, ASP.NET 4, EF4 and MVC...

Amusingly, as I was waiting outside the cinema an American girl walked past and I heard her say 'must be a premiere' - I wonder how she'd have reacted if I'd told her we were all waiting to see a man from Microsoft...

VS2010 and ASP.NET 4
The first session was on what's in VS2010 and ASP.NET 4. As I've been using VS2010 since April I wasn't sure just how much I'd get from this session - the answer was, obviously, loads. 
I've already been using the HTML snippets, but now I know that there's a setting where I can turn off the requirement for an angle bracket before VS offers to complete the tag for me. What I didn't know is that there's a set of snippets for JavaScript as well. And a set for jQuery. 
We all learned that Scott doesn't like regions round his privates - cue much sniggering, I'm not sure it means quite the same thing in the States. But the learning point was that if you like regions done one way and your team mate prefers another, you can have regions that are private to you and won't show up when your colleague opens the file in VS. Ctrl + M, Ctrl + K is the keystroke to create one of these. 
Someone asked if there's a way to label these regions, to which the answer is no, however someone else pointed out that if you put a comment at the top of the region, it can work as a label when you hover over the collapsed region.
I picked up a bundle of new shortcut keys.
Collapse all regions - Ctrl + M, Ctrl + O
Incremental Search - Ctrl + I
Navigate files - Ctrl + Alt + Down Arrow
Navigate to - Ctrl + ,
View Call Hierarchy - Ctrl + K, Ctrl + T

Scott demoed some of the debugging features in VS2010, including pinning of watched variables, conditional breakpoints where the debugger only stops on a certain Boolean condition. And trace points, which allow you to write debugging messages to a TraceListener - optionally you can also continue executing your code, which neatly handles debugging a multi-threaded situation where breaking into the debugger hides the bug you're actually trying to find (the Heisenberg uncertainty principle in action!).
Scott showed how to use the ASP.NET Routing module in WebForms (the same one as used in ASP.NET MVC), and also showed off some of the deployment features, especially the Transforms which allow you to generate custom web.config files for different environments. Scott also told us that in the next couple of weeks there will be a new hosting gallery appearing on http://asp.net, which will allow you to search for a web host based on features they support.

MVC2 & EF4
I've seen a number of sessions in the last year on MVC and Entity Framework, but this was the first time I actually felt I was starting to 'get' it. I should have Scott sat next to me at work, think how much more productive I'd be!
Due to popular demand (and some well-publicised issues with the registration system for the day), Scott built a system based around developer events. For this session Scott started with a database, and built an entity model from it, then showed some of the features in MVC for displaying and editing data from the model. Highlights for me were the ease of allowing client-side validation - <% HTML.EnableClientValidation %>. That's it, one line of code!I was also very impressed with the scaffolding feature that allows you to build an editor page really quickly for a model. Whereas previously, you'd have written something like <% Html.TextBoxFor(fieldname) %> and the page will output a text-type INPUT tag (where field name is a string value), you can use the scaffolding to say <% Html.EditorFor(fieldname) %>, and the page will output a field appropriate to the data type of the field - a textbox for a string field, a checkbox for a Boolean field etc. And you can take this a level further - if you write <% Html.EditorFor(model) %>, ASP.NET iterates over the class and outputs the set of controls necessary to display and edit all the fields in the class - seriously cool.
In a large application, the number of controllers and views can grow so large as to make it difficult to pick a particular one out of the clutter, so Scott demonstrated how you can split an application up into Areas which allow you to group sets of controllers and views together to make it more manageable. Finally in this session Scott showed off some of the unit testing features. This included the gems that the 'Do you want to create unit tests' dialog when you create a new project is referred to as the 'Guilt' dialog, and the 'No I don't want to create unit tests' radio button is known as the 'I suck' button.

Windows Phone 7
After lunch, Scott took a (well-deserved) break and handed over to Mike Ormond to talk about Windows Phone 7. There are two programming models available for WP7, one in Silverlight and one in XNA. The Silverlight model should be used for event-driven type applications, the XNA one is more suited for time-driven apps e.g. game. However both types of apps can use features from the other if necessary. Mike also talked about how applications are distributed to a device, however what wasn't completely clear to me was how, as a corporate developer, if I write an app to be used internally to the company, I distribute the app and whether or not I have to release it to the marketplace. I was, mostly, quite intrigued about the platform as a whole - maybe later in the year I'll look more closely into developing for it.

Web Futures
The final session saw Scott back and talking about a number of the things that should be released by Microsoft later in the year, including IIS Express, MVC3, code-first Entity Framework and Razor. Of these, the ones that interested me most are IIS Express, and code-first EF. IIS Express I'm looking forward to as it will allow us to locally test our SSL pages (it comes with a local certificate). Code-first EF was interesting, although having not done any EF work I don't really know how much difference it would make. Similarly with Razor, I haven't done any MVC so I couldn't really appreciate the differences. Finally Scott showed off some TDD and in ten minutes explained Dependency Injection. I've been reading odd bits around DI over the last year, but I can honestly say I picked up more in that ten minutes than I did over the preceding 12 months!

And then we went to the pub with Scott to interrogate him, in which:
I learned that Dependency Injection and Inversion of Control are (more or less) the same thing. 
We were all amazed at how much of Microsoft ScottGu runs.
I learned the year the HTML 4 spec was ratified, though Dave Sussman says I can't tell anyone this.

It was A Good Day.

Saturday, 31 October 2009

StackOverflow DevDays Cambridge Review

I attended the StackOverflow DevDays event in Cambridge yesterday, here's my review now I've had a little time to compose my thoughts...

Overall I enjoyed it lots - I saw lots of interesting bits and pieces that I want to go back and investigate properly. Here's the session-by-session breakdown:

Keynote - Joel Spolsky
Joel's theme was Simplicity vs Power and the (perceived) paradox that giving users more choice makes them less happy. It was an interesting session with some food for thought about UI design.

Yahoo Developer Tools - Christian Heilmann
I'd expected this to be about the YUI Yahoo Javascript library, however it was actually more about creating mashups using Yahoo's YQL library. Which is fine because YQL seems very cool. It takes SQL and applies it to the Internet- sites like Flickr and Yahoo Maps look like tables and can be joined, so you could, say, put up a map and overlay it with pictures taken in the appropriate places. One thing that was very impressive was Christian's use of the tools to create a tag predictor for StackOverflow, which when you type a question, looks at what you've typed and uses it to generate a set of tags for the question - I expect we'll see this implemented on the site before too long.
An audio recording of Christian's talk is here.

Seven Principles for Systems Security - Frank Stajano
This talk showed the principles by which people get scammed, whether in a shell game in the real world, or as part of a 419 fraud. Frank used video from BBC's The Real Hustle to demonstrate some of these principles. Unfortunately I didn't think there was enough linking of the principles to designing security into systems, so whilst it was an interesting session, it was only generically so. Frank's original paper can be found here. 
(I should mention that I don't think I'd fall for the scam involving the honeytrap - I'm a geek, if a pretty girl starts talking to me, I'm instantly suspicious!)

FogBugz - Joel Spolsky
I saw Joel last time he came to Cambridge on the FogBugz World Tour, so I'd seen much of this before. The section on Kiln was new though, and it looks interesting. It does however rely on an available Internet connection - our company lost our main Internet feed last year for about six weeks, we'd have been boned if we'd been using it then.

ASP.NET MVC - Steve Sanderson
This was a tour through developing an application using the MVC stack for ASP.NET, although ASP.NET MVC 2.0 would have been a more accurate title as Steve used the MVC 2 bits for all his code. Which was no bad thing, and it was really interesting to see him using jQuery, including jQueryUI - I did feel that this session and the session after it would have worked better the other way round, with an intro to jQuery first and then showing it 'hands-on' integrating with ASP.NET. Steve went through it all really quickly, which I think may have worked against him a bit as he was on after lunch, however for a change in the first afternoon session of a conference I managed to stay awake and interested!

jQuery - Remy Sharp
This was an overview of the core jQuery library, and although Remy was an engaging presenter, I felt it suffered a bit in trying to go through everything that jQuery covers, I thought it would have worked better in focussing on some of the common tasks that developers need to address with JavaScript and showing how using jQuery makes it easier/less code etc. One thing Remy did cover was how to create a jQuery plugin, which takes a lot less code than I'd anticipated. At the end of the session Remy started to use jQuery to build a tag cloud based on the Twitter lists he's on, which was getting really interesting until he ran out time. I thought he was going to finish coding it in the break and then show it at the start of the next session, but actually he finished and demoed it in the break, so I missed it :-(

Python  - Michael Foord
The last technical session of the day was on IronPython, which is something I've flirted with learning now and again. Michael demonstrated using it to build a spell checker which uses the algorithm that Google uses when you mistype something and it comes back with 'Did you mean...'. Which is done in 21 lines of code and uses some statistical analysis based on some source text like a dictionary, the works of Shakespeare etc. It works out every permutation of letters based on what you typed and compares it to every word in the source text to find the most likely word you meant e.g. in the source text 'the' occurred about 80 000 times, meaning if you type 'teh' it's most likely you meant 'the' and that's what it matches you up with. Michael then demonstrated that the results of the algorithm can be fed into itself enabling it to correct two errors in a word. Very neat and worth some investigation.

StackOverflow - Jeff Atwood
Jeff talked about the evolution of the StackOverflow trilogy, the team, StackExchange and the importance of having someone hate you. He talked about how it's OK to fail sometimes as that means you are pushing the boundaries. But his main thrust wasn't particularly about coding at all, it was more about the importance of writing, which he said is probably the single most important skill for developers. He backed this up with quotes from people like Douglas Crockford and Jon Skeet. As part of this, he revealed the etymology of the Strunk and White badge on the SO sites - it comes from this book, which certainly in the UK I don't think is known at all (I think this may be the closest equivalent). (Jeff said on the way to the pub that he accidentally localised the site to the USA with this badge!)
As a result of seeing Jeff's thoughts on this, I resolve to try and write better SO answers!

On to the infrastructure:
Even though I've worked in Cambridge for years, the colleges aren't somewhere I'm really familiar with. So although my satnav got me to the right road, I was then looking for the college. And I nearly drove right past it whilst looking for a sign for a car park. Which then led to my discovery that there was no car park - I ended up parking down a side street where I think I got just about the last space.
Check-in was good - I'd expected there might have been a problem as I originally registered for the London day, then switched to Cambridge. Amiando would only let me print out a London ticket, but in the event there was no issue at all with this. And it was nice to run into my old friend Graham Parker helping out.
The food was fine - having seen some of the talk on Twitter from London about what had happened there, I was a little concerned about this. I didn't try the biscuits or the fruit cake, but the main finger buffet lunch was fine, particularly the sausage rolls! I have to say, though, that having seen the tables laid out in the refectory, I'd expected we were actually having a sit-down lunch. The coffee was OK, not great by any means but it contained caffeine which, let's face it, is the important thing.
In the hall itself I found the chairs pretty comfortable, but I'd have preferred chairs with a fold-out desk that you could have put a pad on to make notes.
The big annoyance for me was the wi-fi - I was accessing it on my phone, which meant that I kept having to put the key in and then accept the terms & conditions. I would have thought an open connection would have been easier for everyone.

All in all, a solid day's learning - I'll most likely be back next year!