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 repor开发者_运维技巧t on it
It is called spaghetti code
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]
I would call it Rubble Oriented Programming.
Imagine taking a large building with lots of structure, then knocking it down. There's remnants of that structure (frameworks, etc) but the pieces just aren't put together. It's a giant pile of rubble.
It's an execrably bad example of procedural programming. see http://en.wikipedia.org/wiki/Procedural_programming
Also known as the Big Ball of Mud, the most common design pattern out there.
You can just call it "Non Object Oriented".
精彩评论