Skip to main content
20 events
when toggle format what by license comment
May 8, 2018 at 16:55 history protected gnat
May 23, 2014 at 9:10 history closed gnat
jwenting
user40980
user53019
Jan Hudec
Duplicate of Did the developers of Java consciously abandon RAII?
May 23, 2014 at 6:27 answer added JavaDT timeline score: -1
May 22, 2014 at 10:43 comment added jwenting @Bobson no need to imagine, just look at your average C and C++ program...
May 22, 2014 at 8:52 history edited gnat CC BY-SA 3.0
personal and meta stuff removed
May 22, 2014 at 4:14 review Close votes
May 23, 2014 at 9:26
May 22, 2014 at 1:45 answer added Jerry101 timeline score: 7
May 21, 2014 at 22:21 history tweeted twitter.com/#!/StackProgrammer/status/469241478506504192
May 21, 2014 at 22:14 comment added Bobson Or, if it doesn't ensure that there are no other references, then imagine the memory problems that could occur with stray pointers...
May 21, 2014 at 22:09 answer added OldCurmudgeon timeline score: 5
May 21, 2014 at 21:58 answer added jzx timeline score: 3
May 21, 2014 at 21:52 comment added Michael Kohne @Prog - think about what would need to happen to get a 'destroy now' into Java - you'd need syntax for it, but you'd also need some way to make sure that the programmer didn't access the thing after destruction. Which includes making sure that there are no other references to the object being 'destroyed'. Think about what that would have to do to the garbage collection system (already a non-trivial piece of code).
May 21, 2014 at 21:29 answer added awksp timeline score: 3
May 21, 2014 at 21:28 comment added gnat this was asked and answered in Why can't Java/C# implement RAII? and explored in some more details in Disadvantages of scoped-based memory management
May 21, 2014 at 21:28 comment added KChaloux @Prog You say that as if it's an easy thing to add. Once the language has been designed with garbage collection in mind, it gets pretty deeply routed into how things work.
May 21, 2014 at 21:25 comment added Aviv Cohn @gnat Then why wasn't deterministic destruction added later - especially since Java had grown to what it is today?
May 21, 2014 at 21:22 comment added gnat "Gosling did not get the significance of RAII at the time he designed Java. In his interviews he often talked about reasons for leaving out generics and operator overloading, but never mentioned deterministic destructors and RAII. Funny enough, even Stroustrup wasn't aware of the importance of deterministic destructors at the time he designed them..." (possible duplicate)
May 21, 2014 at 21:19 history edited Aviv Cohn CC BY-SA 3.0
added 459 characters in body
May 21, 2014 at 21:16 comment added awksp Partially because Java was intended to be a high-level language that abstracted manual memory management, among other things, away from the programmer. Allowing explicit memory management would pretty much go against one of the reasons Java was made in the first place.
May 21, 2014 at 21:09 history asked Aviv Cohn CC BY-SA 3.0