Developer Day 8
Back to blog listAnother Developer Day over, another enthusiasm shot for the day job. Here's the usual breakdown:
| DeveloperDeveloperDeveloper: Speaker / Thoughts | |
|---|---|
| Mark Needham (ThoughtWorks) |
Not really what I had expected based on the title alone... After introducing functional programming as a language with first class functions (can be created during execution, passed/returned etc), immutability, lazy evaluation, recursion and pattern matching Mark proceeded to demo 'Transformational' instead of imperative thinking using the linq implementations of a variety of 'functional' principles: Map = Select, Filter = Where, Reduce ≅ Sum. Usage of such extensions on IEnuemerable allow code to be more declarative - with the statement of the desired result being specified as opposed to the exact process to undertake. Although Mark did make some good points in reference to realising linq can easily lead to duplication (reminding me of jquery selectors being used multiple times because they look small, irrespective of the actual work they are doing), the content generally had a low difficulty level feeling (which could have been enhanced perhaps by focusing more on the design patterns content that was briefly touched on), with a chunk of the questions at the end critiquing the examples rather than drilling down into the subject. |
| Mixing functional and object oriented approaches to programming in C# | |
| Andrea Magnorsky (Round Crisis) |
Probably my favourite talk of the day Andrea gave an excellent fast paced intro to Unit Testing using Xunit and Moq. With the example of testing an OrderService we saw how to use consistent, verbose naming of tests for clarity/ease of use and were reminded that a unit really does mean a small unit. For example multiple tests of the save method of OrderService were used to illustrate a first simple 'does not throw' test, through using a stub of an invalid object to check the 'if not valid return false' nature of save to using a mock of an email sender to check that a 'send email' call is sent. By using mocks and stubs the testing of the order service is contained only to the logic within the service and not to any of it's dependencies - any repository related aspects should be tested separately. The phase 'be super paranoid about your tests' enforced the idea that test code is no smaller matter than production code, and if anything should be treated even more thoroughly. A general rule given was that behaviour tests end in a Verify on Mock whereas state tests end in an Assert and that tests follow an Arrange, Action, Assert (or verify) flow. The final golden rules were: tests should not involve conditionals, should not depend on other tests and should not assess multiple expectations. Although pointed to during the talk it would be interesting to hear more about unit testing in the context of Test Driven Development. |
| Lessons learned on Unit Testing | |
| Jon Skeet (Google) |
Having previously seen Jon Skeet recreate linq to objects in 60mins this was undoubtedly going to be a good session. Jon covered the main 'newness' coming in C#4.0
|
| C# 4 | |
| Lunch Time | The Grok talks this year seemed a far bigger deal (with a large room and a lot of attendees). Some good tidbits included a demo of using T4 templates to generate code/sql/xaml in visual studio from Rob Blackmore and a run through of CodeRush Xpress by Rory Becker. |
| Grok Talks | |
| Simon Sabin (SQL Server Consultant) |
As with most developers I have been concerned by the use of ORM's such as Linq2Sql and EF in terms of the 'auto generated' sql that they produce. Simon allayed some of those concerns by running a number of test queries, using instrumentation such as 'SET STATISTICS TIME ON' to compare the differing sql between manually and EF created, with mostly good results. There were a few specific examples of weakness in EF1 however the speed of application construction must be balanced against the speed of direct ADO.NET queries (which vastly outperformed the ORM queries - with no overhead for mapping etc). A couple of important things to remember are that when you construct a sql statement you are asking SQL Server for the result not telling it exactly what to run and it will often reorgnise queries before execution. Additionally the old argument between stored procedures and text queries was touched upon with the only benefits really being the amount of text over the network and the security issues of allowing direct modification of tables. Performance is not an issue as compiled plans of text queries are cached in SQL. The underlying theme was to check your queries using tools such as SQL Server Profiler in order to hone your query performance (whether it be through direct SQL, EF, Linq2Sql, nHibernate..). |
| Entity Framework - How to stop your DBA from having a heart attack | |
| Barry Dorrans (Soon to be Microsoft) |
As Barry is soon to be moving to Microsoft in the states his talk was somewhat hijacked by the DDD team with various videos leading to a rather jovial atmosphere for the final talk of the day. The content itself was very factual rather than contextualised to the day to day in the sense that the presentation did not really go in to real world examples, prefering instead to describe the variety of encryption/hashing options available to developers.
|
| A developers guide to encryption | |
Overall some excellent content with useful take aways.
Published: February 2010Other Recent Posts
Boagworld 200th(February 2010)
It was my pleasure to take part in the 200th Boagworld (bw200) yesterday. A marathon session that started with Bob, Paul and I waiting outside the locked barn keyless and cold until Dave, Stanton and Ryan came to the rescue...
The Project52 Challenge(January 2010)
During the end of December last year I, along with many others, somehow got caught up by the #p52 hashtag and, in true 'resolutions that I probably won't be able to keep' stylé, I took on the challenge. The idea is as follows:
Cargowire MVC Series begins...(December 2009)
A new post has just gone up over in the articles section. Now that I've migrated the cargowire codebase to .NET MVC I intend to release a few articles in relation to the process. The first is with regard to routing, particularly extensionless routes that match my pre-existing urls but use the new Routing capabilities of .NET MVC.
Overengineering and a lack of testing, the pitfalls of personal projects(November 2009)
Ok, so yesterday I jumped the gun somewhat with the rather over ambitious: asp.net MVC version of http://cargowire.net up now - pretty much the same (hopefully) fleshed out notes and added link to thebarn pagehttp://twitter.com/cargowire/status/6182546830
New article posted! (Ubuntu gets inside Vista)(August 2009)
Just posted a new article covering how to get a previously installed dual boot of Ubuntu and Vista to work seamlessly inside VirtualBox running on Vista (check it out over in the articles section). It's something I did a while back and have been meaning to finish the article on. It has definately increased my usage of Ubuntu.

