Re: Objective-C vs. Java
Re: Objective-C vs. Java
- Subject: Re: Objective-C vs. Java
- From: Mike Shields <email@hidden>
- Date: Wed, 25 Jul 2001 18:59:59 -0600
On Wednesday, July 25, 2001, at 06:17 PM, Art Isbell wrote:
On Wednesday, July 25, 2001, at 02:02 PM, Mike Shields wrote:
The one thing I'm looking for is Stack-based objects so I can use
scoping to automatically cleanup allocated resources (memory, open
files, etc). It's the one thing I miss from C++ (other than variables
anywhere, but you can get around that pretty easily with brackets)
You won't be finding them in Objective-C even after the ObjC++
compiler is available. Autoreleased Objective-C objects are almost
equivalent to stack objects in that they are automatically deallocated.
Duh what?
Why wouldn't I get Stack-based objects? I'm not expecting ObjC stack
based objects, but C++. In our old OS 9 codebase, we'd have code like
{
StMutexLocker lock(mymutex);
[ do some stuff which might throw ]
}
and this made handling that sort of stuff MUCH easier. I'd like to see
that sort of functionality back. Then I'll be able to combine the best
of C++ with Obj C and be a happy happy boy.
Mike