Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: comp.lang.objective-c Subject: Re: A question on designated initializers Date: Wed, 25 Nov 2015 18:41:26 +0100 Organization: Informatimago Lines: 31 Message-ID: <874mgaugc9.fsf@kuiper.lan.informatimago.com> References: <87oaeivr7a.fsf@kuiper.lan.informatimago.com> <87d1uyvj8a.fsf@kuiper.lan.informatimago.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net 9oFDVWymndQRAv4KELyUzwaw8XFvSv+/YaVdupxZXAUaBILdU6 Cancel-Lock: sha1:YjdkM2YwZjNlMGNiNzM5OWI3MDEyZjllMjAwN2JjZGFjZmMxOTA1ZQ== sha1:NXy4cPMtpxkXUWgcS+4RSHfPCfQ= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Xref: csiph.com comp.lang.objective-c:238 Don Bruder 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! > 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. -- __Pascal Bourguignon__ http://www.informatimago.com/ “The factory of the future will have only two employees, a man and a dog. The man will be there to feed the dog. The dog will be there to keep the man from touching the equipment.” -- Carl Bass CEO Autodesk