•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 391,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,835 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 328 | Replies: 10
![]() |
•
•
Join Date: Jun 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hello everyone,
I'm learning programming for the first time and my first book i bought from the book store is the new Deitel C++ 6th edition. After reading the first several chapters I got so overwhelm with the authors verbose; I went out and bought C++Primer. One thing I noticed is that Deitel creates class and member functions definitions: constructors, member function and data members, etc..outside main function. Then initialize and call class object and member function implementation in main.
On the other hand C++ Primer doesn't do it, they create and initialize everything under main function as one source code program.
So i was curious are there C++ standards or rules on the way to create object-oriented programs properly?
Deitel surely force C++ rules heavily throughout this book compare to Primer.
I'm learning programming for the first time and my first book i bought from the book store is the new Deitel C++ 6th edition. After reading the first several chapters I got so overwhelm with the authors verbose; I went out and bought C++Primer. One thing I noticed is that Deitel creates class and member functions definitions: constructors, member function and data members, etc..outside main function. Then initialize and call class object and member function implementation in main.
On the other hand C++ Primer doesn't do it, they create and initialize everything under main function as one source code program.
So i was curious are there C++ standards or rules on the way to create object-oriented programs properly?
Deitel surely force C++ rules heavily throughout this book compare to Primer.
•
•
Join Date: Jun 2008
Location: Washington
Posts: 603
Reputation:
Rep Power: 3
Solved Threads: 50
•
•
•
•
Hello everyone,
I'm learning programming for the first time and my first book i bought from the book store is the new Deitel C++ 6th edition. After reading the first several chapters I got so overwhelm with the authors verbose; I went out and bought C++Primer. One thing I noticed is that Deitel creates class and member functions definitions: constructors, member function and data members, etc..outside main function. Then initialize and call class object and member function implementation in main.
On the other hand C++ Primer doesn't do it, they create and initialize everything under main function as one source code program.
So i was curious are there C++ standards or rules on the way to create object-oriented programs properly?
Deitel surely force C++ rules heavily throughout this book compare to Primer.
In my opinion, OOP is the new-school style of programming and would most likely be good practice for you.
Doing everything strictly in main is really for people who are just being introduced to programming (in my opinion, once again).
•
•
Join Date: Oct 2007
Location: Cambridge, MA
Posts: 229
Reputation:
Rep Power: 1
Solved Threads: 19
•
•
•
•
In my opinion, OOP is the new-school style of programming and would most likely be good practice for you.
Doing everything strictly in main is really for people who are just being introduced to programming (in my opinion, once again).
OOP is old-skool!! What mean you?
>they create and initialize everything under main function as one source code program.
How far into the book are you? Beginner books generally keep it simple at first and ease into full blown OO techniques. Also, don't forget that C++ is not an object oriented language, it's a multi-paradigm language and one of those paradigms is OO.
>So i was curious are there C++ standards or rules on
>the way to create object-oriented programs properly?
Ask ten different people how to write object oriented programs properly and you'll get ten different answers. So yes, there are standards and rules. Lots of them. Many of them contradict each other too.
>Deitel surely force C++ rules heavily throughout this book compare to Primer.
To be honest, I was never a fan of Deitel books. They're huge, expensive, cover unrelated topics, and every time I've flipped through one, the code has made use of unconventional idioms.
How far into the book are you? Beginner books generally keep it simple at first and ease into full blown OO techniques. Also, don't forget that C++ is not an object oriented language, it's a multi-paradigm language and one of those paradigms is OO.
>So i was curious are there C++ standards or rules on
>the way to create object-oriented programs properly?
Ask ten different people how to write object oriented programs properly and you'll get ten different answers. So yes, there are standards and rules. Lots of them. Many of them contradict each other too.
>Deitel surely force C++ rules heavily throughout this book compare to Primer.
To be honest, I was never a fan of Deitel books. They're huge, expensive, cover unrelated topics, and every time I've flipped through one, the code has made use of unconventional idioms.
Member of: Beautiful Code Club.
•
•
Join Date: Jun 2008
Location: Washington
Posts: 603
Reputation:
Rep Power: 3
Solved Threads: 50
•
•
•
•
OOP is old-skool!! What mean you?
P.S. sorry for forgetting about your PM
Don't worry about that XD, I thought you were annoyed with the depth of the question @_@.
Back on topic though--
Before OOP and design patterns, everything was done through a slew of processes either in one method/function or another.
This caused serious problems, because changes from one function or changes to a variable would cause drastic changes to the entire system which slowed productivity for many companies.
Adding new features to systems was also quite a task, because you had to add the feature to every function and add a specialized case for that feature if it was specialized.
There's way more to it than that but I'd like to keep this as a brief explanation before I dive further into the book I'm reading.
Although OOP was introduced in the 20th century, I still consider it fairly "new school," or perhaps maybe it's probably more appropriate to say OOD and patterns with OOP is more-so new school.
Would you agree with me there? =P
Last edited by Alex Edwards : 33 Days Ago at 11:41 am.
>This caused serious problems
This I don't agree with. Yes, OOP shines when it comes to organizing large projects, but if structured design caused serious problems, it's because the designer messed up. Your description seems to assume that anything non-OO is inherently flawed, which is not the case.
>Adding new features to systems was also quite a task, because you had to add the feature
>to every function and add a specialized case for that feature if it was specialized.
As opposed to inheriting a new class and implementing the new feature. Of course this is assuming that the hierarchy was properly generalized in the first place, otherwise you're stuck with adding the feature to every function and adding a specialized case for that feature if it's specialized.
Also keep in mind that a well designed system will allow for adding new features with minimal work, regardless of the methodology your design uses.
One reason OO has been hyped so much is because people insist on comparing the best case scenario using OO with the worst possible designs using other paradigms.
This I don't agree with. Yes, OOP shines when it comes to organizing large projects, but if structured design caused serious problems, it's because the designer messed up. Your description seems to assume that anything non-OO is inherently flawed, which is not the case.
>Adding new features to systems was also quite a task, because you had to add the feature
>to every function and add a specialized case for that feature if it was specialized.
As opposed to inheriting a new class and implementing the new feature. Of course this is assuming that the hierarchy was properly generalized in the first place, otherwise you're stuck with adding the feature to every function and adding a specialized case for that feature if it's specialized.
Also keep in mind that a well designed system will allow for adding new features with minimal work, regardless of the methodology your design uses.One reason OO has been hyped so much is because people insist on comparing the best case scenario using OO with the worst possible designs using other paradigms.
Member of: Beautiful Code Club.
•
•
Join Date: Oct 2007
Location: Cambridge, MA
Posts: 229
Reputation:
Rep Power: 1
Solved Threads: 19
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,543
Reputation:
Rep Power: 36
Solved Threads: 860
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Other Threads in the C++ Forum
- Previous Thread: trouble declaring vectors as data members in class
- Next Thread: cout problems



Linear Mode