Over the past few months, I've been hearing more and more about the use of functional programming concepts and also languages like Haskell and F#. While some of the initial musings that I've read revolved around how the concepts have been around for decades and that it makes financial and scientific applications easier to read and write, I couldn't find a good reason to start learning it for my typical line-of-business application design and development job or even some of my basic hobby projects. Nonetheless, I kept getting drawn to the concept and have decided to focus on learning it.
This post marks the beginning of a new series that I'll be writing to discuss how I'm going about learning F#. While I'm not saying that my method of learning is ideal and should be followed by others, I'm just reporting how I'm going about doing it. Over the course of this series, my goal is to provide other .Net developers a(nother) resource for learning the F# language as well as apply the language into some non-financial or scientific scenarios.
Series Table of Contents:
- Finding Resources
Where To Start:
One of the challenges of learning anything is to find where to start gathering the necessary information on the subject matter. Thankfully, there's already a great number of sources that can be used to learn F#. Here are some that I've been using to get started in F#:
- StackOverflow.com's F# tagged Questions
- Foundations of F# by Robert Pickering
- Expert F# by Don Syme, Adam Granicz, and Antonio Cisternino
- MSDN F# Developer's Portal
Of these 4 resources, I've so far leaned on StackOverflow and Expert F# the most. I have examined only a little bit of the MSDN site and have been using it if I cannot find my answer on StackOverflow. I initially began reading Foundations of F#; however, I was having a hard time building on each chapter. Expert F# flows a lot better and also build on each previous chapter which makes it ideal for learning.
Why am I learning F#:
I'm learning F# in order to broaden my skill set into functional programming. Initially, there wasn't any other reason for that. I looked at OCaml, Haskell, and F# as all possibilities and eventually settled on F#. Since then, I have began seeking a better reason for learning F#. Many of reasons presented in interviews and blogs and books talked about it's use in financial and scientific fields of study. While this is fine, I was still looking for more since I, like many other developers, am not in those fields of application development often. After diving deeper, I found that F# is a very concise language that allows developers to write some code faster and in a more logical way. Where as there is a large amount of code used to write a program in OO for the sake of being OO, F# allows a very simple and straight forward syntax to write programs or pieces of .Net applications in a functional manner.
What F# can do:
One other thing that I was fooling myself with once I began learning F# was this idea that it could or couldn't do something that a different .Net language could. It wasn't until I began reading Expert F# that I truly understood how narrow minded I was being. In Expert F#, the authors do a fantastic job at illustrating not only the language in a general sense, but also how to apply F# as a replacement to VB.net or C# in applications like ASP.Net, Winforms, and even Domain Specific Languages. While, from what I can tell, many people agree that replacing C# or VB.net with F# in the ASP.Net realm isn't the best or most recommended application for the language, it does illustrate the point that F# can do anything that C# or VB.Net can do today.
Where does F# fit:
I have a feeling that I may be skewered a bit for this; however, this is just my perception as a novice F# developer at this point. I've been developing in Microsoft technologies for years now and have also done work in other languages. Where I see F# fits is where you have functional steps of processing of data. I can see F# being a great language for writing the data engines for custom ETL applications and processes, as well as similar business logic processors. I am certain I'll find additional locations that would assist me in my daily development job as I learn more of F#.
Next up in the series we'll dive into setting up VS2008 with the F# CTP and write the ever so popular "Hello, World!" or something like that :-). Until then, I highly recommend checking out the F# resources mentioned above and also read a lot of the questions currently out there on Stack Overflow.