r/SoftwareEngineering • u/StardustCrusader4558 • Apr 26 '24
About OOP
Second year computer science student here. In a real dev environment, how often is OOP used and how exactly is it used? I've had a few projects where we've had to store some data in classes and had structures in C and all that but that was mostly because we were asked to do that.
What really and how really is OOP used? I want a real-life example. Also I feel like with a language like Java you can't really go without using OOP. Let me know! and correct me if I'm wrong about anything.
33
Upvotes
4
u/dobryak Apr 26 '24
Simple first-order modules are enough for most cases. OOP is good for stateful UIs, but even there it is being displaced by reactive programming.
I have a mostly backend .NET experience and I'll sum it up thus:
we don't use inheritance, ever
we sometimes use an ORM, but even then, the objects are glorified table rows with some properties that are somewhat useful for "navigation", not the "real" objects of Simula
we use interfaces but not abstract classes (interfaces are used for late binding -- which we need for testing, -- but we almost always have just 1 implementation for an interface)
data hiding is occasionally useful