Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the advantages of F# over C# for enterprise application development? [duplicate]

Tags:

c#

f#

Possible Duplicate:
What are the benefits of using C# vs F# or F# vs c#?

My team is currently using C# .NET to develop enterprise applications for our company. We have a history of Winforms dev, but are now moving over toward SilverLight.

My boss recently saw a video on F# and thought it looked pretty exciting, and he has asked me to check it out. My question is this - what advantages would a functional language (like F#) give over an OO language (like C#) in the realm of enterprise application development?

I really want to see if there are any compelling reasons to even begin contemplating a shift. Some F# and C# comparison code might be nice to see as well.

like image 260
Craig Schwarze Avatar asked Feb 04 '10 22:02

Craig Schwarze


People also ask

What are the six advantages of friction?

Advantages of friction are below: Automobile brakes employ friction just to stop the vehicle. It assists us in walking on the earth. Friction causes asteroids or stones to disintegrate throughout the atmosphere prior to actually approaching the entire planet (Earth).

What are the advantages of F test?

F-tests are surprisingly flexible because you can include different variances in the ratio to test a wide variety of properties. F-tests can compare the fits of different models, test the overall significance in regression models, test specific terms in linear models, and determine whether a set of means are all equal.


1 Answers

You can express a lot of concepts much more concisely in a functional language like F#.

Functions are first class objects, and can be applied directly to collections to perform transformations/filtering much more efficiently.

Immutability is encouraged in functional languages, and this makes (for instance) multi-threaded code much more reliable (you know data structures aren't changing under you).

By being able to write multi-threaded code more reliably and more easily it's much easier to take advantage of multiple processors/cores (increasingly important now Moore's law doesn;t apply so much).

Note that you can use your existing C# objects within F#. As such, you may want to write certain parts of your code in F# and other parts in C#. You should be able to mix and match according to your requirements and the suitability of each approach.

like image 91
Brian Agnew Avatar answered Nov 15 '22 17:11

Brian Agnew