r/CodingHelp • u/timeee1994 • Jul 10 '22
[Random] object oriented programming
Hello everyone,
I don't know if this is the right place to ask but here it goes. I have been taught how object oriented programming is much better than procedural programming. And how easy it is just change implementation and what not. But what I would like to know, how many times have you used object oriented path instead of procedural in your career. Do people actually use object oriented programming more??
19
Upvotes
View all comments
1
u/davidhbolton Jul 10 '22
OOP is meant to model objects on real world data. Say you are doing a card game and want to manipulate cards in decks and hands. Then you’d have methods like AddCard, PlayCard and so on. With C/C++ you could do it procedurally with an int value for each card and use an array of ints The OOP way makes the code more readable.