News for hackers. Stuff that matters.
Re:Elements of Modern C++ Style by Someone on Saturday October 29, 2011 @07:09PM (#3173091)
"It's certainly true that dynamic, high-level languages save you from having to worry about ownership-semantics"

What languages are you thinking about? In most languages I can think of as being "dynamic, high-level", state is mutable. So, if a method on an object returns a collection, and the caller wants to keep the result around, the programmer will have to somehow know whether the collection that the method returned was freshly allocated or internal to the object, whether it is modifiable, how long the content of the collection is guaranteed to be stay constant (e.g: what happens when I append to a list from a loop that iterates over it?), etc.

Similarly, if one passes an object to say a constructor, one should know whether the constructed object holds a reference to that object, thus sort-of claiming ownership.

It is true, though, that whenever I think about such issues, I am amazed that these things so rarely lead to problems. Apparently, all programmers share a single mental model for the 'natural' ownership policies.

Re:Elements of Modern C++ Style by frou_dh on Saturday October 29, 2011 @07:47PM (#3173163)
Enter Clojure with its first-class persistent + immutable collections!
Re:Elements of Modern C++ Style by dilap on Monday October 31, 2011 @05:59PM (#3179314)
Yup, you're right -- I was just talking about deallocation, but more than that matters in a mainstream, side-effecty language, as you point out.