Timeline for In functional programming, are local mutable variables with no side effects still considered "bad practice"?
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 15, 2017 at 9:38 | answer | added | Karl Bielefeldt | timeline score: 3 | |
| Apr 26, 2013 at 5:28 | comment | added | Giorgio |
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.
|
|
| Apr 26, 2013 at 3:52 | answer | added | Loren Pechtel | timeline score: 2 | |
| Apr 25, 2013 at 23:05 | history | tweeted | twitter.com/#!/StackProgrammer/status/327559088093405186 | ||
| Apr 25, 2013 at 21:37 | vote | accept | Eran Medan | ||
| Apr 25, 2013 at 21:01 | history | edited | fredoverflow | CC BY-SA 3.0 |
edited body
|
| Apr 25, 2013 at 17:38 | comment | added | Michael Shaw | @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. | |
| Apr 25, 2013 at 17:30 | answer | added | Michael Shaw | timeline score: 20 | |
| Apr 25, 2013 at 16:30 | answer | added | Simon Bergot | timeline score: 2 | |
| Apr 25, 2013 at 16:20 | comment | added | Kilian Foth | 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. | |
| Apr 25, 2013 at 15:54 | answer | added | C. A. McCann | timeline score: 19 | |
| Apr 25, 2013 at 15:44 | answer | added | KChaloux | timeline score: 10 | |
| Apr 25, 2013 at 15:36 | history | asked | Eran Medan | CC BY-SA 3.0 |