Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The opposite of object oriented?

Tags:

oop

php

I am, unfortunately, working with some very messy software written by an individual who does not know much programming. It's not object oriented, and the author actually forwards individuals between files in order to execute different scripted functions. Entire pages are wrapped in if/else statements. Each file has its own SQL connection method, each has its own everything, and well - it's the epitome of why we should use OOP.

So my question to you guys is, what's this programming style technically called? I'm writing somewhat of a report on it

like image 338
Kavi Siegel Avatar asked Mar 23 '11 03:03

Kavi Siegel


2 Answers

It is called spaghetti code

like image 122
zerkms Avatar answered Sep 20 '22 04:09

zerkms


There is such thing as a clear opposite to object oriented programming paradigm, but there other paradigms:

  • Non-structured programming

    This is basically the style people use, when they have just learned programming. Nowdays most commonly found in for of shell scripts, poorly written assembler code and "include-oriented programming" style in PHP. It is also how most the code, that you can find, in BASIC is written.

  • Procedural programming

    Something like next iteration in programming practices, with introduction in routines (functions, procedures). Code is separated in reusable chunks.

    This is the most common paradigm for PHP code that you can find in the wild web. It is good for small to medium applications. Also, keep in mind that static methods in classes are also part of procedural paradigm.

These two would be the closest you can get to the "opposites of OOP". But there are a lot more paradigms. The other two you might want to look into would be:

  • Aspect-oriented programming
  • Functional programming

Also, I would highly for you to watch this video: Programming With Anthony - Paradigm Soup [4:35]

like image 33
tereško Avatar answered Sep 20 '22 04:09

tereško