views:

86

answers:

2

This is a bit of a strange one but I've just seen something on twitter which kind of baffled me and I'm interested to know more.

Rob Conery tweeted the following a couple of hours ago: Class name of the day: "Maybe<T>". Method of the day: "ToMaybe<T>()". He then went on to offer a Tekpub coupon to anyone who could guess where it came from. He linked to a further tweet which had a clue and from that I worked out that it was Entity Framework Code-Only but while trying to determine the usage someone else answered to which Rob replied ...EF CodeOnly - dealing with uncertainty....

So my question boils down to what exactly is he referring to with uncertainty and how does this fit in to Entity Framework Code-Only?

A: 

It's mere speculation on my part, but I would guess that it has to do with the ambiguities that one invariably has to deal with when working with an arbitrary data store with arbitrary table names, arbitrary column names, and arbitrary queries.

I doubt very much that it reflects on the code quality of the Entity Framework in any way.

Robert Harvey
Hi Robert thanks for the answer. I wasn't (meaning to :) implying anything about the code quality of EF. In fact I have been playing around with Code-Only in the latest EF4 CTP the last couple weeks and I'm really liking it. Its just the concept that I was interested in, can you elaborate on your speculative answer?
Simon Fox
Well, think about it. They're trying to code generics against an unknown unknown...unknown. It's no wonder that some of their identifiers are the linguistic equivalent of a black box.
Robert Harvey
Sorry, I'm missing your point. Can you provide an example?
Simon Fox
The only way to do that is to get EF 4.0, disassemble it using Reflector, and look at the source code. I haven't gotten around to installing .NET Framework 4.0 yet, sorry!
Robert Harvey
+1  A: 

Maybe<T> is one of typical monads, see e.g. this Wikipedia example. Monads are widely used in functional programming: you definitely know IEnumerable<T>, which is monad as well. The LINQ itelf is sometimes described as "language integrated monads". Few more links:

Presence of Maybe<T> shows that code quality of the Entity Framework definitely isn't bad: they use well-known concept there, which is described many many times (I suspect there is no ToMaybe<T>() there - there must be ToMaybe<T>(T value) and Nothing, so it is just a Rob's mistake).

Alex Yakunin
Thanks heaps Alex
Simon Fox