• 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: Mutability
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutability


  • Subject: Re: Mutability
  • From: Julien Dufour <email@hidden>
  • Date: Wed, 21 Nov 2001 16:37:43 +0100

On Wednesday, November 21, 2001, at 02:57 PM, Ondra Cada wrote:

So far as I understand OOP, the proper OO point of view is "give _any_
object to me; I'll determine what kind it is, and I'll behave accordingly".

That's not OOP, that untyped langage programming.

[Delete]

DMC> Really, using things like "isKindOfClass" is often a symptom of bad
DMC> design.

Is it?!? I'd say it is a symptom of _THE PROPER_, ie. run-time design, as
compared with the bad, C++-like compile-time one!

No it's really not. You are recommending untyped langage instead of typed ones. Typechecking is compilation stage where the compiler tells you if you are doing something wrong. Stronger typesystems lead to robuster programs. With the ""give _any_ object to me; I'll determine what kind it is, and I'll behave accordingly" philosophy (untyped philosophy), anything can happend at runtime. You then have to produce much more complex code to check what happend and to handle invalid cases... etc. You do compiler's work here (aren't computer there to work instead of us).

This work SHOULD be done by the compiler. It won't commit mistake (but you will), it is automatic, you save time and work, and you procuce more safe code, you have less to debug! Moreover, your code will be much faster as lot of tests are not needed anymore, and many optimisations are made possible.

The dictinction between mutable objects and not mutable ones, even if the same objects are used behind (I think it is the case, but we do not have to know, that's implementation, not interface!), is a really good thing. It uses as much as possible the poor capabilities of ObjectiveC/Java type systems.
--
Julien Dufour


  • Follow-Ups:
    • Re: Mutability
      • From: "Josh Braun" <email@hidden>
    • Re: Mutability
      • From: John Hörnkvist <email@hidden>
    • Re: Mutability
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Mutability (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: CD format
  • Next by Date: NSBundle and localization question?
  • Previous by thread: Re: Mutability
  • Next by thread: Re: Mutability
  • Index(es):
    • Date
    • Thread