DEV Community

Discussion on: Which is better for teaching? C# or F#

Collapse
 
matthras profile image
Matthew Mack

Definitely F#, but highly suggest you be prepared to adjust your teaching approach on the fly depending on your colleagues. There'll be, in my experience, two ways of approaching a new topic:

  1. Learn the theory, then apply it to building stuff.
  2. Build stuff/scripts first, and then teach the theory afterwards. As a mathematician this is my approach with coding, because what I find fun is figuring out the abstraction, and then confirming/normalising that with the theory.

Definitely think about the learning curve. With your C# example it was far too steep to begin with, partially because your example had a lot of additional details that for you, it's easy to not worry about. For beginners, they have no idea what to focus on, so their attention goes everywhere and as a mathematician myself I'm obsessed with the details, so my head would also be springing with questions like "What's namespace, static, void? etc.".

Start with scripting and doing things, and if there's such thing as a symbolic maths package/library for F# you can have a bit of fun with that. I know nothing about F#, so I don't have any other specific suggestions.

Collapse
 
t4rzsan profile image
Jakob Christensen

Thank you for your comment.

I think you are right that there are too many details in C#.

Starting with scripting is a good idea and F# is really good at that. All you really need is a text editor.

Collapse
 
saint4eva profile image
saint4eva

I bet to differ. There are also many details in F# hello example, it was the writer who decided to leave them out for brevity. C# also has a scripting capability both in Visual Studio, VS Code, and Xamarin WorkBook.

You can just do WriteLine("Hello World"); in C# example. I would suggest the teacher do some researchers to find out what is needful and meaningful for the team based on the tasks they will be rendering the company.

Anyways, F# is a great language, and C# is a great language - all taking advantage of a powerful platform - .NET.