RE: [OT] "Fluent Interface"? Welcome to NeXT
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