The Artima Developer Community
Sponsored Link

Weblogs Forum
Scala: The Static Language that Feels Dynamic

31 replies on 3 pages. Most recent reply: Oct 1, 2011 8:59 PM by Qingsheng Gao

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 31 replies on 3 pages [ « | 1 2 3 ]
James O'Flaherty

Posts: 6
Nickname: jimofl
Registered: Jan, 2011

When's "Thinking in Scala" going to be published? Posted: Jul 25, 2011 11:40 AM
Reply to this message Reply
Advertisement
Bruce,

Great article. Any idea when "Thinking in Scala" will be published?


Jim O'Flaherty

Qingsheng Gao

Posts: 1
Nickname: 58058
Registered: Aug, 2008

Re: Scala: The Static Language that Feels Dynamic Posted: Oct 1, 2011 8:59 PM
Reply to this message Reply
Bruce Eckel seems being confused by val variables and immutable objects. In this article, Bruce wrote "A val is immutable, which is preferred in Scala because it makes concurrent code easier to write". Immutable objects make concurrent code easier to write. val variables do not help so much to easy concurrent code. Bruce also wrote "And class fields default to public -- which is not a big deal if you can stick to val, since that makes it read-only." A val variable won't make a public field of the object referenced by it read-only. If the object is mutable, its public fields won't be read-only. Referencing an object with a val variable won't make that object immutable. If an object with a public field is mutable, referencing it with a val variable won't stop a client programmer to directly manipulate the public field. For more details, see my article (http://ted-gao.blogspot.com/2011/10/immutable-objects-and-val-variables-are.html)

Flat View: This topic has 31 replies on 3 pages [ « | 1  2  3 ]
Topic: Static Typing, Guard Rails and Street Signs Previous Topic   Next Topic Topic: Creating an Interactive JRuby Console for the Eclipse Environment

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use