15 ms·
F# is the best coding language today
- necovek 5y agoUnfortunately, fixed width and centered code sample doesn't render nicely on mobile devices, so the argument fails to convince me (otoh, I've read good things about F# elsewhere, so I was already intrigued).
- sevensor 5y agoThere are lots of great languages out there -- "the best" will always be hyperbole -- but F# is a really good one. Strong library support, cross-platform, interoperability with C#, a type system that helps rather than hindering you. If you want or need to target .NET, F# is the place to be.
- d3nj4l 5y agoI’ve been loving F# for all those same reasons. I started out with OCaml, but the lack of a wide ecosystem of readymade stuff really made it hard to pick it up for projects. The dotnet world is probably second only to the JVM world in terms of ecosystem, and Giraffe is a lovely micro framework that beats most frameworks I found for Scala.
- deleted 5y ago[deleted]
- systems 5y agoBest Programming languages today F# - ML + .Net Clojure - Java + jvm + lisp Rust/OCaml - System Programming Both F# and Clojure give you access to probably the two biggest ecosystems, but they are obviously put them at opposite ends of the programming paradigms spectrum, but this makes learning both less redundant Rust and OCaml, are probably what you should use if you want a compiled system language Honorable mention PureScript, because haskell + Javascript (but F# will take you close and is more practical)
- kaliszad 5y agoWell, Clojure and its dialect ClojureScript (and ClojureCLR, if Microsoft stepped up and did at least something for it) are so close, you really kind of have to consider the first two as a single group in my point of view. Many projects have a frontend written for a web browser - using ClojureScript there is very natural. You can share most utility functions between frontend and backend (in Clojure) just as we do at OrgPad. GraalVM, Babashka (based on GraalVM), libpython-clj and the Python interop and other more or less Clojure related projects (its a stretch, but Hylang?) just show the breadth of the ecosystem. F# seems nice and if I had to pick C# or F#, I would pick F# but I see Clojure as conceptually stronger, easier to explain and teach, to finish projects quickly and run them reliably. Immutable datastructures, the REPL and somewhat related hot-code reloading on the backend and frontend also really is something. (I know, F# has a "REPL" but is it more a Shell or a REPL e.g. running even in production?) Perhaps I should update my views about F# sometime. With my current knowledge I see it as somewhat inferior to the Clojure/ ClojureScript duo and the related ecosystem.
- dimitrios1 5y agoThe obvious answer why F# wins over Clojure in many people's books is static typing.
- bmitc 5y agoI also get the impression that that F# sits on top of its host VM better than Clojure, although I haven't used Clojure to any great degree. F#'s error messages are actually pretty good, and integrates with .NET so well, you really don't even need to know the existence of C# when using it. I really wish .NET Core came earlier and would have enticed Clojure to stay as a .NET language.
- kaliszad 5y agoClojureCLR does support .NET (Core) but there isn't any support by Microsoft and a .NET language really need at least some support by Microsoft, to be viable at all. Clojure work great with JVM, it is very tightly integrated. Similarly ClojureScript and JavaScript, even though that is actually transpiling. With shadow-cljs, it really is quite integrated into the ecosystem.
- okennedy 5y agoOcaml sold me on the value of functional languages. F# taught me that they could be practical outside of academic projects. Ocaml's standard library is amazing, and it has a great developer community, but at the end of the day Ocaml is its own thing. F# had virtually identical syntax, but put all of .NET at my fingertips. I was using it for UDFs in SQLServer, UIs with tables and plots, and a lot more. My brief flirtation with windows ended years ago, but F# remains one of the most positive parts of that experience.
- bachmeier 5y agoThis is a reasonable article. I would like to address the part about the IDE though. All too often that discussion revolves around the advanced features of the IDE and how well it does project management. The part that's usually ignored in all that is how much overhead is involved with using a language. Not everything is a million-line enterprise banking project with 27 developers trying to integrate their work. The ability to write a program without an IDE and without configuring a project is gold. If I want to write an R script, for instance, it's nice to open a text editor and start typing. I don't need a fancy IDE or any project configuration.
- everyone 5y agoOpening visual studio is harder than opening a text editor??
- mftb 5y agoYes. Reasons; Project files going back many years and many versions of VS. These files may have been "auto-upgraded" several times. Dependency changes, locations, versions, etc... Login requirements, to SQL Server, IIS, SharePoint, various cloud things. Memory requirements, old VMs on old, overloaded VM hosts. This on a team that expended a fair amount of effort to manage and improve these things. On a long enough time line, they always creep back in. This isn't really meant as a knock of VS as much as the IDE approach.
- hawthornio 5y agoI find rich IDE features very useful for functional programming because it makes it much easier to track types via hover-over. I agree that lightweight setups are better, but being able to start a single file project with ease isn’t necessarily an indictment of IDE niceties.
- vizzier 5y agoVisual Studio Code + Ionide extension is much lighter weight than visual studio proper. FSX (fsharp script files) can then be written and executed directly and will cover this gap. Technically you don't need the former, you can pipe the FSX file directly into the fsharp interactive EXE that interprets them from notepad and console if you like.
- foxes 5y agoAs a Haskell advocate I disagree :). But if it acts as a gateway drug I am all for it.
- luftbbb 5y agoHow does one actually architect a functional service, regardless of language? Is it a traditional 3 tier approach with controller, service persistence or something more... Functional?
- flylikeabanana 5y agoAt least in my corner of FP (Scala) my preferred functional architectures are vertically-sliced modules further decomposed into data types and algebras/interpreters. I might have an `EdgeAlgebra` and a `PersistenceAlgebra` for said module, but not always.
- luftbbb 5y agoThis sounds interesting, though I'm not quite grokking the vertically sliced modules aspect. Maybe you could explain it a bit more in detail, or link to some diagram or code repo, would be awesome.
- fancyants 5y agocould you perhaps expand on vertically sliced modules, what does that mean? do you have any diagram or code we can reference to get a clear idea of the concept behind the words. thanks!
- bontaq 5y agoWe've come around to something like the "imperative shell, functional core" pattern. All the business logic is purely functional (so no database calls or side effects), and any data needs are done as close to the edge of the system as possible. You can do it in any language, FP languages can help enforce the distinction. For going even more functional, in FP languages that support it, free monads and effect systems allow you to define interpreters for effects and you can write code more or less like you would non-functionally, but the interpretation can be pure (say hardcoded results for a query) for tests, and impure for actually running. Basically fancy dependency injection, but for everything.
- luftbbb 5y ago
- thrower123 5y agoThe main thing that holds me back from using F# more is that the tooling is simply not up to par. Things as basic as doing a rename refactoring automatically are not really supported, or popping out part of an expression into a temporary variable with a hotkey. Depending on what you are used to, that might not be a huge problem, but the drop-off from the experience of working in C# or Java or even Python with modern tooling is stark. I wish that there was an F# zealot or three working at JetBrains lobbying for better support in Resharper or Rider.
- d3nj4l 5y agoAre you not using Rider? Because all the refactor stuff you're talking about works out of the box for me in F#/Rider.
- throw868788 5y agoThat stuff works out of the box even in VS Code for quite some time now, yet alone Rider. I'm not sure your comment is up to date? Can see it supported in this blog post: https://blog.jetbrains.com/dotnet/2019/01/07/typing-assists-code-analysis-unused-opens-f-updates-rider/ https://blog.jetbrains.com/dotnet/2019/01/07/typing-assists-...
- reader_mode 5y agoI haven't been in .NET for a couple of years but I've worked on quite a few .NET projects over the years. I've seen F# being added to 3 (as far as I can remember), in completely different companies/teams/contexts - and it always ended up being the same - some enthusiastic guy (or a few of them) tries to sneak in F# as a part of the system. They don't really gain traction with the rest of the team because people have shit to do and no time to study a new language at work, so it becomes "their own thing". Regularly the tooling breaks (eg. visual studio intellisense stops working on C# projects if you don't disable F# projects, builds randomly start to fail, etc.) The person who introduced it becomes the go to guy for these problems, coupled with no traction for his pet project and being a motivated developer - they leave and now the project has this magic F# part that nobody really knows how it works but everyone knows how to work around. IMO C# is picking up a lot of small things that make it incrementally better than it was before, and at some point it's not worth the hassle to go to F#. F# features are gradually added to C# so C# developers have time to pick them up as well. I've heard of F# only projects doing great, but I think you need to have a team committed to doing F#. Back when I was into Clojure they had this mantra of "add Clojure to your work projects as a library and pretend it's just this small thing you used to solve some problem because it's all on JVM and Java compatible and then keep expanding on it" - I think this turns out terrible in practice.
- __s 5y agoI've been that guy. & yeah, found greener pastures a couple years later No regrets, canopy was an absolute pleasure to use https://lefthandedgoat.github.io/canopy https://lefthandedgoat.github.io/canopy
- spywaregorilla 5y ago> No regrets The victim of this pattern is not you
- __s 5y agoI have a conscience, if I did anyone wrong, I'd regret it; the code I left behind has stood on its own
- GiorgioG 5y agoI'm still waiting for MS to put some real resources behind F#.
- swiley 5y agoYou'll just end up with telemetry in the compiler you have to download to bootstrap everything.
- pjmlp 5y agoThe main person that was really pushing it has recently left Microsoft. He has been the best PM for F# so far. Naturally everyone is free to change careers and all the best to him. Now F# needs another PM with the same passion.
- bruce343434 5y agoprogramming language*
- colonwqbang 5y agoNo justification for why F# is so good, just an assertion that it is. How about showing us some of the parts of the language which are interesting, giving examples of how it compares to other languages etc.
- efa 5y ago>>Most coders are interested in learning how to code in a purely functional manner I didn't realize that was true. Long time coders or newbies?
- sodapopcan 5y agoI scratched my head about that too but I took it mean that functional programming concepts has its place in all paradigms and, well, I guess it still doesn't validate the statement, haha. But ya, lots of people advocate for writing OO in a functional way _when possible_. Only mutating when it's necessary or far more convenient has great benefits.
- intrasight 5y agoThis is a bit like saying that Esperanto is the best teaching language. That may be true (I've no idea), but why invest in a language that is only spoken by 2 million people? I've been wanting to play around with F# for years. Perhaps some day.
- JTon 5y ago> ... but why invest in a language that is only spoken by 2 million people? The classic chicken and egg problem
- Zababa 5y agoI don't think the metaphor holds. You don't need anyone to use F# to run F# on your server. Sure, you have the library problem, but you can easily use C# libaries, so the problem isn't as big as with something like OCaml.
- AnimalMuppet 5y agoBecause someday you're going to want someone other than yourself to work on the code. Or, even if you don't want it, the company will.
- Zababa 5y agoHiring is another problem entirely. If you need lots of people very quickly it'll be hard for F# to compete with something else, but for every other case I don't think it's so clear cut. People that use and like F# really want to work with it, and are usually more experience programmers than people that know only C#. Thus, hiring for F# makes a great filter. Considering how hard interviewing and hiring is, having another signal is a good thing. Maybe building your startup that needs 100 new people every year on F# is a bad idea, but for enterprise projects that don't move much, it seems a reasonable choice.
- AnimalMuppet 5y agoHiring isn't a problem if you want to use a language for your own project or for your own learning. Do whatever floats your boat. Hiring (or having others on the team who can work on the code) is a problem if you want to use a language in a company. (I mean, it's not if you just want to write a one-off program. It is if you're writing a program that is going to survive for a long time and be depended on by others.)
- irateswami 5y agoI fail to see what problem F# solves that is not already done as well or better in Go, Rust, or Python, coupled with the wide acceptance and/or hype among other developers for those languages.
- bgorman 5y agoType safety, expressiveness, consistency. Once you use an ML, it can feel like all other languages are stuck in the 70s.
- bmitc 5y agoI feel all one really needs is a Lisp/Scheme and an ML. Imagine if software engineering had coalesced on these two!
- shpongled 5y agoI really wish Standard ML had a bigger (I'd settle for active) community, a package system, and modern IDE support. Rust feels like the closest thing to me in terms of overall practicality/ease of use.
- bayesian_horse 5y agoI agree somewhat. F# is a decent language, even in some aspects "better" than Go, Rust or Python, but it is late. I think F# does have a much stronger "in the browser" game. Yes, even a bit more than Rust, if you consider whole web applications and not just performance critical modules. And some people and companies are extremely stuck in Dot.Net...
- lbriner 5y agoYou are implying that people that use .net are stuck. I would say it is hands-down the best general purpose web programming language and also the goto for programming Windows apps. Sure I can write stuff in Go or Rust or Python but I don't see that any of those offer anything significantly better than .Net, including the support level, the quality of the IDE and even, God forbid, half-decent performance. Sure I would choose another language for something that had to be super fast or perhaps headless but otherwise I would choose .Net every time. Disclaimer, I have professionally used Java, PHP, C, C++ and C# but not Go or Rust.
- uncomputation 5y agoWas excited to read this as I have always been somewhat intrigued by F#, but this article is missing the remaining 80% and all of its actual meat! The author talks about “oh, what really separates languages in the real world isn’t syntax but rather the development experience and job market” and then immediately shows only syntax and signs off (literally).
- felipellrocha 5y ago> Most coders are interested in learning how to code in a purely functional manner, but don't know how to do so. Lost me. This is not true, by far.
- lbriner 5y agoHaha. Exactly what I thought. A lot of developers probably don't even know what it means let alone want to learn it.
- bayesian_horse 5y agoWhat currently interests me in F# is that it has two viable options for being used in the browser - one over WASM (Bolero via Blazor) and one transpiled to JS(Fable). It is therefor become an interesting alternative to TypeScript/Redux and Clojurescript/Reagent.
- proxyon 5y agoWhat in the world does TypeScript have to do with Redux?
- bayesian_horse 5y agoAt least in my opinion this combination is very common and beats many similar alternatives. Also, Redux does make working with TypeScript slightly more difficult and verbose, at least in my experience, but I may just not be doing it correctly. The paradigm behind Redux and the Boilerplate that I end up with is what drives me to look for alternatives to Javascript and Typescript.
- deleted 5y ago[deleted]
- exdsq 5y agoEvery-time I see an F# post I have to share this series: https://fsharpforfunandprofit.com/series/designing-with-types/ https://fsharpforfunandprofit.com/series/designing-with-type... It's amazing
- progmetaldev 5y agoThis series really helped me start understanding F#, along with some general functional programming concepts. I still have issues with certain topics, coming from a strict OOP background, but at least with C# I am able to reason about things a bit differently due to experimenting with F#.
- Optimal_Persona 5y agoAgreed, I'm also having a great time working through Scott Wlaschin (that linked site creator's) "Domain Modeling Made Funtional with F#" book. One of the best primers on the business process analysis/user needs gathering - development cycle I've found.
- drgiggles 5y agoI really love Scala for all of these reasons, it also has the benefit of being used frequently in industry (big data, etc).
- Rioghasarig 5y agoThis article is missing so much. He keeps saying F# is the best but doesn't describe anything about the language. He discussed the criteria he was using but didn't say anything about how F# excels in these criteria. It feels more like an introduction section than a whole article.
- kerblang 5y ago> If you want to personally pick up a programming language in order to become a better coder in whatever other languages you use, F# is the best overall teaching/coding language you can find. Great, we're back to this nonsense (also promoted by Haskellers) right off the bat. The best way to learn the language you use is to learn the language you use, period. If you want to be good at C, learn frickin' C. No, F# is not going to help. Certainly if you just want to learn about "functional programming", yes, find a relatively completist FP language that that looks easy to learn (F#, maybe - Java, nope), and you'll find it easier to learn other functional-programming languages after that. It's also a good idea to learn new programming languages in general, just to expand your career potential and also make better decisions about what to use (if and when you are ever allowed that choice...). Actually, if you want to learn one language that will make you better at all others? Assembly. Yeah. This is not because Assembly is The Greatest Thing Ever, but because you'll understand the magic behind the curtain a lot better, and be a lot more immune to the incessant nonsensical daily hype around programming languages. For bonus points, learn to write your own compiler/interpreter (but don't feel compelled).
- eterps 5y agoIf there were F# implementations without .NET I would have used it a lot more.
- nerdponx 5y agoThere is Fable (https://fable.io/ https://fable.io/) which compiles to Javascript.
- jkelleyrtp 5y agoFrom TFA > If you want to personally pick up a programming language in order to become a better coder in whatever other languages you use, F# is the best overall teaching/coding language you can find. I can't speak to F# at all, but I can to Rust, in this regard. I haven't heard many people say this before - writing F# makes you a better programmer - but mostly that F# people are GSD types of people. In contrast, I commonly hear other people talk about how dealing with Rust's strict compiler and clippy's lints help them improve their skills by rejecting bad code. In C, C++, Python, and JS, there's limited "guardrails" so most learning or improvement is mostly self-motivated. In Rust, the guardrails are strong that many people learn a thing or two about project structure, memory allocation, performance, semver, etc. I just feel like this claim for F# is pretty strong, when the primary argument seems to boil down to "you can change your coding style over time." Does F# have as nearly as strict and helpful compiler as Rust - or any other language built-in tooling?
- bmitc 5y agoIt is my opinion that F# is the best designed modern language. With .NET 5's cross platform performance and F#'s language features, I think one is hard pressed to find a better designed language. The design yields an optimal balance between the functional, OOP, and imperative paradigms. The problems with F# are that .NET was originally Window's only causing the creation of a separate run-time in Mono, there were breakages when .NET moved from .NET Framework and Mono to .NET Core (now .NET 5), problems with messaging F# as a C# replacement, biased perspectives of F# as a Microsoft product, Microsoft's lack of investment in and marketing of F#, and F#'s overall ecosystem. There's also the push and pull that comes from some developers wanting to make F# into Haskell, whereas I think that's against the natural settled state of F# as a multi-paradigm practical language. One can write F# basically as one would write Python, yet F# comes with a host of improvements over Python. One could even go full OOP in F# like one would in C#, again with improvements of conciseness and readability. With F#'s functional paradigm but non-insistence on purity, one gets a language that allows you to write beautifully correct code that works and doesn't fight against you. I use F# in my side projects and also some small work projects, and when using F#, it feels like I'm just translating a specification into code where when done, the code just works. Unfortunately, the F# ecosystem is not as coherent as others. Probably the comparison I would make is to Elixir. Although I'd argue Elixir isn't as nice of a core language as F#, Elixir's ecosystem and coherence across that ecosystem is very nice and yields a great development experience. The Elixir community has rallied around certain ways of doing things and frameworks where it feels F# is a little more spread out.
- throw868788 5y ago> marketing F# as a C# replacement I agree with this; it should of never be marketed this way. For me C#, once you get past a lot of the initial ceremony of the language and all the libraries/OO patterns you need to learn (DI, mocking frameworks, etc) the gap between C# and F# gets a lot smaller. C# isn't a bad language and has a lot of features, it just also has a lot of history that adds complexity. IMO the benefit of F# and other newer languages is about simplifying things while keeping the same level or more expressive power. If you've already learnt all the patterns and frameworks in C#, have reasoned around the historical complexity and the ways around things seem second nature to you there isn't much to gain and some things to lose (e.g. familiarity, politics, fear of change, support). Grab a Go, Python, JS dev however and show them idiomatic F# code vs idiomatic C# code (with tests, and scaffolding) and from first hand experience I've seen what they choose. Even more so because typically these people typically use tools like VS Code and not a full blown IDE, where F# has the advantage at present.
- UncleOxidant 5y agoAn assertion without much of anything to back it up.
- Semiapies 5y agoIt was a complete nothing as an advocacy post.
- pjmlp 5y agoI love F#, but it will be always third to VB and C# on the .NET ecosystem. At least there is still C++/CLI behind it, in the set of tooling and .NET frameworks coming out of Redmond. Anyway, the next .NET Conf focus will be on F#. https://focus.dotnetconf.net/ https://focus.dotnetconf.net/
- oaiey 5y agoIt cant be behind VB. No way. The only reason VB could be in a better shape is because it is in Roslyn compiler next to C#. But nobody talks, onboards or plans a future on VB.NET. The lack of interest from the .NET team is staggering. And there is no VB community as strong as the F# community.
- pjmlp 5y agoVB is everywhere in many life science companies as Office companion (yes VB not VBA). It is not managed by a secondary team. With a few exceptions, every Visual Studio tool targeted for .NET development also does VB.NET. The enterprise developers, those that Hanselmen calls dark matter developers, are more likely to use VB than F#, then leave and do something completely unrelated to work. Maybe that isn't being strong, but it gets the job done.
- oaiey 5y agoAgree with that (there is a lot of dark matter), but I would not call it "managed". They try to stop it, customers complain, they do the minimum to support it, repeat. For a decade. There is still no VB plugin for VS Code. They completely missed the chance to bring VB to Linux. To Notebooks. To Blazer. To Razor pages (vs eg php). It is not advertised, it is never considered for first wave and most of the time never considered for a use case. Compared to that, F# is managed (by a peer of the C# group), advertised, and arrives everywhere.
- jcelerier 5y agoF# is nice and has a lot for it, but to give a data point, I wrote a fair amount of OCaml which is fairly close, and found it to be very subpar when compared to my main language (C++) for most tasks. Especially the tooling is dire when compared to the C++ IDEs, the Clang tools, etc. And I find VS to be absolutely terrible in every aspect when compared to Qt Creator so the idea of using it for F# does not feel appealing at all.
- hota_mazi 5y ago> I'm doing my best not to make grandiose claims > F# Is The Best Coding Language Today Mmmhhh...
- kbd 5y agoI was hoping for some meat to back up the grandiose title but this article was nearly content-free.
- ur-whale 5y agoArticle is quasi devoid of content.
- SebastianFrelle 5y agoI've been writing small programs for fun in F# for the past couple of weeks. It's nice. My main frustration with it is its lack of community. The Elixir forums are absolutely terrific; there is seemingly tons of knowledge sharing going on between passionate members of the community. The same with most other languages: if I Google how to solve a specific problem, an answer or an answer to an adjacent problem will pop up. That's true for Swift, Go, C#, Python... It's not true for F#. F# seems to me almost like a dead language judging from the lack of relevant Google results, zero YouTube presence, no jobs where I live (northern Europe). Is there a vibrant F# community somewhere online that I've missed?
- pbiggar 5y agoIt's pretty vibrant on twitter and my Stackoverflow questions have gotten answered as soon as I ask them. I think in terms of actual community they have a discourse but it's dead because it's so hard to sign up for.
- Nelkins 5y agoIt's on Slack. See a previous comment of mine: https://news.ycombinator.com/item?id=24981397 https://news.ycombinator.com/item?id=24981397
- dharmaturtle 5y agoAlso Discord, though a bit smaller than the Slack: https://discord.gg/R6n7c54 https://discord.gg/R6n7c54
- PicassoCTs 5y agoWish the title-logo wouldn't contain those white cut out blotches.. looks unprofessional. Wish granted. https://imgur.com/a/PODd0Iv https://imgur.com/a/PODd0Iv
- surfingdino 5y agoNo, it is not. The best coding language is the one that pays the bills. F# is not it.
- carnitine 5y agoPlenty of people pay the bills with F#. And Haskell, Lisp, k, OCaml etc.
- fancyants 5y agoexactly, and more to the point, in these places colleagues are often of a higher caliber, and salaries are much higher to boot.
- dharmaturtle 5y agoWhen I was interviewing for F# positions, I was getting offers that were ~50% more than what I was getting for C# positions. YMMV of course. The quality of engineering at the F# positions was also obviously higher.
- pbiggar 5y agoCompletely agree. I've run the gamut and probably used every language out there. I'm 40,000 LOC into F# and I love it.
- reverseblade2 5y agoIf you don't what fable is, you don't have any idea about how powerful f# can be.
- Stormwalker 5y agoThis totally true. I am Python developer by day, I took OCaml course, and it has improved my way of thinking about problems. I do not write OCaml for money, but it feels in every line I write.
- zabzonk 5y agoWhat major piece of software, say a compiler (not an F# compiler), a word processor, a browser, or something of that ilk, is written in F#?
- mikaeluman 5y agoF# has grown a lot, and ha already been around for quite some time now. So long as Microsoft makes sure F# is 100% supported in jupyter I see myself using it more and more to replace Python. One huge item missing is a data frame library though. They started developing one last year but since then I have seen nothing. Without dataframes it’s hard to convince myself to spend the time doing analysis. And Deedle is not up to par with pandas unfortunately.
- PoopMannen96 5y agoFound the unintelligent corporate dev