Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

It seems there is a lot of discussion on the web about the differences between these two paradigms, and how OOP is somewhat better than structured programming.

But aren't they complementary? From my point of view one could organize his application following OOP principles and implement its logic using structured programming, couldn't he?

share|improve this question
3  
OOP builds on Structured Programming, and structured programming principles are still used in OOP methods. So, yes. –  Robert Harvey Jun 6 '13 at 1:47

1 Answer 1

up vote 4 down vote accepted

You can argue that OOP builds upon structured programming in general - so yes they are complementary in that sense.

Remember that programming paradigms are mostly about what you don't do:

  • Structured programming removes unconstrained branching and jumping (so that code executes in well-defined structured blocks such as while loops)
  • OOP removes polymorphism via function pointers (instead relying on object methods and virtual dispatch to achieve polymorphism)

You could theoretically conceive of a language that encourages unconstrained branching and jumping but uses objects and OOP-style method dispatch. It would then be OOP but not structured... however it would be a very strange language. I'm not aware of anything like it.

share|improve this answer
1  
BASIC with labels instead of line numbers :) Oh, wait, that's VB6/VBA. Although you could argue that's really object-based, not object-oriented. –  Robert Harvey Jun 6 '13 at 2:02
    
Most of the BASICs I knew never had virtual method dispatch? But yes, it would certainly have that kind of feel.... –  mikera Jun 6 '13 at 2:03
    
I think COM had virtual method dispatch. Not sure, though. –  Robert Harvey Jun 6 '13 at 2:05
2  
Hmmm Visual Basic and COM... I thought I had blanked that horror from my mind, but now it returns :-) –  mikera Jun 6 '13 at 2:07
    
VB6/VBA is a structured language, it does definitely not encourage unconstrained branching. And it supports polymorphism (through dynamic binding), but no inheritance. –  Doc Brown Jun 6 '13 at 6:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.