• 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: [OT] "Fluent Interface"? Welcome to NeXT
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [OT] "Fluent Interface"? Welcome to NeXT


  • Subject: RE: [OT] "Fluent Interface"? Welcome to NeXT
  • From: Jeff Laing <email@hidden>
  • Date: Fri, 3 Aug 2007 13:39:42 +1000

> This was a very common idiom in earlier Obj-C. Well before "void"
> existed, every C function (and therefore Obj-C method) had to return a
> value. It was common to return self on success, and nil on failure.
> That way, method calls could be chained as above.

Yes, I understand that, much like I understand that other common idiom in
the 70's led to the Y2K nightmares that kept Cobol programmers in Porsches.

I still wonder, how on earth do you determine "what went wrong" when you
have a chain of operations like this that just silently stops when something
fails?

In fact the whole "sending a message to nil silently succeeds" has to be the
most stupid decision ever in language design.  Its benefits are massively
outweighed by its ability to mask problems, in my opinion.

I'd far rather have a good old access violation than have a program merrily
wander onwards not realising that its dealing with a nil pointer. No wonder
they needed to add cruft like NSZombie to debug problems...
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [OT] "Fluent Interface"? Welcome to NeXT
      • From: Uli Kusterer <email@hidden>
    • Re: [OT] "Fluent Interface"? Welcome to NeXT
      • From: Lee Ann Rucker <email@hidden>
    • Re: [OT] "Fluent Interface"? Welcome to NeXT
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: Getting the size in kilobytes of text in an NSTextView
  • Next by Date: NSPopUpButtonCell's in NSHeaderView
  • Previous by thread: Re: Getting the size in kilobytes of text in an NSTextView
  • Next by thread: Re: [OT] "Fluent Interface"? Welcome to NeXT
  • Index(es):
    • Date
    • Thread