Possible Duplicate:
why use def and val in Scala or vice versa
Obviously, when there are arguments, if the value depends upon mutable objects, or the value depends upon a trait member, one has to use def. And if the expression could throw an exception, one can't use val. But what if neither is the case? More specifically, is there ever a reason to use def in such situations? Is it preferable to use val (when the expression won't throw an exception) and lazy val (when the expression could throw an exception)?
For example:
class FifthElement(seq: Seq[Element]) {
def hasFifthElement = seq.length > 5 // is it better to use val than def?
def fifthElement = seq(5) // is it better to use lazy val than def?
}