Freekshow

May 27, 2008

Geek night out

Filed under: .Net,Events,Programming — Freek Leemhuis @ 12:01 pm

I went for a ‘geek night out’ yesterday to the Language Café at Sokyo. It turned out to be a very interesting evening. First of, Rob Vens spoke about the evolution of programming languages. Rob’s an interesting cat: rather than focusing on technical details he will speak at length on topics as General Semantics, Science Fiction, technology in general and a host of other subjects. Rob likes to get on his soap box and talk about his favorite subjects, and it made for an interesting tour through history. Plus we got a host of reference reading material.

One of the key points I’ve taken from the talk was: the near future in programming is all about ‘Back to the future’: most innovation that will take place will be driven by ideas that have been explored previously in earlier platforms and languages. Rob’s idea is that in the beginning of computer science people were more open-minded and ideas more innovative, and the focus has since shifted to making small improvements, rather than following big ideas.

When we broke up into different sessions, with tracks on Java, C#, Erlang and Smalltalk, this idea was confirmed by the subjects that were discussed regarding the future directions on these platforms. Both the Java and C# track discussed how parallel computing will be brought into the language. This is an area where Erlang for example has enabled programmers to do this for over 10 years. Pieter Joost, the C# track leader, has a write-up on the parallel extensions subject here.

The other example for future directions in C# was the idea of Design By Contract, available as Spec #, a Microsoft Research project. This style of programming has been around in Eiffel since the 80’s, so again it’s nothing new per se, but it’s interesting to see how we could use it to improve our code when applying the principles to the ‘modern’ languages on the .Net platform.
In the current download you could write statements in C# like

class ArrayList { void Insert(int index , object value)
	requires 0 <= index && index <= Count
	otherwise ArgumentOutOfRangeException;
	requires !IsReadOnly && !IsFixedSize
	otherwise NotSupportedException;
	{ . . . }

The keywords requires, otherwise etc. are used to extend the signature of the method to include a contract that specifies the values that are allowed, not allowed, exceptions that are returned etc. Read the research paper on Spec # for full details.Voices from the Microsoft camp have stated that these extensions are not likely to be released as extensions to the C# language, but rather as additions to the framework, so you can imagine this will be made available as attributes and asserts rather than the keywords you can use in the current download. It will be interesting to see how this will affect the process of Test-Driven-Development: instead of writing your test first, you would write your contract first.

Will we move from TDD to DBC?

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.