• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objective-C vs. Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Objective-C vs. Java
      • From: Art Isbell <email@hidden>
References: 
 >Re: Objective-C vs. Java (From: Art Isbell <email@hidden>)

  • Prev by Date: Re: Objective-C vs. Java
  • Next by Date: Re: Objective-C vs. Java
  • Previous by thread: Re: Objective-C vs. Java
  • Next by thread: Re: Objective-C vs. Java
  • Index(es):
    • Date
    • Thread