Procedural programming, OOP or a bit of both?

Tweet

How do you prefer to program?

There are plenty of arguements for and against both, but at the end of the day, which do you use?

  • are you a Object Orientated Programming (OOP) devotee?
  • a Procedural Programming fanatic?
  • or perhaps you prefer to work both sides of the street?

Tell us which and why?

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Aedus

    I really only work on smaller, personal web development projects.

    With that in mind, I still write my reusable code in OOP. Then I mostly string the project together procedurally.

  • Kailash Badu

    A bit of both . The last thing I would want to see is the people making absolute statements like XX is the only way to go. I prefer to organize frequently reusable modules that make sense as an distinct entities into classes and routines. Others tend to be procedural, generally. Nothing is carved in stone.
    The search link you posted has expired.

  • Kailash Badu

    BTW, your search link has expired.

  • http://www.terminalfuture.com/ eljefe

    I prefer a 99% object oriented route. I love abstraction especially for code maintainability, however there are instances where I’ll do purely procedural. Quick php scripts used by ajax scripts, things like that are best suited for a small, 20 line procedural page.

  • web.dami

    Large projects: OOP
    Smaller Bits: Procedueral (Re-using OO Methods)

  • http://www.tonymarston.net Tony Marston

    My web application framework is based on the 3 Tier Architecture, and both the business layer and data access layer are 100% OO. My presentation layer, however, is 100% procedural, and all my HTML generation is via XSLT which is definitely not OO.

    Why do I like this mix? Because I do not share the opinion that “everything is an object”, or that “OO is best”. I am in the business of providing solutions, not to follow a theoretical set of programming or design principles.

  • ionix5891

    OO approach

    over the last few years i have build a very nice framework for myself that allows me to quickly make features/sites also it works nicely with other frameworks/libraries such as Zend Framework

    also the newer code is progressively alot more maintainable and less buggy thanks to testing and loose coupling between components,

    2 years ago it was weird mix of both ways i used but now i have to maintain that old web application (used by 110,000 people daily) and when i compare it to latest code i just think to myself “damn i can provide X faster/better/more efficient now thanks to sticking with OO”

  • Simon

    You missed out functional programming – when I’m writing Python and JavaScript I often turn to functions and closures in place of objects if I want to encapsulate a small piece of state along with a function that acts on it. These days most of the JavaScript I write makes heavy use of closures and a functional programming style.

  • http://www.cemerson.co.uk Stormrider

    Mostly OO, with a bit of procedural. I use Object orientation for… objects. I don’t believe in having things like a ‘User Registration’ object or something, which I have seen before – that is an action, not an object. I will use procedural style for very small apps that are usually temporary, but the benefits of switching to OO (when I learned it years ago) from procedural was a real eye opener!

  • Keith

    OO

    With the frameworks that are available for most languages nowadays there really isn’t an excuse to code anything outside of the most tiny projects procedurally any longer.

  • Tim

    I’m a firm believer in using the method best suited to the language as a first port of call. eg. C#=00, PHP=mixed, Javascript=mixed, etc, etc

  • http://www.digitalgreenlight.com busy

    OO

    For the most part anyways. I do deviate, but I often regret it.

  • shadowcaster

    PHP makes it really easy to code procedurally because you could write a really small bit of code and it would just work without hassle. This was pretty much the expected way of programming since the beginning and people who have grown up with PHP have very little OOP code handy. I prefer OOP but most of my code is procedural.