• 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: cocoa-dev digest, Vol 2 #3738 - 11 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs
  • From: David Blanton <email@hidden>
  • Date: Wed, 25 Feb 2004 10:12:36 -0700

On 2/25/04 5:42 AM, "Glen Low" <email@hidden> wrote:

>> On Feb 19, 2004, at 5:11 AM, Allan Odgaard wrote:
>>
>>> On 19. Feb 2004, at 11:29, Marco Scheurer wrote:
>>>
>>>>> Arg... implementing algorithms in ObjC is certainly not something I
>>>>> would recommend, not really for the performance overhead, but mainly
>>>>> for the syntactic overhead [...]
>>>> Argh! I would have said exactly the opposite, ie one always want to
>>>> avoid the syntactic mess of C++. [...]
>>>
>>> Not that I wish to start a flame war or anything, but would you care
>>> to elaborate?
>
> Another thing, hopefully not further adding fuel to another language
> war, on the topic of ease of syntax...
>
> The [ ] call syntax of ObjC still bugs me. Suppose I want to call
> method alloc, so I start typing:
>
> [NSArray alloc]
>
> now I remember I have to call the method init on the result, so I have
> to backspace or mouse back to the beginning of the line, put in a [:
>
> [[NSArray alloc]
>
> then forward space or mouse to the end, and put in the rest:
>
> [[NSArray alloc] initWithObjects: a, b, c, nil];
>
> On the other hand with the C++, Java and C# style:
>
> nsarray.alloc ()
>
> oops, need the init, so it is
>
> nsarray.alloc ().init (a, b, c, nil);
>
> all without backspacing.
>
> I'm convinced that's why in C and C++ you have a->b as an alternate
> form for (*a).b, just to save on programmer backspacings.
>
> Cheers, Glen Low
>
>
> ---
If backspacing is the issue then use <ret> as follows:

NSArray * A = [NSArray alloc]; (oops I forgot init so I <ret> and do;
[A init];

Always moving the ball forward or a General Patton said " I never like to
pay for the same real estate twice."

Yeah?
_______________________________________________
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.


  • Follow-Ups:
    • Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs
      • From: Jim Correia <email@hidden>
References: 
 >Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs (From: Glen Low <email@hidden>)

  • Prev by Date: ObjC method syntax (was: Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs)
  • Next by Date: [Found one] Re: Sample/Example PreferencePane
  • Previous by thread: Re: ObjC method syntax (was: Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs)
  • Next by thread: Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs
  • Index(es):
    • Date
    • Thread