What are the advantages and disadvantages of each?
In your opinion, is OOP better than procedural programming?
Started by DarkLordoftheMonkeys, Nov 07 2009 10:07 AM
6 replies to this topic
#1
Posted 07 November 2009 - 10:07 AM
|
|
|
#2
Posted 07 November 2009 - 12:10 PM
It depends HEAVILY on the context. As an abstraction mechanism, I find OOP far more useful. For ease of understanding, procedural probably wins. Large chunks of OOP code are actually procedural, in many cases, so they aren't really an either/or situation.
#3
Guest_Jordan_*
Posted 07 November 2009 - 02:43 PM
Guest_Jordan_*
Check out this thread: http://forum.codecal...procedural.html
A lot of good info there on this subject in particular.
A lot of good info there on this subject in particular.
#4
Posted 07 November 2009 - 03:27 PM
I looked at that thread and found a lot of what people were talking about to be familiar. I have used OOP languages (Javascript and Java) in my freelance coding, but most of what I end up doing with those languages is procedural. I only end up ever using objects when those objects are already there, like the document object in Javascript. I rarely end up creating my own objects, and a lot of the facilities of OOP, such as class inheritance, are things that I fail to take advantage of. This may of course be because I've never done anything real large scale, like an application. Mostly I think it boils down to my lack of experience and skill in programming. Right now I'm learning Shell and sed, which are both procedural languages, and I find them to be simpler and easier to learn than OOP, yet still useful. Maybe as my skills increase and I move on to more complex tasks I will be able to tell the difference between a problem to be solved using OOP and a problem to be solved in a procedural way.
#5
Posted 07 November 2009 - 05:20 PM
From the research I've done, OOP doesn't really give you anything until you get to a decently large application.
#6
Posted 08 November 2009 - 02:56 AM
Yes, advantages of OOP are visible especially in large applications.
However, we do code reviews quite often at our company, and it is amazing how often the "experienced" guys use OOP incorrectly, which leads to worse code than if someone simply disallowed them using implementation inheritance (not multiple inheritance - I mean SINGLE inheritance). I saw inheritance in various places made only because "some method required this object to be a Module, so we made it extend the Module class". So, as with any other high-level concept, it may be sometimes dangerous. That is why for high-level OOP design we generally have separate designers.
It also seems that by OOP most programmers really mean OOP+procedural (e.g. Java or ObjectiveC), but this is not the only possibility. You can also have OOP+functional paradigm (CLOS) or OOP+procedural+functional hybrids (Scala, Groovy, Ruby or JavaFX script). IMHO the statically typed ones from these goup seem to be the most expressive and powerful, though they can be easier abused and require much more responsibility than the OOP+procedural languages. Oh, and there is also a pure OOP paradigm - modelling/simulation languages like VHDL/SPICE are good examples of this.
However, we do code reviews quite often at our company, and it is amazing how often the "experienced" guys use OOP incorrectly, which leads to worse code than if someone simply disallowed them using implementation inheritance (not multiple inheritance - I mean SINGLE inheritance). I saw inheritance in various places made only because "some method required this object to be a Module, so we made it extend the Module class". So, as with any other high-level concept, it may be sometimes dangerous. That is why for high-level OOP design we generally have separate designers.
It also seems that by OOP most programmers really mean OOP+procedural (e.g. Java or ObjectiveC), but this is not the only possibility. You can also have OOP+functional paradigm (CLOS) or OOP+procedural+functional hybrids (Scala, Groovy, Ruby or JavaFX script). IMHO the statically typed ones from these goup seem to be the most expressive and powerful, though they can be easier abused and require much more responsibility than the OOP+procedural languages. Oh, and there is also a pure OOP paradigm - modelling/simulation languages like VHDL/SPICE are good examples of this.
#7
Posted 09 November 2009 - 12:55 AM
i got used to write every thing in oop no matter how small and simple it is :D


Sign In
Create Account


Back to top









