Le sam 07/06/2003 � 18:11, Raphael Manfredi a �crit :
> Quoting <[EMAIL PROTECTED]> from ml.softs.gtk-gnutella.devel:
> :Le ven 06/06/2003 � 23:16, Raphael Manfredi a �crit :
> :> (I can develop why I think C++ is not an OO language if you want.)
> :Yes I would like. I always heard favors on C++ (implicit memory
> :management, 'inline' checkings, inheritance, reusability of tested
> :classes, ...) but I'm interrested in knowing drawbacks.
>
> Well, C++ has no garbage collector. That is mandatory in any OO language
> I think .
>
> Then C++ is not a real OO language because it lacks the following:
>
> * Genericity (constrained). Don't tell me about templates, they're a joke
> that can only fool people who have never experienced genericity.
Template is a trick for low level efficient implementation. I think no
template should be provided in a non low level library (but the library
could use it).
I not sure I understand what you call genericity. I think a kind of
genericity can be provided in the classes on which the classes of an
application rely (as the 'java.lang' and 'java.util' Java packages).
What do you call 'constrained' ?
> * Multiple inheritence. C++'s notion of MI is just a joke that made a
> bad reputation to MI in general. For a clean MI that works, look at Eiffel.
I only know Eiffel from name. I know it is used for clean softwares.
What is the difference ?
> * C++ is contravarient but should be covarient. All decent OO languages
> should be covarient. What is covariance? It means the type redefinition
> follows the hierarchy. Contravarient means its goes backwards with the
> hierarchy.
Can you give me an example ?
> * C++ lacks design by contract in the language. This means inheritable
> precondition / postconditions, class invarients.
Use a method like 'this->invariant()' where invariant should be tested.
----
void MyClass::invariant(){
assert(condition_1 && condition_2 && ...);
}
----
Use 'assert()' where to test pre/postconditions.
For inheritance, I mean you're right only for
preconditions/postcondition since you can define a sub class with the
following method:
----
class MyClassChild : MyClass{
// ...
void MyClassChild::invariant(){
MyClass::invariant();
assert(cond_1 && cond_2 && ...);
}
// ...
}
----
> * C++ lacks selective exporting. Its notion of "friend" is a joke.
I don't like the "friend" concept since it tends to make us designing
bad. Do you mean public, protected, private is enought ?
> * C++'s handling of attributes in a class is not correct. There is no
> transparent access to an attribute as if it were an argumentless method.
I don't understand.
> * C++ requires that routines be declared "virtual" to be polymorphic.
I'm agree it should be the default behavior but allow static linked
methods for efficiency.
> * C++ lacks "deferred" classes ("abstract" in java) in the sense that it
> won't let anyone implement an interface with pre-/post-conditions but
> without an implementation body.
I mean I understand what you previously said on pre-/post-conditions
inheritance.
> I'm not sure OO leads to self documenting. You should see the kind
Humans can better browse classes than browse not grouped method and data
structures which are not intended to be user from outside.
At first, a human can not remember easily more than 7 entities (that's
human nature). Managing a fuzzy global property (i.e. group of
properties and behaviors: object) is easier for a human.
At second, the code reader have to guess which functions and data are
"public" and thus which functions and data he can use.
J�r�me
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel