Hacker News new | ask | show | jobs
by smoothdeveloper 3400 days ago
Thing is that putting together short helpers for the "nasty" bits often revolve around 1 line helpers.

You can do so along the way without focusing so much on doing idiomatic FP and achieve both pragmatic and palatable results.

Designing solutions with the type system enabled by F# and it's ability to interop with whole .NET ecosystem is really a powerful combination.

1 comments

It's very hard to do it along the way if you aren't familiar with C# either. Now you're struggling to get your head around both paradigms as well as however the thing you're trying to do works.

I doubt I would have ever stuck with Clojure longer than a day, for example, if it wasn't for this library. It's not very long and all the functions are very short, but it meant that everything I needed from the file system was a 30s peek at the documentation and exactly what I expected rather than ~30+ minutes futzing with Java and forgetting what I was doing in the process https://github.com/Raynes/fs

> It's very hard to do it along the way if you aren't familiar with C# either.

Which I keep overlooking with so many years of C#, I'm so sorry about that :(

That being said, looking at the .NET framework documentation and hanging out on fsharp.org's slack might be a good way to make up for what you are missing to get started.

If I ever get up the nerve to give it a real try, I will certainly test the slack's patience for stupid questions :)

The .NET reference is useful if you are reading through code and maybe to modify it slightly, but I find it (and class hierarchy style docs in general) to be close to useless if you are writing new code and new to the library. Using a new library in Python (especially one that's heavily object oriented), I often find it easier to learn from tests instead of the docs. Reference docs are often inaccurate or too verbose or show no sense of importance or are just poorly written. Tests are straight to the point, include examples, and tend to focus on the most important parts of the library.

The MSDN docs have quite a bit of "How do I..." content, but unfortunately F# is seemingly always blank as an example.

Combine this with a huge proportion of commonly used third party libraries being .NET rather than F# libraries, and so much of the .NET infrastructure you need to use being C# focused, and as a newcomer you are paralyzed.

If F# is serious about building a community of more than just C# converts, they need to recognize that the convenience of .NET for people who already know it carries a commensurate tax for everyone who doesn't. It's harder for me to learn .NET as an F# user than a C# user. It's harder for me to learn to use NuGet as an F# user than a C# user. It's harder for me to learn to use Visual Studio as an IDE with F# than C#. In everyone of these scenarios, you're running up hill because examples and documentation and interfaces are all for the majority, which you won't be.

These are some excellent points. There's no organised, searchable F# package index. We rely heavily on NuGet, which is a generalised .Net mishmash. And we suffer from the same problems that almost every other non-dominant language does when targeting a runtime dominated by another language.

The best I can offer you right now for F#-specific packages is http://fsharp.org/community/projects/ --and the advice that, if you have questions, ask away! F# people will be, I think, extremely ready to answer any questions because we're desperate to see people use the language. Try the mailing list ( https://groups.google.com/forum/#!forum/fsharp-opensource ), https://fsharp.reddit.com/ and the Functional Programming Slack at fpchat.com (well, this one will be back online in a few days--they recently had some drama, which they settled, but they had to disable new signups to let everyone cool down).

If they're desperate, please tell someone to write a book for noobs. I opened The Book of F# and recoiled in horror. The whole book was basically if you're a C# expert, here is how F# is different...or at least a lot of it.
Sorry, you picked the wrong book to start with. Its blurb page says: 'If you're a traditional .NET developer used to C# and Visual Basic, discovering F# will be a revelation that will change how you code.... Break free of that old school of programming.'

Try Pickering & Eason's Beginning F# 4.0; its intro has a 'Who Is This Book For?' section, which says: 'This book is aimed primarily at IT professionals.... A working knowledge of the .NET framework ... would be nice, but it's not necessary.'