Hmm...where do I even start? I''d best go in order.
EvilTwin: You''re right, he was talking about what you do with your fingers on a keyboard. My apologies both to the author (whom I now know most certainly understands something about data types) and anyone who was misled by my comment.
(BTW, I have seen programmers who think data types are a bother.)
MadKeithV: I was not saying that all member functions need "this" pointers, or anything remotely related to that. The article mentioned needing the convenience of the implicit "this" pointer, and I was pointing out the only way to get it.
(Looking at it later, I think the trouble is that C static functions and C++ static member functions are two very different things.)
Now we have a problem...there seems to be at least two different anonymous posters, as one signs his/her /Siigon, another doesn''t sign a name, and the third one uses /frosty. So I''ll just use the two names given and ask all the anonymous posters to please find the correct argument.
Anonymous Poster: Check out the term C++. To non-C/C++ coders here, I understand it to mean the "next iteration of C." There were some necessary corrections to the language syntax. The examples you gave are from ANSI C''s compatibility with K&R C, and although C++ is compatible with ANSI C syntax, it does not support the K&R C syntax. You might as well have cited this difference (which I heard has been eliminated from C code):
void function()
int x;
int y;
{
}
#include "multi-page rebuttal of C++ makes big projects harder"
(meaning I''ll add it later tonight, if I get the time)
Regarding your argument of overloaded operators, they are not syntactic sugar - the operator implementations for each data type are quite clearly defined in the standard. Same operators (+, -, *, /, <<, etc.), different implementation. That''s operator overloading. C does operator overloading. It would be ludicrous to you think the existence of different data types doesn''t require operator overloading. I think what you really mean is that user-defined operator overloading (which is what C++ supports over C) is bad. That''s just plain denial. Look at 3D matrix math, and tell me the mathematical definition of the matrix data type doesn''t require overloaded operators.
Regarding the properties of the sets of numbers, that can be found in any algebra text. I''m not here to explain the fundamental principles of algebra - just the C++ implementation of them.
quote:
Excerpt from Algebra 2, Lesson A, section D, page 8-9
Understanding algebra is easier if we make an effort to remember the difference between properties and definitions. A property describes the way something is. We can''t change properties. We are stuck with properties because they are what they are. For instance,
3 + 2 = 5
and
2 + 3 = 5
The order of addition of two real numbers does not change the answer. We call this property the commutative property of real numbers in addition. "
Definitions are different because they are things that we have agreed upon. For instance,
3^2
means
3 times 3
It didn''t have to mean that. We could have used 3^2 to mean 3 times 2, but we didn''t. We note that the order of operations is also a definition. When we write
3 + 4 * 5
We could mean to multiply first or to add first. Since we cannot have two different answer to the same problem, it is necessary to agree on the meaning of the notation. We have agree to do multiplication before algebraic addition, and so this expression represents the number +23.
Also, when we wish to write the negative of 3^2, we write
-3^2
When we wish to indicate that the quantity -3 is to be squared, we write
(-3)^2
These are definitions of what we mean when we write
-3^2
and
(-3)^2
and there is nothing to understand. We have defined these meanings to have the meanings shown.
If you''ll notice the wording in the very first paragraph of the excerpt, you''ll see that the commutative property belongs to the set of real numbers. Operators are just something that humans have defined: a definition.
Regarding the definition of Object-Oriented programming, data encapsulation is an essential principle. It''s the whole driving principle behind objects, really, or they wouldn''t be objects. That''s why terms other than Object-Oriented exist: procedural(using all globals), structural (using data structures with procedures), object-based (using objects which have responsibility and support messaging, but are not polymorphic), and object-oriented (object-based, but with the addition of polymorphism and thus inheritance). Defining new types requires that those types be responsible for their internal memory usage (a small part of data encapsulation), which requires destructors.
Another fundamental property of objects is messaging, or what is sometimes called active data structures. The classes need to be bound together in one coherent class (another essential principle). I can cite articles to this effect, if you like.
Regarding strong typing, need I say anything at all? This has to be about the silliest argument in programming. The whole of programming is manipulating data. Thus, data typing is one of the most important features in the language. Mixing learning the language''s casting with learning algorithms is an obvious recipe for disaster. Not knowing the language while trying to write algorithsm would be equally disastrous. Your argument is like saying that power saws are stupid and useless because in the hands of a minor they might hurt someone.
frosty: Sorry to burst your argument (and it''s a good one, btw), but if you''ll re-read my post, I was talking about the use of the language by a particular type of people, and not the language design. Structural code is really just emulating OOP, etc. because people think in objects. There are probably more advanced paradigms than OOP, like perhaps generic programming. But each previous paradigm builds on the design of the previous set. Don''t tell me OOP was possible without the idea of functions (procedural programming). One comes before the other, and they progress, but they are really modeling the human thought processes.
Comparing Java to C++ would be kind of neat, but I don''t really know Java. I''m not a C++ "zealot," unless you call using what you currently know is most efficient being blind. If something better comes up, I''ll switch. But C is not better (and that''s the basic argument here).
-
null_pointerSabre Multimedia