Joshua Cough
Posts: 20
Nickname: joshcough
Registered: Jan, 2008
|
|
Re: Scala: A Scalable Language
|
Posted: May 6, 2008 8:50 PM
|
|
I can't say much about Clojure, but I do agree that state leads to spaghetti in most situations.
Scala allows you to have read-only, and writable fields called val, and var. I think it is normally suggested that you use val, (everything immutable) unless you have a really good reason for state.
My rather uneducated guess is that Scala allows for var because (hardcore functional programmers please don't kill me) it makes sense in some situations, and to ease Java programmers into functional programming.
|
|