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
π Just want to lurk?
That's fine, you can still create an account and turn on features like π dark mode.
Naman Tamrakar -
Brandon Michael Hunter -
Mehmet Akif TΓΌtΓΌncΓΌ -
Captain Mcwiise -
Once suspended, iamtarung will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, iamtarung will be able to comment and publish posts again.
Once unpublished, all posts by iamtarung will become hidden and only accessible to themselves.
If iamtarung is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Tarun.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community π©βπ»π¨βπ» safe. Here is what you can do to flag iamtarung:
Unflagging iamtarung will restore default visibility to their posts.
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.