tags:

views:

412

answers:

4

These days I am interested in learning F#, and would like to use it for GUI applications. Unfortunately I have no previous background in .Net or C#. Are there any good resources (web sites, books) for learning this without going through C# first?

Many thanks in advance.

A: 

http://searchwindevelopment.techtarget.com/generic/0,295582,sid8_gci1289090,00.html

Requires registration (email address). Don't know if it's any good, but seems worth a look.

MusiGenesis
+6  A: 

The Real-world Functional Programming book that I wrote with Jon Skeet (sorry for the advertisement!) expects some existing knowledge of object-oriented languages (e.g. C#) but it briefly explains all more advanced features that C# has compared to, for example, Java.

It has a few examples of GUI programming using WinForms (a more modern framework would be WPF, but some concepts are essentially the same). You can take a look at a few examples, because there is some free content related to GUI:

  • Chapter 4 (coincidentally, available as a free sample :-)) shows how to implement application for drawing simple graphs using basic features.
  • Programming user interfaces using workflows (free excerpt) shows one advanced pattern that's very useful for writing reactive applications (as I know, this isn't described anywhere else in much details)

As far as I know, Robert Pickering's Beginning F# also has some user interface examples and it also includes some WPF examples (although I don't have the book yet, so I don't know what exactly does it contain).

However, none of the F# books will make you GUI Expert. You'll still need to spend some time learning about WinForms/Silverlight/WPF in more details. There are plenty of examples in C# on the internet and after reading one of the above, you should be able to translate them directly to F#, but buying a technology-specific book may be a good idea too.

Tomas Petricek
Can you use winform/WPF designer in visual studio with F#?
BlueRaja - Danny Pflughoeft
@BlueRaja: Not directly, but you can create a C# project just to contain the designer-generated code. See this post: http://stackoverflow.com/questions/2604589/seeing-c-windows-forms-project-code-from-f/2604735#2604735
Tomas Petricek
I've got your book Tomas and I'd say it's a great place to start.
Onorio Catenacci
I've got it too and I what I've read so far is very good. :)
Mark Simpson
Thanks for the advice. Looks like a very good book, and with the other votes I am going to buy it. One thing though, does it need actual experience in C#? The description says so. I don't have that, though I have experience in object oriented programming (Java, C++, Delphi).
Muhammad Alkarouri
@Muhammad: I think that experience with Java should be good enough. The book expects that readers use the object-oriented mindset. It uses some specific C# features such as iterators or lambda expressions, but all of these are briefly explained in a side-bar (and if you needed to clarify some details, there is a plenty of C# resources on the internet).
Tomas Petricek
@Tomas: Many thanks. Iterators and lambda expressions are certainly to be expected in functional programming. I have used them in other languages, and I am sure the side-bar explanations would be enough for the syntax. I have ordered the book.
Muhammad Alkarouri
+2  A: 

I just got the The Real-world Functional Programming book and if you want to mix F# with GUI stuff that's the book for you since it has plenty of examples and it jumps right into it. That's the main reason I got it :) Online I've come across this and I like the F#/DirectX example. F#.NET tutorials and examples

daveangel
A: 

My book Visual F# 2010 for Technical Computing has a chapter devoted to graphics using WPF and covers basic WPF controls and the use of WPF from F# interactive. There are also many articles in The F#.NET Journal that cover WPF (scroll down and run some of the downloadable demos). Our F# News often contains short blog posts with WPF-based F# applications in them, e.g. Game of Life in 32 lines of F#.

Jon Harrop