Quantcast
Channel: Mark Needham » .NET
Browsing index pages (13 articles)

Functional C#: Continuation Passing Style

Partly inspired by my colleague Alex Scordellis’ recent post about lambda passing style I spent some time trying out a continuation passing style style on some of the code in one of our controllers to...

View Article


Functional C#: Using Join and GroupJoin

An interesting problem which I’ve come across a few times recently is where we have two collections which we want to use together in some way and get a result which could either be another collection...

View Article


C#: Overcomplicating with LINQ

I recently came across an interesting bit of code which was going through a collection of strings and then only taking the first ‘x’ number of characters and discarding the rest. The code looked...

View Article

C#: StackTrace

Dermot and I were doing a bit of work on a mini testing DSL that we’ve been writing to try and make some of our interaction tests a bit more explicit and one of the things that we wanted to do was find...

View Article

C#: A failed attempt at F#-ish pattern matching

A few weeks ago we had some C# code around calcuations which had got a bit too imperative in nature. The code looked roughly like this: public class ACalculator { public double CalculateFrom(UserData...

View Article


C#: Using a dictionary instead of if statements

A problem we had to solve on my current project is how to handle form submission where the user can click on a different button depending whether they want to go to the previous page, save the form or...

View Article

F#: Tacit programming

I recently came across the idea of tacit programming which is described as such: Tacit programming is a programming paradigm in which a function definition does not include information regarding its...

View Article

F#: My current coding approach

I spent a bit of time over the weekend coding a simple generic builder for test objects in F# and I noticed that although there were similarity with the ways I drive code in C# or Java my approach...

View Article


F#: The Kestrel Revisited

A couple of days I wrote about a ‘returning’ function that I’d written to simplify a bit of F# code that I’ve been working on. It’s defined like so: let returning t f = f(t); t And can then be used...

View Article


Iron Ruby: ‘unitialized constant…NameError’

I’ve been playing around a bit with Iron Ruby and cucumber following Rupak Ganguly’s tutorial and I tried to change the .NET example provided in the 0.4.2 release of cucumber to call a class wrapping...

View Article

Functional C#: An imperative to declarative example

I wrote previously about how we’ve been working on some calculations on my current project and one thing we’ve been trying to do is write this code in a fairly declarative way. Since we’ve been test...

View Article

Functional C#: Using custom delegates to encapsulate Funcs

One of the problems that I’ve frequently run into when writing C# code in a more functional way is that we can often end up with ‘Funcs’ all over the place which don’t really describe what concept...

View Article

C#: Java-ish enums

We’ve been writing quite a bit of code on my current project trying to encapsulate user selected values from drop down menus where we then want to go and look up something in another system based on...

View Article

Browsing index pages (13 articles)


Latest Images