4 ms·
I really wonder, as an OOP developer should I move to functional programming or not.
by egemen 11y ago
I really wonder, as an OOP developer should I move to functional programming or not.
- insulanian 11y agoTake some time to learn something about it and then decide. A good way to start is this: http://fsharpforfunandprofit.com http://fsharpforfunandprofit.com
- ChristianGeek 11y agoI would definitely consider it if the IDE tooling was stronger. Visual Studio and F# is ok, but not nearly as strong as for C#.
- virmundi 11y agoOne my active questions in this area is "does FP need an IDE as much as OOP?" I don't know. When done properly FP decomposes into smaller, easier to thing about functions. They often get glued together in a piper->filter way. As a result, the glue logic doesn't really require much introspection. Where an IDE could be helpful is in refactoring and code generation. If your code does't require much generation due to its simplicity, you might need half-an-IDE. If you can get decent refactoring by having higher-level functions as the default, maybe you end only needing a quarter of an IDE? That's why I keep bouncing between LightTable and Counterclockwise (nope hate IntelliJ and Cursives, but that is a taste thing). I'm more comfortable with Eclipse than Light Table. I just don't know how much of it I need. One caveat is debugging. I do fallback on that. I think that might be a sign of me failing to breakdown my code into isolated units. Regardless, I haven't figured out how to do debugging in LightTable.
- douche 11y agoI'm trying to get into F#, but since I have a ReSharper license, it's hard for me to get away from C# - the tooling is just so nice. I would definitely say that learning more functional ways of writing code in F# makes my C# code much better. I don't know how much direct benefit I would get from using F# instead, though. Too much of the stuff I work on is dependent on using not-so-functional-friendly C#-based SDKs or ties into unmanaged code through COM wrappers.
- Johnny_Brahms 11y agoAnd you are on windows. The tooling for linux is awful. Monodevelop fails to compile if you add another F# source file to your project. You have to modify the project file manually to make the project compile correctly. I'm a huge fan of F#. I ported some old racket program to it, and ended up with a shorter, faster program that looked better. But constantly having to struggle with the tooling just makes me want to go back to DrRacket.
- danbruc 11y agoThat seems to me like asking whether you should buy a car or a toaster - it depends and most likely you want both. Pure object oriented programming tries to force the object metaphor onto every problem disregarding whether it actually fits naturally. Pure functional programming pretends that there is no state which is as wrong as everything is an object. In my opinion the really sensible thing to do is to be aware of all the available options and choose the right one for the problem at hand.
- pjmlp 11y agoRegardless of what extremists in both sides tell, the future is actually hybrid. Smalltalk had lambdas and LINQ like libraries. Lisp had Flavors and then CLOS. For those that tend to forget lambda calculus and place FP == Haskell, type classes allow for most of the ground principles of OOP design. There are a few interesting talks from Simon Peyton Jones about it. TL;DR - Learn functional programming, what are the strengths and flaws of each approach to software architecture and use the best approaches for solving the actual problem.
- mattmanser 11y ago10 years ago this question was asked constantly, these days not so much. Lambda expressions and anonymous types are why. C# 3.5 saved you from having to seriously ask that question any more. So the answer is no. But learning a functional language can help your skill in your existing ones.
- deanCommie 11y agoDepends on what you code for. IMO the best option is a language that supports both concepts (In the .NET case, let's say, C# OOP with Lambdas, or F# functional with types.) I found this series quite informative, as an OOP developer: http://fsharpforfunandprofit.com/series/thinking-functionally.html http://fsharpforfunandprofit.com/series/thinking-functionall...