When you think about programming languages used in the enterprise, names like Java, C, and C++ probably come to mind. One that probably doesn’t is F#, the open source functional language created and backed by Microsoft. You probably think of F# as a fringe language, used by more adventurous types for experimentation or specialty programming, such as for finance and data science. However, a recent survey of F# users suggests that the language may be making more headway in the enterprise than you think.
The survey was conducted online by fsharpWorks, a U.K.-based company that offers F# training, consulting, and development, and it garnered responses from more than 500 F# users. I recently spoke via email with Scott Wlaschin, a partner at fsharpWorks, about the survey results and the general stats of the F# union.
Older developers are trying F#
While some may consider a language like F# to be one that more seasoned developers might shy away from, the survey results suggest otherwise, as 67% of respondents reported to have been programming for 10 or more years. “So that shows that older developers are less conservative than you might think,” Wlaschin wrote to me.
F# is being used in the enterprise
Of the survey respondents, 62% reported that they work in enterprise development and 42% said they had used F# for internal enterprise projects. That result caught my eye and it was one of the more surprising findings for Wlashcin, too. “Given that functional programming is often considered esoteric and impractical, I was glad to see that almost 2/3rds of the respondents work in enterprise development,” he told me, “Also, it was nice to see that almost half the respondents are actively using F# at work for real projects. And in most of these situations, it is officially endorsed.”
F# isn’t only being used on Windows
37% of respondents reported that they develop F# applications on Mac or Linux, while a similar percentage (35%) are deploying F# code to those platforms as well. Wlaschin notes that this may surprise some people but not him. “The F# community works hard to ensure that F# is a great cross platform language, and we hope to see these numbers increase in the future.”
Lack of code, documentation, and tooling are F#’s biggest problems
When asked what were the most frustrating things about learning F#, respondents’ top answers were that there’s not enough real-world code to learn from (53%), there’s a lack of good tutorials/documentation (35%), and that they don’t understand the compiler errors (20%). Similarly, the top three most frustrating things about developing applications in F# were the less sophisticated tools for refactoring (49%), having to work with C#-centric tooling (47%), and difficulty in troubleshooting (21%).
These findings were reinforced by some additional comments made by developers about the survey in various online discussion forums. For example:
“... I've found quantity of documentation to be an issue. All in all, it is pretty frustrating....” saosebastiao
“I literally know of only a single pure F# application tutorial on the internet, Scott W.'s Calculator, and the style reads more like Java than any idiomatic FP code I've ever seen. There's scattered bits here and there elsewhere, but none actually present a complete picture of the process. They wind up resembling, as one survey respondant suggested, feeling like the old 'how to draw an owl': Step 1) draw the eyes, Step 2) Draw everything else.” jarcane
“When most F# code visible on the web is toy code, that leaves the impression that F# can only solve toy problems.” Warren Young
Wlaschin said that the F# community is aware of these problems and is actively working to address them. All in all, though, Wlaschin found the survey results very encouraging for the future of F#. He also feels that, based on his observations, interest in F# continues to grow. “Judging by the increase in traffic to F# blogs, attendance of F# talks at conferences, and so on, it seems that interest is growing consistently,” he told me.
Wlaschin feels that adoption of F# at the enterprise level will also continue as existing trepidation about it fades away. “At the corporate level, though, it seems to be that a new language like F# is considered risky, even though the benefits of adoption (more correct code, faster development times) are quite clear,” he wrote to me. “I think that this fear will be gradually be eliminated as functional programming becomes more familiar and acceptable.”