J
jacob navia
Le 24/02/2014 14:58, Stefan Ram a écrit :
With a consistent naming convention I do not see how this could ever be
a problem.
print_xxx(XXX *data);
is quite easy to use, remember, etc, the same as <<.
As far as I remember C++ is statically typed language, i.e. everything
is known at compile time. Objective C, is not, and you use the method
lookup of the language to figure out dynamically what "print" function
would be called. There is no method lookup in c++ so the compiler
generates in the case of a virtual function a lookup in a specific class
hierarchy that must be given to it at compile time. True, there is a
genericity here that is not there in C.
Do I need that?
How much does that costs me in memory area in my cramped brain?
Do I want that?
Those are questions that everyone answers as he/she likes/must.
I would not blame anyone for choosing C++, I have even worked debugging
C++, everyone must try to feed his/her family somehow.
What bothers me precisely is this lack of respect from C++ programmers
that believe that because they have mastered some c++ trivialities they
are better than people that do not care about them.
Look at how java programmers are laughed at here. Or Fortran
programmers, or whatever. It is this attitude, this lack of respect that
I question.
Thanks
Because in C++, the user can always use the same verb:
... << x ...
... << i ...
while in C, he has to remember individual verbs per type
print_double( x )
print_int( x )
With a consistent naming convention I do not see how this could ever be
a problem.
print_xxx(XXX *data);
is quite easy to use, remember, etc, the same as <<.
or cannot infer a static type at all, because the type is
not know at compile time, in which case one needs to start
to implement OO in C, which is already supplied by the
language in C++.
As far as I remember C++ is statically typed language, i.e. everything
is known at compile time. Objective C, is not, and you use the method
lookup of the language to figure out dynamically what "print" function
would be called. There is no method lookup in c++ so the compiler
generates in the case of a virtual function a lookup in a specific class
hierarchy that must be given to it at compile time. True, there is a
genericity here that is not there in C.
Do I need that?
How much does that costs me in memory area in my cramped brain?
Do I want that?
Those are questions that everyone answers as he/she likes/must.
I would not blame anyone for choosing C++, I have even worked debugging
C++, everyone must try to feed his/her family somehow.
What bothers me precisely is this lack of respect from C++ programmers
that believe that because they have mastered some c++ trivialities they
are better than people that do not care about them.
Look at how java programmers are laughed at here. Or Fortran
programmers, or whatever. It is this attitude, this lack of respect that
I question.
Thanks