This is the first ever post in my life. Don't get me wrong.
I feel like Object Oriented Programming is an overhead. It adds more complexity to the project.
This is what I think.
I want to know your opinion on this.
Thank you!!
This is the first ever post in my life. Don't get me wrong.
I feel like Object Oriented Programming is an overhead. It adds more complexity to the project.
This is what I think.
I want to know your opinion on this.
Thank you!!
For further actions, you may consider blocking this person and/or reporting abuse
deverm -
CyberFriend -
Chris Jarvis -
Kailash Nirmal -
Top comments (1)
Above a few hundred lines of code, I need to start limiting the complexity of the app by using some architectural patterns and principles. For example, dependency injection can be used to provide some interchangeable behaviour to another object. Let's say you want to save a string to a file. You can then create and use a StringToFile object:
Later, you are asked to save the string to a key-value store instead. You suddenly have new parameters:
However, because the save function has one argument only, which is the string to be saved (and not the file path), the rest of your application won't notice that you changed the storage method.
Whether you implement this in OOP or in functional programming style (just as well, whether in a dynamically typed or in a statically typed language) is up to you. In Java, you need to create an interface first. In Python, due to the duck typing, you don't need one. In a functional language, you can use currying or partial functions to pre-configure certain function arguments.
To me, in actual projects, the real question is whether I choose to use immutable or mutable objects.