3 ms·
This is a rather poor example. If you distribute the C# code above as a library, people can extend and introduce another shape, while they cannot do it easily w
by zer0nes 12y ago
This is a rather poor example. If you distribute the C# code above as a library, people can extend and introduce another shape, while they cannot do it easily with you F# code.
- noblethrasher 12y agoI did mention the Expression Problem[1] in my comment, and explicitly called out subclassing as a particular advantage of C# (the OP asked for criticism of F#). Also, even though F# can also subclass, that facility is a bit weak since it can't define protected members. [1]http://c2.com/cgi/wiki?ExpressionProblem http://c2.com/cgi/wiki?ExpressionProblem - funny thing is that the linked page coincidentally uses the exact same example code.