I know you can use C# and F# together in the same project however i'm not sure if its a good idea to do so.
It seems to me that mixing two very different coding styles (functional vs OO) could cause a lack of cohesion in the design. Is that correct?
|
|
There's nothing wrong with mixing languages in a product as long as you use each appropriately and they "play nice" together. If there is part of your project that would be best coded using a functional language then it makes sense to code it in F#. Similarly for C#. What would be pointless (at best) would be mixing languages for the sake of it. |
|||
|
|
|
Yes I agree with ChrisF. Also C# currently already incorporates F# principles, such as anonymous types:
That said, I personally think it's a step backward in code readability, though it is very convenient. |
|||||||||
|
I don't think you'll get a "lack of cohesion". Each language has strengths and weaknesses. Combining them on a common-language run-time lets you get closer to the best of both worlds. With C# and F#, you just want to make sure you use the intersection of the two languages at the interface between the two in your solution. |
|||
|
|