-
|
This blog has been abandoned for the longest time :-$ but I’ve got great news to try and re-inaugurate it (again): it’s just been announced that beta 2 for Visual Studio 2010 and .NET Framework 4 will be available the day after tomorrow, i.e. on October 21st ; moreover, we now have a firm date for the launch of the final versions of these products: March 22nd 2010 . There is a lot of cool stuff in the new versions of Visual Studio and .NET Framework but my personal favorites (at least for the time being :-) are: The inclusion of dynamic programming elements in C# and other framework languages. Good things from languages like Python, Groovy, or Ruby are now an integral part of C#. The inclusion of F# as a first level language of the .NET Framework...
|
-
|
Generic constraints inside .NET has always been a fun enterprise, especially given how C# handles them There has been some discussion on Jon Skeet’s blog about the fact that C# does not allow for generic constraints referring to a number of types. These include: System.Array System.Delegate System.Enum System.Object System.ValueType This is indeed a bit unfortunate, as it limits some of the more interesting applications. The example Jon shows is indeed illegal in C#: public static T[]GetValues < T > () where T : struct , System.Enum { return (T[]) Enum.GetValues( typeof (T)); } However, as Jon correctly points out, this is indeed supported by the CLR directly. In fact, with our knowledge of F# constraints , we can write this exact function...
|
-
|
Recently, there has been an effort launched called the “Anti-If Campaign” in which they deride the use of if statements and instead, focus on Object Oriented Principles in order to create more flexible designs. Now certainly, I have a sympathetic ear to this cause as I’ve seen code that literally walks off the side of the screen due to nesting of if statements. Pattern matching to me, especially at the top level of the function is actually quite beautiful in a way, such as the implementations in Haskell: -- Haskell lucas :: Int -> Integer lucas 0 = 2 lucas 1 = 1 lucas n = lucas (n - 2 ) + lucas (n - 1 ) And in Erlang, this also holds true: % Erlang -module (lucascalc). -export ([lucas / 1 ]). lucas( 0 ) -> 2 ; lucas( 1 ) -> 1 ; lucas...
|
-
|
I'm happy to report that TestDriven.NET 2.0 RTM has cleared the launch pad! It has been a while since the previous RTM version, so here is a quick recap of what’s new: NUnit 2.5 TestDriven.Net now includes the production release of NUnit 2.5. This is the recommended version of NUnit if you’re using .NET 2.0 or above. To ensure maximum compatibility with .NET 1.x and legacy NUnit extensions, the last releases of NUnit 2.2 & 2.4 are also included. (more here ) 64-bit Windows By default TestDriven.Net will execute test projects compiled for AnyCPU in a 64-bit process. There are however some test runners that must run inside a 32-bit process. If you are testing with NCover 1.5, Team Coverage, dotTrace or .NET 1.1 (MSBee), TestDriven.Net...
|
-
|
When I was last out in Redmond, I had the opportunity to sit down with Erik Meijer to speak about something for which I’m passionate, functional programming. After such recent appearances on Channel9 as Joe Duffy and Anders Hejlsberg , I was quite flattered to be asked to appear. I gave a short as possible introduction to start talking about any number of topics including my passion for functional programming, the Haskell and F# languages, and many other ideas. One of the topics I talked about was monads. In some of my previous posts, I talked about them extensively in my Much Ado About Monads series. When I got the email that this video was posted, I was already writing my series installment on the asynchronous monad...
|
-
|
In the previous post, I talked about some of the basic ideas you can learn from Functional Programming and apply to your code right now. The first topic that was tackled was extensibility through the use of closures. Today, I’ll cover laziness in your APIs, how it can help, and what pitfalls might arise. Laziness Explained One of the hallmark features of the Haskell programming language is lazy evaluation. This gives us the ability to delay the computation of a given function, structure, etc, until it is absolutely needed. Sounds very agile in a way of the last responsible moment, actually. Why is it useful? By delaying the computation, we can gain performance increases by avoiding the calculations ahead of time. With this, we can create infinite...
|
-
|
Thanks for everyone who attended my session on applied functional programming earlier this week at RockNUG . This session was intended to reinforce the basics of thinking functionally and what techniques you can do right now to take advantage. It was more of a subset of my workshop I gave at the Continuous Improvement in Software Conference last year, with the addition of a few items. Of course I had to through in some Haskell as well and show off the Jolt Award winning book Real World Haskell . My previous post on the essay by Bertrand Meyer on Beautiful Architecture – Functional Programming versus Object Oriented Programming gave me some inspiration to revisit some of my Functional C# programming I had done in the past as well as the Functional...
|
-
|
Recently, upon the recommendations of a few people, I picked up a copy of the book “Beautiful Architecture: Leading Thinkers Reveal the Hidden Beauty in Software”. This book is a great read and includes essays from some of the top minds in software today. Some of the topics covered are: How Facebook's architecture is the basis for a data-centric application ecosystem The effect of Xen's well-designed architecture on the way operating systems evolve How community processes within the KDE project help software architectures evolve from rough sketches to beautiful systems How feature creep has helped GNU Emacs gain unanticipated functionality The magic behind the Jikes RVM self-optimizable, self-hosting runtime The design choices and building...
|
-
|
I will be appearing this upcoming Wednesday at the Rockville .NET User Group (RockNUG) to give a presentation on Functional Programming in .NET. This presentation will focus on the basics of functional programming, but also why you should care and how you can start applying these techniques today in your .NET Code. With the evolution of the C# language and the base class libraries to incorporate functional aspects such as closures, statement lambdas, expressions, lazy evaluation, we now have more tools to express our code in a very declarative style. Also, the incorporation of F# into Visual Studio as a first class language sends a signal that functional programming is gaining momentum. And who knows, we’ll probably talk some Haskell as well...
|
-
|
With my exploration into mass concurrency and big data problems, I’m always finding challenges to give myself on how I might solve a given issue. Such examples that have intrigued me along the way as PLINQ , MPI/.NET , Data Parallel Haskell , but one in particular has intrigued me more – MapReduce . A challenge I gave myself is to fully understand this paradigm and implement a version using F#. What Is MapReduce? MapReduce is a Google programming model and implementation for processing and generating large data sets. Programs written using this more functional style can be parallelized over a large cluster of machines without needing the knowledge of concurrent programming. The actual runtime can then partition the data...
|