Live data from Hacker News

Get Started with F# as a C# developer

blogs.msdn.microsoft.com

31–40 of 60 posts

Re: Get Started with F# as a C# developer

#31
post #26
post #20

Earlier quoted context omitted.

I can't share the code with you, but I did just that on a proprietary app for my company. Only the GUI shell of the app is in C#, and that only because the GUI builder features of Visual Studio can only generate C# code. All of the "real" code in that app is in an F# library, which you add to the Visual Studio solution just like you would any other C# helper library. When you add a source file to that library, it's a…

Were your fellow developers interested in F#? I have found most people simply don't care and don't want to learn it. And there is the famous line "Functional programming? We did functions 30 years ago. No big deal".

> Were your fellow developers interested in F#?

I was sole developer on that project.

But here's a thought for you: you can only achieve mediocrity if all choices require 100% buy-in from all interested parties.

> I have found most people simply don't care and don't want to learn it.

No one likes to have their cheese moved. But cheese moves nevertheless.

> We did functions 30 years ago.

Most people saying that probably don't realize that what computer programmers call "functions" are not what mathematicians call "functions."

The reason FP is becoming popular now is that the distinction now matters much more than ever in today's multicore world, where multiprocessing is often the only practical way to make software substantially faster.

Re: Get Started with F# as a C# developer

#32
Can anyone suggest any F# tutorials in the style of Michael Hartl's Rails Tutorial?

F# suffers from an overabundance of "getting started" tutorials that focus only on the language and syntax. I get that F# is likely to be a lot of peoples' first introduction to a functional language, so that makes sense, but this one doesn't even tell you how to run the code it's showing you.

The hardest part about learning any new language isn't learning the syntax or core concepts, it's understanding the mechanics of actually getting things done - grokking the developer workflow, getting comfortable in an editing environment, building and deploying, troubleshooting and debugging, writing idiomatic code, learning about common libraries and tools, etc.

Re: Get Started with F# as a C# developer

#33

// Flip the BST using pattern matching! let rec flip bst = match bst with | Empty -> bst | Node(item, left, right) -> Node(item, flip right, flip left) Without type annotations, how can it tell the flip takes an instance of BST as the parameter?

The variable bst is something that can be matched with Empty and with Node(item, left, right), both of which are of type BST. When two values can be matched with each other, they must be of the same type. Therefore bst is of type BST too.

Re: Get Started with F# as a C# developer

#34

Can anyone suggest any F# tutorials in the style of Michael Hartl's Rails Tutorial? F# suffers from an overabundance of "getting started" tutorials that focus only on the language and syntax. I get that F# is likely to be a lot of peoples' first introduction to a functional language, so that makes sense, but this one doesn't even tell you how to run the code it's showing you. The hardest part about learning any new l…

I think there is nothing better than the book: Expert F# https://www.amazon.de/Expert-F-4-0-Don-Syme/dp/1484207416/re...

Re: Get Started with F# as a C# developer

#35

I'll take MS's commitment to F# seriously when they stop treating it like a 2nd class citizen. .NET Core 1.0 has been out for over a year, .NET Core 2.0 is in preview and there is ZERO support for F# with .NET Core in Visual Studio 2017. Yes you can use VSCode, but VSCode is no Visual Studio - it's a text editor on steroids, not a proper IDE that most C# developers have come to expect.

Not only that, there is zero support for UWP and .NET Native.

Re: Get Started with F# as a C# developer

#36
post #7

Ask HN: I've toyed around with F# and I kinda like it but I've never dug deep enough into it to answer the question: can I use this for 'real life' code as part of an existing C# desktop application for instance, e.g. build some F# into an assembly which is callable from C#? Without tons of hassle? What are good samples of real life application code in F#?

Beware that you won't be able to deploy the code to UWP though.

Re: Get Started with F# as a C# developer

#38
post #12

Are there any simple projects like HTTP server in F# for CoreCLR somewhere? With a Dockerfile if possible. Last time I tried to build something like that for PoC the amount of struggles I had with various versions of CoreCLR was overwhelming.

Giraffe is a fantastic little project that is a thin layer on top of ASP.NET Core. Works out of the box with the provided template, test locally, deploy to Azure, etc.

https://github.com/dustinmoris/Giraffe

Re: Get Started with F# as a C# developer

#39
post #37

I need to know why to use F#, not how. C# is a business programming language. F# doesn't appear to be obviously useful in that regard.

The first sentence in that post.

"One of our previous posts, Why You Should Use F#, listed a few reasons why F# is worth trying out today"

I would argue F# is a much better business programming language than C#. Admittedly, I am not very good at it, and have barely done more than a few toy programs in it, but F# (like most FP languages) allows you to bake in a lot of the rules into the Types themselves, and immutability combined with a lack of nullness protects you from a lot of footguns.

Re: Get Started with F# as a C# developer

#40
post #37

I need to know why to use F#, not how. C# is a business programming language. F# doesn't appear to be obviously useful in that regard.

The first sentence in that post. "One of our previous posts, Why You Should Use F#, listed a few reasons why F# is worth trying out today" I would argue F# is a much better business programming language than C#. Admittedly, I am not very good at it, and have barely done more than a few toy programs in it, but F# (like most FP languages) allows you to bake in a lot of the rules into the Types themselves, and immutabil…

The link didn't copy over:

https://blogs.msdn.microsoft.com/dotnet/2017/05/31/why-you-s...

Post reply on HN