Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.objective-c > #245

Re: A question on designated initializers

From Don Bruder <dakidd@sonic.net>
Newsgroups comp.lang.objective-c
Subject Re: A question on designated initializers
Date 2015-12-02 14:37 -0800
Organization Chaotic Creations Unlimited
Message-ID <n3nrna$f6$1@dont-email.me> (permalink)
References (5 earlier) <87oaeivr7a.fsf@kuiper.lan.informatimago.com> <n337jb$6mt$2@dont-email.me> <87d1uyvj8a.fsf@kuiper.lan.informatimago.com> <n34ppq$km8$1@dont-email.me> <874mgaugc9.fsf@kuiper.lan.informatimago.com>

Show all headers | View raw


In article <874mgaugc9.fsf@kuiper.lan.informatimago.com>,
 "Pascal J. Bourguignon" <pjb@informatimago.com> wrote:

> Don Bruder <dakidd@sonic.net> writes:
> 
> > You'll pardon my skepticism, I hope - I'm an empiricist at heart...
> 
> I assumed so much, and therefore I assumed you already ran the code, and
> saw the infinite loop for yourself!

Been gone longer than planned, but back to the home machine now...

Nope, at that point, hadn't tried running it. Have now. And am 
gobsmacked! Also educated - This explains a situation I had a few years 
back when I tried to subclass from one of the "NSXxxx" classes that come 
with cocoa - I got *EXACTLY* the same behavior back then as what I saw 
when I tried running the code we've been talking about, and never did 
bother to chase down the how/why. Ended up just tacking a category on 
the class rather than doing an actual subclass, and things worked just 
fine.

> 
> 
> > Gonna do some playing and see what I can come up with, but at this 
> > stage, what you're saying is so *TOTALLY* counterintuitive I can't even 
> > start to accept it. Everything I've ever grasped about 
> > inheritance/subclassing tells me that I'm not supposed to "need" to know 
> > the internals of the class I'm deriving from - it's a black box. So long 
> > as you do thus and so, your subclass will work. "Thus and so" in this 
> > case meaning "Make damn sure you chain back to the root object by 
> > calling your superclass' init method or all hell's gonna break loose". 
> 
> Well, either your class is "documented", with a class invariant
> and a set of pre- and post- conditions for each method, or you have to
> know the internals.
> 
> Since you never find those invariants and sets of pre- and
> post-conditions documented, you never know, and always have to know the
> internals, which indeed, is a very bad situation.

Yeah... it does a serious number on the whole "A class stands alone, you 
can treat it as a black box" concept that was (until now...) my 
understanding of one of the main points of OOP. 

So now, I'm gonna have to get my head around how to cope with this 
"breakage"...

-- 
Security provided by Mssrs Smith and/or Wesson. Brought to you by the letter Q

Back to comp.lang.objective-c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-22 13:39 -0800
  Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-22 14:48 -0800
    Re: A question on designated initializers Louis Wu <louiswu@ringworld.net> - 2015-11-22 16:26 -0800
      Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-22 17:24 -0800
        Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-23 02:39 +0100
  Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-23 01:18 +0100
    Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-22 16:49 -0800
      Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-23 02:02 +0100
        Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-27 17:19 -0800
          Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-28 13:22 +0100
            Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-28 17:37 -0800
              Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-29 03:45 +0100
  Re: A question on designated initializers Don Bruder <dakidd@sonic.net> - 2015-11-22 19:15 -0800
    Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-23 18:44 -0800
      Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-24 04:58 +0100
        Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-24 16:42 -0800
          Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-25 02:00 +0100
        Re: A question on designated initializers Greg Parker <gparker@apple.com> - 2015-11-25 01:25 -0800
      Re: A question on designated initializers Don Bruder <dakidd@sonic.net> - 2015-11-24 07:38 -0800
        Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-24 15:54 -0800
          Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-25 01:49 +0100
            Re: A question on designated initializers Don Bruder <dakidd@sonic.net> - 2015-11-24 18:51 -0800
              Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-25 04:41 +0100
                Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-25 00:25 -0800
                Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-25 14:16 +0100
                Re: A question on designated initializers Jon Rossen <jonr17@comcast.net> - 2015-11-25 17:30 -0800
                Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-26 03:03 +0100
                Re: A question on designated initializers Don Bruder <dakidd@sonic.net> - 2015-11-25 09:08 -0800
                Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-11-25 18:41 +0100
                Re: A question on designated initializers Don Bruder <dakidd@sonic.net> - 2015-12-02 14:37 -0800
                Re: A question on designated initializers "Pascal J. Bourguignon" <pjb@informatimago.com> - 2015-12-03 00:58 +0100
          Re: A question on designated initializers Don Bruder <dakidd@sonic.net> - 2015-11-24 18:29 -0800

csiph-web