Sr. Software Engineer at CallRail building microservices to support 3rd party integrations. PhD student at the University of Nebraska studying bioinformatics, machine learning, and algorithms.
Yes, there are best practices for OOP, but there are best practices for lots of things.
Design patterns are not necessarily OOP-specific as you can have functional programming design patterns too (like the Failure Monad for example).
In an OOP context, a design pattern is a specific relationship between one or more classes to get some kind of desired behavior; you don't technically need to know design patterns to know OOP.
In real world scenario in oop as of now do often use common design patterns like singleton and other stuff or for complex problems you just do freestyle?
Sr. Software Engineer at CallRail building microservices to support 3rd party integrations. PhD student at the University of Nebraska studying bioinformatics, machine learning, and algorithms.
a little bit of both. Sometimes, problems are so common that we just know we're going to need a singleton (or factory, or observer, etc), so that's what we build.
Other times, problems aren't so obvious and the solution we come up with starts to look like a pattern sometimes.
You don't need to worry too much about design patterns when you're first learning OOP. Get more comfortable with OOP concepts like polymorphism and inheritance, then learn about writing SOLID code. After that, learning design patterns will be really easy.
Thank you for sharing your knowledge im starting to see a bigger picture now. I studied oop with java few years ago and that knowledge helped me a lot when i started javascript. From then on i always think in oop.😃
Sr. Software Engineer at CallRail building microservices to support 3rd party integrations. PhD student at the University of Nebraska studying bioinformatics, machine learning, and algorithms.
If i understand it right if you apply oop, there are oop best practices or design patterns. Am i correct?
Yes, there are best practices for OOP, but there are best practices for lots of things.
Design patterns are not necessarily OOP-specific as you can have functional programming design patterns too (like the Failure Monad for example).
In an OOP context, a design pattern is a specific relationship between one or more classes to get some kind of desired behavior; you don't technically need to know design patterns to know OOP.
In real world scenario in oop as of now do often use common design patterns like singleton and other stuff or for complex problems you just do freestyle?
a little bit of both. Sometimes, problems are so common that we just know we're going to need a singleton (or factory, or observer, etc), so that's what we build.
Other times, problems aren't so obvious and the solution we come up with starts to look like a pattern sometimes.
You don't need to worry too much about design patterns when you're first learning OOP. Get more comfortable with OOP concepts like polymorphism and inheritance, then learn about writing SOLID code. After that, learning design patterns will be really easy.
Thank you for sharing your knowledge im starting to see a bigger picture now. I studied oop with java few years ago and that knowledge helped me a lot when i started javascript. From then on i always think in oop.😃
You're welcome, feel free to ask any questions, I'm here to help!