f# as choice of first language learned ?

問題 f# as choice of first language learned ?

  • Saturday, April 13, 2013 10:59 AM
     
     

    Hi,

    I never learned a programming language, and want to learn programming for development of web sites, web apps, windows apps etc etc....

    I was thinking of starting with c# as language for great IDE environement, and all possibilities offered by this language.

    Then I read about f#, and am now considering it because it's functional programming and you can write javascript with compiler of websharper which can be very usefull for me. I like this idea of learning just one language and still be able to do lots of things.
    Why not jump directly to functional programming then ? Since i'm "virgin" programmer, why not get highest standard habits right from the start?


    What are you opinion on this reasoning ? Is f#as first learning language a good choice ?


    • Edited by Brakkar Saturday, April 13, 2013 11:00 AM
    •  

All Replies

  • Saturday, April 13, 2013 12:12 PM
     
     
  • Friday, April 26, 2013 9:55 AM
     
     

    I doubt you'll learn much of value from Python. It's a dynamically typed OO language with pleasantly lightweight syntax. Other than giving you even less protection (and speed) than you'd get from C#, you'll be writing the same programs, just in a slightly different dialect.

    F# is a different beast altogether. It has a rich, statically checked, polymorphic, algebraic type system. It is mostly functional, which means it strongly encourages you to program declaratively and avoid side effects (such as assignment) wherever possible. This has several benefits:

    • the compiler will catch many more errors than you'll be used to;

    • your programs will be much shorter;

    • your programs will work first time (once the compiler has wrung out all the bugs it can find) about nine times out of ten, in my experience;

    • the compiler can typically generate much, much better code.

    I usually reckon it takes an imperative programmer about a month to rotate their thinking into the functional style. The downside is that after you make the adjustment, the programming mainstream just feels rather primitive and awkward.

    Go for it, it's eye-opening.

  • Monday, April 29, 2013 4:18 AM
     
     

    Hi,

    I never learned a programming language, and want to learn programming for development of web sites, web apps, windows apps etc etc....

    I was thinking of starting with c# as language for great IDE environement, and all possibilities offered by this language.

    Then I read about f#, and am now considering it because it's functional programming and you can write javascript with compiler of websharper which can be very usefull for me. I like this idea of learning just one language and still be able to do lots of things.
    Why not jump directly to functional programming then ? Since i'm "virgin" programmer, why not get highest standard habits right from the start?


    What are you opinion on this reasoning ? Is f#as first learning language a good choice ?


    My personal opinion (based on my own experience) is simple.

    F# is part of functional programming language, it is not a general purpose programming language in common sense such as C# and Visual Basic. I said "common sense" means that F# is targeted for data centric, analytic and parallel processing applications instead of general purpose application programming with rich UI.

    To sum up other opinion such as Hiro's opinion, he is right about F#. F# is static and strongly typed, functional programming language that puts emphasize on functions with no distinction of function and data. Functions in functional programming is first class, no difference in treating data and functions.

    It is different when concerning separation of data and code, like common OOP language does. F# itself support OOP, but to degree that it is immutable by default, not mutable by default.

    Because of main focus of F#, in my opinion, F# it is not quite desirable for junior developers to quickly jump to F# if they wish to create application with UI quickly. Again, F# main focus is not visual UI development (this is why it has no visual UI in IDE support).

    But to fully leverage F# powerful features and functional paradigm, you can use C#/Visual Basic as the UI project and then mix with F# as the business logic and for handling asynchronous needs such as those in Silverlight, Windows store app (for WindowsRT/Windows 8) and to provide responsiveness to WPF application.

    The mixes of knowledge of F# and C#/Visual Basic is very worthy in the long run too, as these programming languages are supported by Microsoft and they are included in Visual Studio especially F# since Visual Studio 2010.

    The order of study (whether F# first or not) is not so important in my opinion. But if you are studying F# first, then studying C# and Visual Basic will be easier because of richness concepts of features in F# is richer than C#/Visual Basic. Also many F# features are often later implemented in C#/Visual Basic, example of this is Asynchronous computations in F#.

    There can be subtle differences in coding semantics between these languages, but interoperability between them are usually not an issue at all.

    I will not recommend starting from Python or Ruby as these languages are dynamically typed. The coding habit going from dynamic type to static type is quite dangerous and longer to get used to, instead of the reverse. Also from team development perspective, having static typing support is clearly the best choice when reading and debugging thousands lines of codes of your team member.

    Regards,

    Eriawan Kusumawardhono

  • Friday, May 03, 2013 7:41 PM
     
     

    Thanks for all your answers.

    F# looks really interesting and powerful, but I finally decided to learn c# as my first programming language.
    There are a lot of c# books, resources for beginner programmers, big community.... so the approach seems a bit more friendly. Also c# is well established and has excellent support to develop third party native applications on iOS and android with framework like Xamarin.

    I still plan to learn f# but as my second language, maybe a year from now. I think i'll then be able to appreciate the full benefits of this language, and combine it with c# for vast development potential.

    Anyway the road is though, and I have A LOT to learn with c#.

  • Friday, May 03, 2013 8:02 PM
     
     

    Yes, C# definitely more popular language.

    But keep in mind that Xamarin is just added support of F# to it's framework :)


    Petr