John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Catégorie:
Code, syntaxe and commandes
>>>>In fact you never use a base class if you can help it. You inherit not cut and paste if you want to change/modify functionality.
>>>
>>>This seems contradictory. Can you explain?
>>
>>I don't think Bernard meant you should never use base classes. I think he meant if you want to change the functionality you should inherit rather than cut and paste. (Well, duh).
>
>He says don't use a base class, but to inherit. What will you inherit from? Unless I am missing something that doesn't make sense at all.
What I think he meant is: "don't use a base class directly by adding code to it. Inherit from it and place your code in that subclass".
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement