Thursday, 13 October 2011

Another reason I like C#

A lot of people seem to be finding their way here because of my post about finding the maximal area submatrix in a binary matrix in C#. I found this post from a couple of weeks ago which shows the same idea in Haskell. It's interesting to see a similar idea presented in a different language; especially one as awesome as Haskell.

After a couple of hours of writing in C# earlier I've found a feature of the language that I really like: indexors. They allow array-style indexing of user-defined classes, which would be particularly useful for data structures. I really like that something which has typically just been syntactic sugar for array access is available to developers. Why? Because we're too lazy to write foo.get(x, y) when foo[x, y] is also available.

No comments:

Post a Comment