Sunday, October 12, 2008

F# Versus C#, VB, and Other .NET Languages

Why F#? What does F# provide that C#, VB, etc. does not?

1. By default, F# uses immutable types, which means that once a type is created, it will not change. This behavior makes the language inherently safe for concurrent operations. With an ever increasing need for concurrency support in enterprise applications, this behavior is becoming more and more desirable. With F#, concurrency related errors such as race conditions, synchronization issues, lock convoys, and deadlocks will be greatly reduced.

2. F# is built on the concept of functions rather than objects. While objects are supported, functions are also first class citizens. Functions can be and passed around like objects in C#/VB. This makes the language extremely well suited for algorithmic computations and makes it easier to achieve efficient processing of lists of data. Since everything compiles to IL, similar performance on these operations could conceivably be achieved with any .NET language, but F# allows optimal performance for specific operations with much less code. Note: In addition to the new abilities, you still have all functionality available in the .NET framework.

3. One of the features of F#, that I have found extremely useful, is the interactive scripting functionality. This allows the developer to select a subset of code and run it like a script. Anyone with a background it SQL will find this functionality very easy to understand and extremely useful for learning/experimenting with the language.

4. Finally, anyone with experience in C# will be thrilled to learn that the immutable aspects of F# will greatly reduce or eliminate the dreaded "Object reference not set to an instance of an object" error.

Note: F# should be added as an addition to an engineer's arsenal, not a replacement for the existing language of choice. My philosophy has always been, use the tool that is best suited for the task. Use F# in places where it can accomplish the task better and/or easier than the other available options.

Many of the points listed here are based on comments/documentation from the following:

http://msdn.microsoft.com/en-us/fsharp/default.aspx

Ted Neward: (http://msdn.microsoft.com/en-us/magazine/cc164244.aspx,
http://www.dotnetrocks.com/default.aspx?showNum=377)

The book "Expert F#" (http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?isbn=1590598504)

9 comments:

  1. Hello
    http://www.rhythmmethodlive.com/ - discount lexapro
    Don’t be attracted towards the pirated one.
    [url=http://www.rhythmmethodlive.com/]lexapro price[/url]
    The credit for the invention of this Lexapro drug goes to the Lundbeck and Forest Laboratories.
    escitalopram generic
    You should take this Lexapro drug under the experts guidance and make out all the necessary information about it before actually trying it.

    ReplyDelete
  2. meridia cost

    It is important to be conscious of these adverse effects and to seek direct medical attention during its occurrence.
    [url=http://www.buyrooibos.com/]meridia drug[/url]

    Consult your doctor for any of the above adverse events.
    http://www.buyrooibos.com/ - generic meridia
    Meridia must be combined with a healthy diet, routine exercise plan and behavioral changes to get optimal results.

    ReplyDelete
  3. Hello
    buy clonazepam
    However, discuss whether you have any kind of allergies or not with your doctor.
    [url=http://www.actperu.com/]buy clonazepam[/url]

    Do not use Klonopin unless your doctors prescribe you to.
    http://www.actperu.com/ - generic clonazepam

    Klonopin is proved to be very effective to treat patients with anxiety depression and panic disorder.

    ReplyDelete
  4. http://markonzo.edu http://aviary.com/artists/Zyprexa http://blog.bakililar.az/valtrex/ http://www.ecometro.com/Community/members/buy-hydrocodone.aspx heianji

    ReplyDelete
  5. online dating and meeting [url=http://loveepicentre.com/]best place to meet singles in colorado[/url] dating game celebrity http://loveepicentre.com/ ancientbrit personals

    ReplyDelete
  6. dating single dad [url=http://loveepicentre.com/]ult dating[/url] muslim singles france http://loveepicentre.com/ lesbian christian singles

    ReplyDelete
  7. IBM laptop battery [url=http://www.hqlaptopbatteries.com/-m55-s1412-laptopbatterymodel1706.html]notebook battery[/url] Laptop search and advice http://www.hqlaptopbatteries.com/page127.html laptop comparison
    best laptops [url=http://www.hqlaptopbatteries.com/battery-2310-batterytype1.html]laptop review[/url] Laptops & notebooks http://www.hqlaptopbatteries.com/page19.html Alienware Laptop
    High Quality Laptop Batteries [url=http://www.hqlaptopbatteries.com/-400cs-laptopbatterymodel256.html]LG Laptop[/url] Lenovo Laptop http://www.hqlaptopbatteries.com/-1200-s122-laptopbatterymodel313.html Clevo Laptop

    ReplyDelete
  8. this kind of topic is good for people to learn more about it, and that people should be every day less ignorant, and medicine for this is the reading of issues like this

    ReplyDelete
  9. Hello congratulations you did an excellent work with this blog about F# Versus C#, VB, and Other .NET Languages I would like to know more about this topic and please when you have any update contac me please to read it. thanks for sharing!!

    ReplyDelete