Better HN
topnewbestaskshowjobs
Log inSign up

jfl

-2 karma · joined Dec 30, 2009 (16y ago) · 5 submissions

Submissions

comment 16y ago · link · parent

We have to agree to disagree. Peace.

comment 16y ago · link · parent

"A caller of a function in an imperative environment cannot assume anything about the scope of that function's access of mutable state within the program"

This really doesn't make sense.

main() { A a = new A(); f(); ... } the caller main() can assume that "a" is not in scope of f(). Is it the robust refutation you need ?

The caller can further assume that the scope of f() is limited to the part of the state for which there is a path from a global variable or from one of its parameters (You can see the state as a graph. The nodes are the data and the links are the references) Therefore, this scope is not the whole state but a limited subset of the state. Claiming otherwise is wrong and does not help to bring attention to what need to be improved : this subset is itself a superset of the part of the state that the function really need. We need new techniques to hide more state to the function, for example some kind dereferencement control ?

comment 16y ago · link · parent

Actually, my webapps are full of threads. Again, Imperative style is not the wrong way, and FP the right way. They are just different. Why not let people find their own way ? Just give the information they need to make up their mind. And why not be honest and tell them that learning Haskell is probably more painful that learning to deal with the mutable state.

comment 16y ago · link · parent

All my methods take just a few argument, I learned to design carefully the state of my programs and manage adequatly how function access that state. Imperative programming works for me (and many others). You say I am doing it wrong and want me to do it your way. Proselytism ?