Tuesday, April 07, 2009

Procedural Programming is NOT a Bad Thing!

For way too long now, I've heard proponents of object-oriented programming describe badly written programs as "procedural", as if to imply that procedural programming is a Bad Thing.

Good design is possible using any programming paradigm, just as bad design is. Stop using procedural programming as a derogatory term!

I personally prefer multi-paradigm programming, so that I can use the paradigm that feels right for the job at hand.

5 comments:

J R said...

This controversial topic attracts my comment like a magnet.

I call no programming paradigm evil. Procedural programming is no exception.

However, composition of data and operations can be expressed more powerfully with the object oriented programming. Greater powers of composition greatly facilitate managing change, hiding complexity, writing self documenting and testable code.

Such powers bring complexities of their own. I am not religious about programming paradigms. I tend to default to procedural programming, and let the objects evolve out of the procedures as the software grows. I also make liberal use of functional programming.

Take my favourite programming language, Ruby. It has wonderful support for procedural, object oriented and functional programming. Many of my ruby programs end up using all three paradigms.

quasi said...

The speed of the web community to 'explore' has made indigestion a common ailment. I hear so many of the 'wow look x is sooooo freaking cool'. which it might in actuality be, but my doubt lies generally with the authors patience to digest and then make a statement like that.

So I totally agree with you. :) In fact, IMHO, for simpler, well defined tasks procedural programs might as well be the most straightforward and efficient ones as they come with the least baggage.

"Take my favourite programming language, Lisp. It has wonderful support for procedural, object oriented and functional programming. Many of my Lisp programs end up using all three paradigms." (well, ok, many might be too much there hehe)

Sandeep Shetty said...

According to the Wikipedia page on multi-paradigm programming languages,
Ruby support three paradigms (functional, imperative, class-based object-oriented) while Lisp support four (functional, imperative, class-based object-oriented, reflective). According to that page, my optimistic language of choice PHP support two paradigms (imperative, object-oriented) which is dated information now that PHP has support for functional aspects.

Vikash said...

A bad programmer can create a very well defined object oriented mess and a good one can write poetry in procedures. :)

hidden object games said...
This comment has been removed by a blog administrator.