C++ is 100% Object Oriented
-
Is C++ is 100% OOP language? If yes, Justify If not, why
C++ is a blend of OO, functional, and generic programming. It is basically a catch-all language that you can do anything with.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
_AnShUmAn_ wrote:
But in C++ there is a friend function, using which you can not only access the variable's value you can also modify it that even from outside the class. Thus violating Encapsulation.
This is not true. The explanation is written here : http://www.parashift.com/c++-faq-lite/friends.html#faq-14.2[^] To answer the original question: No, C++ is not 100% OO, simply because it remains compatible with C. It's a sickness that does seem to be defeatable, that people insist on regarding C++ as an extension of C and therefor being totaly OK with producing crazy mix code that is bad in both worlds. I believe, that one can write 100% OO in C++, but i really can't proof that. Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
Mr.Brainley wrote:
The explanation is written here
Thanks for that lovely article. Actually what's written in the books are the very basics that could go wrong (Just like this one ditched me) when you grow up in this world.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Is C++ is 100% OOP language? If yes, Justify If not, why
anilFirst wrote:
Is C++ is 100% OOP language?
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
_AnShUmAn_ wrote:
But in C++ there is a friend function, using which you can not only access the variable's value you can also modify it that even from outside the class. Thus violating Encapsulation.
This is not true. The explanation is written here : http://www.parashift.com/c++-faq-lite/friends.html#faq-14.2[^] To answer the original question: No, C++ is not 100% OO, simply because it remains compatible with C. It's a sickness that does seem to be defeatable, that people insist on regarding C++ as an extension of C and therefor being totaly OK with producing crazy mix code that is bad in both worlds. I believe, that one can write 100% OO in C++, but i really can't proof that. Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
Mr.Brainley wrote:
Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
main()
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
_AnShUmAn_ wrote:
But in C++ there is a friend function, using which you can not only access the variable's value you can also modify it that even from outside the class. Thus violating Encapsulation.
This is not true. The explanation is written here : http://www.parashift.com/c++-faq-lite/friends.html#faq-14.2[^] To answer the original question: No, C++ is not 100% OO, simply because it remains compatible with C. It's a sickness that does seem to be defeatable, that people insist on regarding C++ as an extension of C and therefor being totaly OK with producing crazy mix code that is bad in both worlds. I believe, that one can write 100% OO in C++, but i really can't proof that. Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
Mr.Brainley wrote:
I believe, that one can write 100% OO in C++, but i really can't proof that.
You can write pure OO code in C++, but why would you want to? OOD/OOP is overkill (and actually doesn't fit well) for many things, which is why generic programming is also a strong feature in C++.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
Mr.Brainley wrote:
Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
main()
-- Help me! I'm turning into a grapefruit! Buzzwords!
See, that's my problem. Too often I don't see the obvious ...
-
Mr.Brainley wrote:
Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
main()
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
main() isn't the member of a class, it's a global function, which doesn't fit with the OO paradigm
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
main() isn't the member of a class, it's a global function, which doesn't fit with the OO paradigm
-- Help me! I'm turning into a grapefruit! Buzzwords!
you can easely change the entry point of a program through the compiler option /ENTRY:function. See help[^] How to do this:
class MyApplication { int __stdcall Run(int argc, _TCHAR* argv[]); }; int __stdcall MyApplication::Run(int argc, _TCHAR* argv[]) { // Place your code here return 0; }
Then change the entry point in the property settings of the project from blank (default) to MyApplication::Run. This way the program only excist out of one class embedding the entry point.
codito ergo sum
-
Is C++ is 100% OOP language? If yes, Justify If not, why
The notion of 'object oriented' is a moving target. Here[^] is an interesting little article that discusses the different views held by some languages that support 'object oriented' programming. The article is a response to an essay by Paul Graham[^]. His essays make good reading and while you're at it, browse his site. I think most people will find it interesting -- whether you agree with his views or not. His writing can be thought provoking, or at very least provocative. Later, Dan
Be clear about the difference between your role as a programmer and as a tester. The tester in you must be suspicious, uncompromising, hostile, and compulsively obsessed with destroying, utterly destroying, the programmer's software. ------------ Boris Beizer
-
Is C++ is 100% OOP language? If yes, Justify If not, why
C++ supports multiple programming padigrams; Object Oriented programming is just one of the supported padigrams. Others include generic programming. What do you mean by "100% Object Oriented"? It provides support for most OO concepts but does not force you to use them.
Steve