Quantcast
Channel: This is an EX blog...
Browsing all 25 articles
Browse latest View live

COIL and COILettes

Douglas Crockford started a minor war when he observed that JavaScript's object initialisation syntax provides a neat way to persist hierarchical data, maybe more suitable to some situations than...

View Article



Asynchronous Sockets with Yield Return of Lambdas

Update: More in-depth stuff about thisI just watched this video of Jeffrey Richter demonstrating his AsyncEnumerator...

View Article

More on Jeffrey Richter’s AsyncEnumerator and Functional Programming

If you do asynchronous programming (or have been put off it in the past by the complexity) and you haven’t already looked at this, then you really...

View Article

Other Examples of Iterators and Async IO

The idea of returning functions via yield return to simply asynchronous IO programming has a precedent in Microsoft's Concurrency and Coordination...

View Article

Optimizing Aggregate for String Concatenation

Linq lets you think in a very generally applicable way and solve a very wide variety of problems with a few key concepts. That’s a great thing. But it’s irritating when the elegant solution doesn’t...

View Article


The Maybe Monad in C#

The Maybe Monad is extremely simple. It represents a value that might be there, but might not, and also provides a neat way of working with such values.This Haskell-related page makes it pretty...

View Article

Ora Stories

I've written an add-in for Visual Studio called Ora. You can read more about it via that link but here's some background to it.It's designed to replace a common use of regions - though I'd call it a...

View Article

Linq to C++0x

Updated 2009-01-28 - completely different approach to get a fluent interface.Updated 2009-05-22 - See new post with decltype goodness!C++ has long had some functional-styled things in its standard...

View Article


Using Collection Initializers with Immutable Lists

The Incomparable Mr Skeet mentions how irksome it is that collection initializers assume that the collection is mutable.Suppose we defined an "immutable-yet-initializable collection" as any type that...

View Article


Further Muddying the ForEach Waters

ForEach is regularly proposed as a missing feature in the BCL but has been rejected in the past apparently because it wouldn't be "functional" enough, doesn't return anything so calls cannot be chained...

View Article

A functional replacement for the using statement

The using-statement is just that: a statement. Why does this bug me?The FileStream object has a Length property. Assuming I have a function Open that returns a FileStream ready for us, it is awfully...

View Article

Displaying a nested evaluation tree from Expression

Updated: The downloadable source (see link below) is now tidied up a bit, and also displays any embedded string comparisons in a similar way to NUnit.This might be useful as a way to write Assert...

View Article

General Theory of Resources

Having blogged the other day about a different way of doing automatic cleanup, I’ve been mulling it over and also answering a question on StackOverflow, and decided that I need to assemble a taxonomy...

View Article


What's Wrong With C# 4.0's dynamic Keyword, and How I Think It Should Be Fixed

Update: Exactly what I want, already implemented, complete with caching of the call site. Also, Microsoft's Mads Torgersen responds to this suggestion here. C# 4.0 proposes to add the dynamic keyword...

View Article

Fatal Exceptions, and Why VB.NET Has a Purpose!

There’s a feature in the CLR that is exposed in VB.NET and not in C#. Apparently this is a deliberate decision made by the C# team, which so far they’ve stuck to. Unfortunately, it’s a pretty important...

View Article


Making Lambdas and Iterators Play Nicely Together

The major problem with this idea is in my favourite feature of C#. In an iterator (a function containing the yield keyword), the code is transformed into a state machine represented by a class. It has...

View Article

The Amazing Speed of the .NET Garbage Collector

Coming from a C++ background, I always balk at designs that involve lots of small heap allocations. It’s something I’m gradually training myself to stop doing, because in managed code, it’s a...

View Article


JavaScript Invaders!

Click in the small text field in the top left corner to give allow the game to receive keyboard events.Z = left X = right M = fire

View Article

Readonly Fields and Thread Safety

In C# you can mark the fields of a type as readonly (indeed you generally should if it's a struct). By doing so, you make it illegal to change the fields except in a constructor of the type.The...

View Article

General form of C# Object Initializers

C# has a language feature that allows several properties of an object to be assigned to as a suffix to a new expression, namely the object initializer:var myObj = new MyClass { SomeProperty = 5,...

View Article
Browsing all 25 articles
Browse latest View live




Latest Images