Functional Programming in C++ (2013)
web.archive.org
Functional Programming in C++ (2013)
1–10 of 64 posts
Re: Functional Programming in C++ (2013)
#2Re: Functional Programming in C++ (2013)
#3I just can't get behind all of this. Sure, its great to be able to reason clearly because you can see your whole state, but its exhausting always carrying your context around like a hobo with a huge backpack full of junk. Am I mistaken?
object Foo {
var x: Int = 0
def bar(y: Int) = x + y
}
And trying to figure out what bar will return at any given point.Re: Functional Programming in C++ (2013)
#4Re: Functional Programming in C++ (2013)
#5I just can't get behind all of this. Sure, its great to be able to reason clearly because you can see your whole state, but its exhausting always carrying your context around like a hobo with a huge backpack full of junk. Am I mistaken?
Re: Functional Programming in C++ (2013)
#6Re: Functional Programming in C++ (2013)
#7Re: Functional Programming in C++ (2013)
#8I just can't get behind all of this. Sure, its great to be able to reason clearly because you can see your whole state, but its exhausting always carrying your context around like a hobo with a huge backpack full of junk. Am I mistaken?
Re: Functional Programming in C++ (2013)
#9That said, the problem of not understanding possible code states does not seem to be purely a result of the internal software structure, but how it interacts with outside components, including the OS (if any).
There is a combinatorial explosion of the state space as a program's dependencies increase. As such, the most practical way to deal with this is crash-only software whereby components do not perform complicated error recovery, but are simply fenced and restarted to known good states with persistence used to ensure that the component can return to its prior point of operation quickly.
FP is useful for writing software like this, but not necessarily pure FP or even a single paradigm.
Re: Functional Programming in C++ (2013)
#10One difficulty with functional style c++ is just how verbose it is. Every time I tried to use std::transform (the equivalent of "map") I had to delete it and rewrite as a loop because it was just too hard to read. Functional style on a large scale is still possible.