• 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: Code Completion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code Completion


  • Subject: Re: Code Completion
  • From: Serge Beauchamp <email@hidden>
  • Date: Thu, 6 Mar 2003 14:49:21 -0600

It is not the same thing with java, because you cannot call a arbitrary method on a Object reference, i.e you cannot do this in java:

Object object;
object.someMethod()

while it's totally legal in Objective-C.

Fortunatly, there's some tricks that a CodeCompletion parser could do, for example, he can track where the id come from, and keep the original type, although it doesn't work in some cases, for example:

[NSString alloc] init_

even though the alloc returns id, it's possible for a parser to remember that it was called on a NSString class, and that the result is of type NSString, same thing for retain, autorelease, init, etc...

Serge.

Giovedl, 6 Mar 2003, alle 13:39 US/Central, Christian Longshore Claiborn ha scritto:

This is not a problem unique to Objective-C; Java has essentially the same concept (everything derives from Object), and in such a case (for example, when pulling an Object out of a collection without a direct cast), code completion would be equally useless.

That said, there are plenty of times when I know exactly what I'm tossing around to various functions, and when code completion (even just scanning the member tables of the class and its parents) would be quite useful. Maybe you write a lot of code like:

id x = [[NSMutableArray alloc] initWithCapacity:20];
[x addObject:blah];

but those of us who statically type our variables for clarity's sake could use it.

Hell, I need to cast my variables half the time so that the compiler can figure out which compare: to use, for example.

Christian

On Thursday, March 6, 2003, at 09:10 am, Chris Hanson wrote:

What should code completion do in this case? My insertion point is at the underscore (_):

- (void)foo:(id)argument
{
id x = [foo _

It's a serious question.

Yes, code completion where all types are known *could* be nice, but thanks to Objective-C's dynamic typing and the different development techniques that this leads to, I see code completion getting in the way and breaking my flow just as much as it helps. I fully see the utility of code completion in statically-typed languages like C++ and Java.

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Code Completion (From: Christian Longshore Claiborn <email@hidden>)

  • Prev by Date: Re: NSFileManager fileAttributesAtPath confusion
  • Next by Date: Re: Code Completion
  • Previous by thread: Re: Code Completion
  • Next by thread: Re: Code Completion
  • Index(es):
    • Date
    • Thread