Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Imperative programming in F# is much better than people would lead you to believe. F#'s <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc234058059" rel="nofollow noreferrer">match statement</a> is awesome. Why other languages have not implemented it I don't know. As far as things like syntax (mutable, ref, etc) they are easy to work with. You get spoiled by F#'s sparseness and it's easy to complain when the syntax is bigger than normal. <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc234058031" rel="nofollow noreferrer">Tuples</a> are also great. They will be in C# 4.0 too. <a href="http://en.wikipedia.org/wiki/Currying" rel="nofollow noreferrer">Currying</a> is another bonus for Imperative.</p> <p>Concerning OO I find I rarely use inheritance in pure F# projects and favor composition and interfaces instead. This is mainly due to using the <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc234058129" rel="nofollow noreferrer">primary contructor</a> that allows you to use it's parameters as private properties in your methods (not sure if I worded that correctly). Other language constructs such as pattern matching pull you away from inheritance too. I've not done any mixed projects C#/F# so I can't comment on that. </p> <p>F# isn't all roses.</p> <p>My biggest issue with F# and game programming is performance. Implementing in F# is really fast and I often get a prototype up and running for what I want to do the same day I think of it however I find myself rewriting code for performance reasons way more often than in C#.</p> <p>Part of the problem is my inexperience with functional programming style that is to use Seq, List, Map and all their accompanying methods such as map, iter, fold, scan. My first functional solution is almost never the fastest while my first procedural solution is almost always close to the best possible. I want to say part of this isn't me. That functional programming doesn't lend its self to performance in some situations.</p> <p>I use less of the functional data types in F# now than when I started.</p> <p><strong>EDIT:</strong></p> <p>Many months have gone by since I've posted this and I no longer have issues with performance. My first functional solutions are often simpler and nearly optimal now and immutable data structures are simple. The only performance issues I have now are with the CLI and I can always do c++/cli if I need to. I do use some inheritance besides interfaces now but it's only for anonymous objects.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload