@seraph_summer:

I agree with Robert and mfeingold. However, i would like to stress one additional point. The true power and benefit of .NET is its support for multiple languages in the same solution in a clean and co-operative manner. Thus, you can select the best tool for solving the problem at hand. Now, depending on the issues involved, the ideal solution might be written in C#, or it might leverage what F# has to offer, or it might require C++/CLI for bare-metal control. Heck, there might even be a problem for which VB.NET is the right solution. (Though, I've never found one!)

In truth, a professional solution to all but the most trivial of problems will likely benefit from a combination of language and technologies. Plus, as has been pointed out previously, every time you learn a new technique in one language, its an opportunity to re-use the knowledge in a different language. So, rather than asking: 'should I learn C# or F#', perhaps you should ask: 'in what order should I learn C# and F#'?

By on 6/8/2009 7:06 AM ()

I do agree your comments!

By on 6/8/2009 8:02 AM ()

I do not think that comparing "feature function set" is the right way to go here. If you would compare C# vs VB vs C++ this might work, the differences there are primarily about syntax.

With F# vs C# it is not just about syntax. It is OO vs Functional. Each one offers its own way to get to the solution of the problem you are tackling. Personally OO is so ingrained in my mind that sometimes it is difficult to find the 'functional' solution to the problem, but when you find it, almost always it is more elegant, more concise and surprisingly enough even more readable.

Going back to your question - which one I would say to be a real pro you need both OO and Functional and C# does not have much to offer in terms of Functional - nothing beyond very limited type inference (var) and lambda expressions

By on 6/8/2009 5:34 AM ()

I don't see how it's exactly OO versus Functional. Perhaps OO versus "OO + Functional". F# has most of the C# OO features. (I think support for generating "protected" members isn't in.) Implicit interfaces might be annoying too, but if you search the forums, it's been hinted that it'll be taken care of. So even in OO, F# generally the same functionality, leading it to overall being a superset. Unless I'm unaware of some C# OO stuff (quite possible).

By on 6/8/2009 8:27 AM ()

In my experience F# is pretty much a superset of C#. C# lacks the following F# features:

- pattern matching

- union types

- active patterns

- units of measure

- Tuples (admittedly .NET 4.0 will have tuples in the framework but C# won't have any language support for them)

- Sequence expressions (okay C# has yield return, but this doesn't feel as powerful as F# sequences)

- Async workflow expressions

Have you tried any of these features? I strongly suggest giving them a go then trying to implement something similar in C#.

The only feature that C# has that F# does is anonymous types, but here F#'s record types are a nice light weight way of doing something similar (though I would emphersise it's not exactly the same thing).

Plus learning F# will help learn to program in a good functional style. Although you can program in a functional style in C# I feel the language encourages you to be imperative - you still spend a lot of time allocating locals and then updating there value.

Cheers,

Rob

By on 6/8/2009 4:31 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper