Announcement
Collapse
No announcement yet.
ToaruOS With Kernel Written From Scratch Is Still In Development
Collapse
X
-
-
Originally posted by Luke_Wolf View Post
How do you define Object Oriented Programming? I define it as follows: "Writing code in such a way as to map real world or conceptual objects such as a dog, or a connection to a server to code objects". I think this a generally agreeable definition, and it follows that anything that facilities writing code in an Object Oriented Programming manner, can be classified as Object Oriented. That includes Procedural, Functional, Relational or Declarative languages. Now to take a counterexample C I would generally agree is not an object oriented language, not because you cannot write C code that is more or less object oriented, but because it doesn't facilitate such usage. There isn't really a nice way to handle polymorphism as an easy example, whereas with Rust it's as trivial as C# is.
Data Oriented Programming on the other hand I never could find a solid definition on but it seems to be defined as one of two possible things. #1. Database Languages. #2. To structure your data in such a way as to only expose the data needed by the caller when you cross a boundary. This is to say to write things to roughly follow the idea of the MVVM pattern. I'm going to assume it's the latter definition as opposed to the former. If neither of these is incorrect it would be helpful for you to explain it.
Please, let's see an example, "Muh Unix Principles" don't count because most big problems can't really be decomposed into a set of utilities run from the command line, and layered programming where a layer is a mess of functions I certainly don't consider to be a better alternative.
Objects are tightly bundled items of data and its associated behaviour (i. e. "dog" and "woof"). Thus OOP is about logically connecting data and code.
FP takes an entirely different approach. Here data and behaviour are to be kept separate, leading to immutable, pure functions.
Comment
-
Originally posted by unixfan2001 View Post
Think about it like this:
Objects are tightly bundled items of data and its associated behaviour (i. e. "dog" and "woof"). Thus OOP is about logically connecting data and code.
FP takes an entirely different approach. Here data and behaviour are to be kept separate, leading to immutable, pure functions.
Comment
Comment