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.

Procedural programming means coding the application is a series of tasks. Do A, then do B, then Do C. And often wrap these tasks in procedures or functions that can be easily called and run several times in the code.

Object Oriented Programming is also often done by doing A, then doing B, then doing C. But objects are used (and correct me if I'm wrong because I'm not sure) as sophisticated ways to store, manipulate and hide data. This affects significantly the design of the program. But the overall flow of the application is still do A, then do B, then do C.

Do you agree? If so, would you say that OOP is essentially a type of Procedural Programming?

share|improve this question

marked as duplicate by gnat, davidk01, Bart van Ingen Schenau, jwenting, MichaelT Mar 7 at 13:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

Object Oriented languages are not required to be procedural, OCaml (or F#) is an Object Oriented language that is fundamentally functional.

Now most Object Oriented languages are imperative and procedural but possess features or frameworks that allows some Aspect / Behavioral / Functional programming inside them, in C# for instance you can use lambda and anonymous methods for functional programming, attributes (annotations) for declarative programming, and post-compilation IL modifications for Aspect programming.

share|improve this answer

Object Oriented languages is more a clarification on how data is encapsulated, not how the flow of control is programmed. Scala for instance supports both functional and procedural programming styles, where one may manually run a function on each item in a array through a loop

var arr = Array(<data>) 
for(item <- arr) {
   foo(item) 
}

Or one could simply tell the array it should run the function

arr.foreach(foo)

OOP is encapsulating and separating code, which should allow better finding of bugs, and keeping bugs more confined.

Procedural is programming one thing after another, where in functional one would rather tell what should happen rather then the exact order that it should happen.

Maybe look at this question What exactly is procedural programming? How exactly is it different from OOP? Is it the same as functional programming?

share|improve this answer

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