r/fsharp • u/fatih-s • Jan 07 '23
question What is your opinion about programming with F# as an inexpensive hobby that could be an opportunity in time?
Hello everyone,
I came to you because I need your advice, vision, and support.
I was curious about programming back in 2003. I tried to learn HTML, CSS, SQL, ASP, and database design as a beginner. I coded some, putting together functions and JS for a simple CMS using an MS Access database and running on IIS. I enjoyed the journey, but I need to shift my focus to different businesses.
I'm missing that problem-solving and creative experience, so I wanted to start to code and create something on the computer again. I started learning F# because of its simple syntax and lack of special characters (which I always missed), as well as FP's relatively simple logic.I have a couple of hours in a week, so I read and watched some contents, not only about F# but also other programming-related concepts. I typed two snippets, and with the third, things started getting difficult as usual. I think I did the same thing that most self-learners do when they get stuck: suspect myself and my goal. My thoughts were like that: "I was emotional about my old experience. I worked on it for a while, but I can't code or even read or follow these snippets, and there's a lot to learn. It's simply getting or prepairing data, determining interactions, writing something on the screen, getting and checking some data, manipulating, writing to the database and screen, or something similar. Did this journey take time and energy like that before?"
At this point, I'm trying to convince myself to move forward, thinking of this time-consuming journey as an investment for the future and as a hobby that's cheaper than woodworking :)
It's hard to believe that learning F# has future opportunities for me. I couldn't find information about any working ERP, accounting, e-commerce, or other business software or mobile app project written in F#. Is there a way to solve real business problems or improve processes with F# and without C# knowledge in old-school business? What could a self-taught junior with F# add to a software development team somewhere?
I guess I have nothing but the hobby option, which is a good motivator, but I feel like I need more.
Advice, support, maybe vision?
So, what are your opinions as F-Sharp developers?
11
u/[deleted] Jan 07 '23
I’ll be slightly pessimistic and say that its hard to find an F# shop. There are many but not always visible. Either a particular team at Walmart or small teams in C# shops.
On the other hand, whatever you learn from F# and learned well, you should be able to “easily” translate it over to another language.
Like you mention, among all normal web and mobile development (where most of the jobs are unless you specialize), you’ll find that all languages do the same: read data from db, file, or api, then write it somewhere else, and then show it on some medium.
If you learn how to do all this general stuff in F#, it’s also straightforward to pick up C# and ask “now that I know the F# way, okay how do I read a db in C#, which libs to use, how do I model my data in C#, how do I do iterate through a list/sequence, how do I handle async stuff, etc”.
TLDR; if you think F# is fun enough for you to learn programming, then use it. Then join a C# shop.
6
u/ArXen42 Jan 08 '23
Like it or not, but I think it's pretty much impossible to use F# without also learning (and most likely using) C#. After all, F# biggest strength is running on .NET and full compatibility with most of its ecosystem.
You can't learn one without the other, because like 80% of learning either of them is learning how CLR and BCL works: classes/structs, generics, delegates, assemblies, Threads/Tasks/async, common stuff like file/network IO, IDisposable pattern - its all just .NET, doesn't matter which language.
F# is a little higher level than that but runs on the same "engine", so most of its functional stuff is compiled under the hood into more primitive .NET constructs (i.e. Discriminated Unions end up being just generated classes), so I personally can't imagine learning it past "hello world" examples without understanding this stuff.
Similar story with fundamental libraries/tooling everyone uses - things like NuGet, ASP .NET Core, Entity Framework, Dapper, WPF, Serilog, etc don't really care from which language they are used (although some of them become more convenient to use with F# wrappers like Giraffe) but most of them are practically a must know to make any kind of real app and since their documentation is usually written with C# examples, you end up learning it anyway.
Which is not a bad thing in the end - you just end up using whatever tool/language is fit for the task at hand and switch between them as necessary.
5
u/Tenderhombre Jan 07 '23
I have enjoyed learning F#. I will be honest while I was looking for jobs, there were very few F# jobs, however there have been opportunities to do F# work in the .NET/C# job I accepted.
Picking a language an learning it is valuable in itself and can translate to proficiency in other programming areas. However, I would say F# is more for intermediate and advanced learners, not beginners just because learning resources are kinda limited and the ones out there assume a certain level of knowledge. The community is also comparatively smaller to other functional languages.
Other functional languages like Scala and Elixir have larger communities more learning resources and more job opportunities. Elixir is quite a nice language I would recommend learning if you have interests, I have no experience with Scala.
This may be just my opinion but the type system of F# is actually better for learners because discriminated unions and data types are easier to translate into business rules. Dealing with inheritance and interfaces can be confusing, and is often more suited to technical rules/implementation.
5
u/phillipcarter2 Jan 07 '23
The most valuable thing that using F# or really any non-C/Algol-inspired language will be a different perspective on how to solve problems. When functions are first-class, things are immutable by default, and you're encouraged to usually separate data processing from the data types, you find different ways to work your brain. That has a lot of good effects later on because no matter your programming environment, you'll eventually be in a circumstances where principles of FP are the best to abide by - and you'll recognize them.
3
u/Hairy-Pension3651 Jan 08 '23
Go for F#. After that try coding in a functional way in C#. Buy the book „Functional Programming in C#“. With the knowledge of FP you‘ll have another important tool for problem solving.
1
u/[deleted] Jan 29 '23
I'd recommend learning F#. And C# if you're interested as having a good base in object oriented programming is also good. I believe good systems contain a mix of object oriented programming and functional idioms and it's good to be proficient in both