F# is a beautiful language. You always want to use the right tool for the job but honestly F# is so right for so many jobs.
I know a lot of people don't want to hear this but these types of languages, functional first, are the future of our industry. (In the sense that in the 2000s Java like laguanges were the future of our industry). I might be reaching here, but in my opinion, these are the right languages for the Cloud and that's why they are getting so popular.
I would agree if I felt that the industry were moving towards "better" software - as in, as an industry, we said "Wow, we need to seriously take a step back and start writing systems more reliably, more securely, etc".
I do not think we're going in this direction, necessarily.
Agreed. Objects for everything results in code that is riddled with hidden mutable state and side-effects (state is not encapsulated). It's impossible to reason globally about such systems, even before threads are added. Objects can be used as a reasonable module system, which is why many still advocate them, although IMHO better module systems do exist (e.g. in OCaml).
I honestly wish this was true but I doubt it. F# is different enough to have a big curve, and yet the benefits aren't immediately tangible, it's just a bunch of small things that add up - but try selling that to someone. Meanwhile mainstream languages are picking up features from it (eg. C# will eventually have record types and pattern matching). I think languages like this will influence the mainstream but I don't see them being mainstream in the future.
Future of our industry? Such languages are popular and suited to certain types of projects and solutions certainly. Particularly for systems in computing, and information and data science.
However, for complex representational systems, including both transactional and continuous systems in business, commerce and industry, other languages and paradigms can remain better suited.
> I know a lot of people don't want to hear this but these types of languages, functional first, are the future of our industry.
Mainstream languages will incorporate functional features and remain popular, and they will not be superseded by pure functional languages. Java and C# are already doing this.
I think there's a typo in the createQty function: shouldn't it return (uint16 0) if n is less than 0, not greater?
Otherwise, great article. This is exactly how I learned to program with Scheme: mosel the domain carefully, slowly building up helper functions, and conposing at the end.
Here is a version of basket add-to with a recursive local function for doing the insert, avoiding the clumsy mapcar and "did we insert or not" check copied from the F# code.
fowlerpower|9 years ago
I know a lot of people don't want to hear this but these types of languages, functional first, are the future of our industry. (In the sense that in the 2000s Java like laguanges were the future of our industry). I might be reaching here, but in my opinion, these are the right languages for the Cloud and that's why they are getting so popular.
staticassertion|9 years ago
I do not think we're going in this direction, necessarily.
grumpyprole|9 years ago
rubber_duck|9 years ago
shados|9 years ago
We'll hear about these more and more for sure.
aryehof|9 years ago
However, for complex representational systems, including both transactional and continuous systems in business, commerce and industry, other languages and paradigms can remain better suited.
twblalock|9 years ago
Mainstream languages will incorporate functional features and remain popular, and they will not be superseded by pure functional languages. Java and C# are already doing this.
cmoscoso|9 years ago
kough|9 years ago
Otherwise, great article. This is exactly how I learned to program with Scheme: mosel the domain carefully, slowly building up helper functions, and conposing at the end.
lucasmreis|9 years ago
And, as some commenter on Disqus said, probably the right thing to do would be returning an Qty option from the function, and treating it properly.
I have no experience with Scheme, but already worked with Clojure - it was actually my "gateway" to functional programming languages, hehe!
daxfohl|9 years ago
lucasmreis|9 years ago
kazinator|9 years ago
If you see me designing programs like this in real life, just whack me on the head, please!
kazinator|9 years ago