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.

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).

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?

P.S. sorry for forgetting about your PM

>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.

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

>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.

Edit: My opinion is obviously biased since I'm learning from high level languages first instead of mid and low level languages. My apologies.

OOP is outdated, if you ask me.

OOP is outdated, if you ask me.

Outdated implies something new and better has come along. Would you care to explain what that is?

Outdated implies something new and better has come along. Would you care to explain what that is?

Anything with a decent generics and type-level metaprogramming system.

commented: You made a good point, something I overlooked O_O +1

Anything with a decent generics and type-level metaprogramming system.

Well I corrected myself and asked if OOD (object oriented design) was more new school?

Sure OOP may have been around for some time, but Design Patterns and analysis weren't well studied until the Gang of Four finally laid down some structure for designs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.