Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1016095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:29:55+00:00 2026-05-16T10:29:55+00:00

I have read several interesting C#/F# comparisons here on stackoverflow. So, first of all,

  • 0

I have read several interesting C#/F# comparisons here on stackoverflow. So, first of all, thanks to all contributors!

There is a lot of praise for F#, reasons for preferring C# are a little harder to come by. Anyway, I am still not sure which one to go for this small and simple “real world application”: simulating a school of herring.

I don’t know functional programming (yet), but from an OO perspective, some of the design seems straight forward: Make a Fish class, and derive these classes from it: Herring, Predator, Prey. Each should have properties such as position, direction and speed.

There will be a lot of traversing through collections: Every small time increment, each Fish-object will check its environemnt and update its actions.

I don’t know yet if this will be CPU intensive enough that I will care about multi-processing, but maybe, so F# sounds good there.

I am sure I will be spending a lot of time on prototyping and exploring – I hear F# is good for that.

From what I have read, C# is better for GUI, but there will not be much of that. Plotting some curves would be nice, but I would prefer to send most of the results to an open Excel sheet, or to a database. Not sure how C# and F# differ regarding Excel/databases.

Anyway, this project just seems so Object Oriented – could C# be better for this project despite the points in favour of F# mentioned above? Or??

Edit: Just wanted to say thanks for all the comments, very useful and interesting, hope it helps someone else too. One of the things I find interesting is that although F# is multi-paradigm, everyone seems to prefer C#’s approach to OO, despite for example this comparison.
(Btw, I am going to learn F#.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:29:56+00:00Added an answer on May 16, 2026 at 10:29 am

    This sounds like an application that can be written using both of the styles. Using F# seems appropriate and this is probably a good application for learning the F# language and functional programming.

    Regarding the architecture, you wrote:

    I don’t know functional programming (yet), but from an OO perspective, some of the design seems straight forward: Make a Fish class, and derive these classes from it: Herring, Predator, Prey. Each should have properties such as position, direction and speed.

    Functional programming isn’t all that different. It emphasisez working with concrete types (and you don’t use inheritance that often), so you would probably define distinct types such as Herring and Predator with similar properties. Then you would create lists of herrings and list of predators and perform step-by-step simulation of the two types separately.

    Coincidentally, I wrote a similar simulation with “animals” and “predators” as a sample for my functional programming book (in both C# and F#). The source is freely available (look for Chapter 14), so you may find that as a useful inspiration (the sample also demonstrates parallelism). Using Excel from F# is also perfectly possible (in exactly the same way as in C#) and example is also available in my book (see source code for Chapter 13).

    In general, solving the problem in F# using functional programming will require slightly different point of view, and you’ll probably need to spend more time experimenting, but it seems like the problem could nicely benefit from some F# features (and it is a good chance to learn something new).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,
I have read through several reviews on Amazon and some books seem outdated. I
I'm quite confused about several books in .NET that I have read. Would someone
I have read a lot that LISP can redefine syntax on the fly, presumably
I have read the documentation and several websites on exactly how to do this,
I have read about partial methods in the latest C# language specification , so
I have read that using database keys in a URL is a bad thing
I have read this post about how to test private methods. I usually do
I have read on Stack Overflow some people that have converting to C#2.0 to
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.