This is the second in a series of posts documenting a from-scratch indexing application I’m building in F#. The first post in the series gives a good overview of the application. I’ve gone ahead and put the source up as well, so you can skip straight to that if you think I’m a jackass.
Now [...]
When I first started dabbling in F#, I really struggled to understand how someone (in particular, me) would sit down and start writing an application from scratch. Project Euler puzzles are a great way to learn syntax (and probably the best place to start), but I would have loved to see a real application’s source [...]
Wednesday, April 16th, 2008
So, shortly after adding the more in depth examples in my last post, I started playing around with the TryParse method in C# to see how “nice” I could make the example code:
public class User
{
public int Age { get; set; }
public DateTime SignupDate { get; set; }
[...]
Value types in the .NET framework tend to have a static TryParse method for converting a string to a typed value. Well, most of them do, the Guid type doesn’t for some reason. The method takes a string and an output parameter for the result.
Output parameters suck and require a local variable to be passed [...]