Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 4
    All the advice, exhortations etc. about the topic that I've ever heard refer to shared mutable state as the source of complexity. Is that course intended to be consumed by beginners only? Then it's probably a well-intended deliberate oversimplification. Commented Apr 25, 2013 at 16:20
  • 3
    @KilianFoth: Shared mutable state is a problem in multithreaded contexts, but non-shared mutable state can lead to programs being hard to reason about as well. Commented Apr 25, 2013 at 17:38
  • 1
    I think using a local mutable variable is not necessarily bad practice, but it is not "functional style": I think the purpose of the Scala course (which I took during last fall) is to teach you programming in a functional style. Once you can clearly distinguish between functional and imperative style you can decide when to use which (in case your programming language allows both). var is always non-functional. Scala has lazy vals and tail recursion optimization, which allow to avoid vars completely. Commented Apr 26, 2013 at 5:28