3

Possible Duplicate:
What are the benefits of using C# vs F# or F# vs c#?

So I started to catching on to the hype around the Microsoft's new functional language. After watching several video casts and playing around with it I really started liking the language. The type inference makes the source code look that much better than c#'s. But would you consider using F# to build a class lib, for example, to call it from your c# code (asp mvc, wcf, etc)? Are their any caveats in doing so? Are there any advantages in introducing F# into a c# application?

Community
  • 1
  • 1
dexter
  • 7,063
  • 9
  • 54
  • 71
  • @Joel I don't think it's a direct duplicate since I am looking for comments in the context of enterprise development vs hypothetical pros and cons. – dexter Dec 09 '10 at 16:28
  • See also http://stackoverflow.com/questions/928042/how-will-f-sharp-be-used and http://stackoverflow.com/questions/39492/where-can-f-actually-save-time-and-money and http://stackoverflow.com/questions/179332/anyone-actually-using-f-in-production – Brian Dec 09 '10 at 17:38
  • Malygin - understandable, but it's my opinion that you won't find an answer that is different between the 2 that is not covered in the referenced question. – Joel Etherton Dec 09 '10 at 17:39

4 Answers4

2

F# syntax is lightweight, allowing to deliver more in shorter periods of time. I really like the async block and MailboxProcessor. These features are so nice that C# 5.0 tries to mimic and back-port them.

GregC
  • 7,737
  • 2
  • 53
  • 67
1

I've seen comments by people who do this and say that it has worked well for them, but the one thing you'll want to bear in mind is that there is a learning curve for C#/Java developers to become accustomed to F#'s functional programming model. So there will be an HR cost, as fewer people will be ready upon hiring to dive into the F# parts of your code.

StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315
  • This is becoming less and less of an issue for Greenfield teams, since there is a growing segment of programmers esp. within financial industry that utilize Erlang and Scala. Having taken the time to learn F#, I can see it as a real limiting factor for existing C# teams. Good point! – GregC Dec 09 '10 at 16:18
  • @GregC: Yeah, it totally depends on your sector, and how your teams are divided. If you have a group of financial programmers doing the F# stuff and a group of web programmers providing a UI for it, that could work out very well for you. – StriplingWarrior Dec 09 '10 at 16:19
  • I've seen how web development can benefit from a dynamic language such as Ruby -- so definitely, keep your eyes open for new technology. – GregC Dec 09 '10 at 16:25
  • @Warrior - how about testability of f#? Are there frameworks for that? – dexter Dec 09 '10 at 16:30
  • @Max Malygin: Though I haven't done any serious programming in F#, I understand that its functional nature lends itself very well to unit testing. The patterns that imperative programmers have to learn to adopt to make sure their code stays testable (constructor injection, for example), just happen naturally when programming in F#. For frameworks, see http://stackoverflow.com/questions/1989487/f-development-and-unit-testing – StriplingWarrior Dec 09 '10 at 18:16
0

i think there is if you want to do an application that has high level of transactions F# would help with that , plus you can make it as a DLL and use in a C# application

Saif al Harthi
  • 2,948
  • 1
  • 21
  • 26
-1

If your project would truly benefit being built on a functional programming language go for it. However this most likely not the case.

I would not recommend doing a full project in F# assuming you're talking about a network based enterprise software system.

If you feel there is a subsystem / routine that would greatly benefit from using F# by all means develop that part in F# and then bring it in as an assembly.

Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
  • I think it would be good if you provided where C# shines over F# when using accepted style in both, just to prove that your negative comment is based on experience, and not envy. – GregC Dec 09 '10 at 16:23
  • "network based enterprise software system." So some form of client/server whether thin or thick client. Client development in pretty much all shapes is better with C#. – Chris Marisic Dec 09 '10 at 16:25