• [^] # Re: Destructeurs

    Posté par . En réponse à la dépêche Sortie de Ruby 1.8.5. Évalué à 3.

    J'ai lu cela justment il y a quelques jours.
    http://today.java.net/pub/a/today/2006/08/24/five-habits-of-(...)
    Toute une série de conseil, dont le premier est une réponse à ta question: "Constructor Performs Minimal Work"

    Pour le détail de l'argumentation: "its constructor will only load data into its instance variables using the constructor's parameters."

    "A constructor is used to create an instance of an object. A constructor's name is always the same as the object's name. Since a constructor's name is unchangeable, its name is unable to communicate the work it is performing. "

    "the readability of the software is high because the constructor simply creates an instance of the object, letting the behavior and state-changing methods do the rest."
    Voilou..