|
发表于 2015-8-14 19:38:47
|
显示全部楼层
true, it can be frustrating but it will only be a matter of time until F# tools catch up.
My interest in F# comes from my frustrations writing boiler plate code all the time in C#, F# is much more concise and easier to read (once you get over what all the 'let's are about).
Every time I write an if statement or for loop it drives me nuts and learning a functional language in my spare time has been very rewarding.
Ideally I'd use a Lisp but the similarities between F# and a Lisp are close enough and I've grown to like the pipe operator in preference to digging into paren's to see what's going on.
I love the way you can build very simple building block functions and string them together to build more interesting ones.
Having said that though, from learning a functional language I now have a much better understanding of Linq and Lambdas, the dangers/problems of immutability and how to code in a more expressive style in C#. Any C# I write/edit from now on will be a lot better (than what I used to write at least).
Even C++ (C++11 on) is getting more functional to cope with the onslaught of multi-core processors.
OO has dug itself into a pretty big hole and only by introducing more functional paradigms (such as immutability and higher order functions) will old code bases be able to be refactored to take advantage of new hardware technology.
It's not just hardware on a single machine either, think passing portions of your calculations to multi pc's in the cloud.
Here's an interesting article worth a read by Joel Spolsky (written nearly 10 years ago!) that explains a lot better my interest in this field
http://www.joelonsoftware.com/items/2006/08/01.html
No wonder people coming from lisp have a hard time learning OO, they took the 'telling' the program what to do into 'describing' what to do (i.e. expressions vs statements). |
|