4

I came across this video of Uncle Bob speaking about the SICP book and the assignment statement and it made me think (and read the corresponding chapter from SICP).

I'm wondering whether the arguments listed (local state, side effects, etc.), considering the first edition was published in 1984, are still a problem in modern languages like Java and C#. It may have been a problem then. Is it still now? Or has something changed?

For example in Java we have immutable Strings. A particular area I can think of where assignment is detrimental is concurrency (correct me if I'm wrong). No assignment means no synchronization and no resource deadlocks, right?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Igor Popov
  • 9,795
  • 7
  • 55
  • 68
  • @downvoter: care to say what's wrong with the question and how I can improve it? – Igor Popov Nov 27 '11 at 18:11
  • Possible duplicates: http://stackoverflow.com/questions/8245329/java-immutable-classes; http://stackoverflow.com/questions/3769607/why-do-we-need-immutable-class. (And see the comments at the latter for several more.) – ruakh Nov 27 '11 at 18:14
  • 1
    Nothing you say is specific to the assignment statement/operator. Rather, it's about *mutability*. –  Nov 27 '11 at 18:17
  • @delnan: doesn't mutability imply the use of the assignment operator? – Igor Popov Nov 27 '11 at 18:21
  • At some level, yes (but consider that the actual assignment may be hidden behind many method calls and possibly even some foreign function call). At least in all common approaches I can think of. But ultimately, assignment is just a mean to the end (mutability). And it's whether a value can change, not how it is changed, that matters. –  Nov 27 '11 at 18:38
  • 2
    How does this question not relate to programming or software development? – Marcin Mar 20 '12 at 14:50
  • This would be a great question, if reworded a bit, for programmers.stackexchange.com – J. Polfer Oct 01 '13 at 16:06

0 Answers0