+ 3

Which is the better one :OOP (Object Oriented Programming) or POP (Procedure Oriented Programming)?

3rd Feb 2018, 5:14 AM
Vansh Chopra
Vansh Chopra - avatar
5 ответов
+ 5
@Rawdge... I've thoroughly enjoyed your perspectives so far. I really hope we get to see more of your insights shared in the community. A big take away in what you shared is, there isn't any silver bullet; one size fits all; or the right way of doing things when it comes to the iterative process of software development - as it relates to POP vs OOP. For me, it really depends on the language and the logic I'm working on. In C#, I'll start off with traditional interfaces / inheritance OOP and then shortly migrate to incorporating IOC and unit tests. By the time I've switch to writing unit tests, I'm pretty much thinking of how I would interact with my classes in a way that can feel like POP - from the test methods perspective. I know, I know... this doesn't really count as POP. However, it's what works for me as I flesh out additional interfaces with a YAGNI approach. I'm probably most at home with POP when I'm writing a shell script or make file or some bash utility to make my life easier with some automated development workflow. A line I won't cross, where others might, in the early phases of spinning up a new POC, is repeating code - or anything that violates the DRY principle. I would never criticize anyone who repeats their code as they are in the early stages of learning to program. It's part of the learning process to identify patterns where reuse can be leveraged. For me, it's the most basic litmus test I use in deciding, in a split second, what needs to be abstracted into a method or its own class, etc. Anyway, I may have strayed a little off-topic. Hopefully it still brings some value.
13th Feb 2018, 8:14 PM
David Carroll
David Carroll - avatar
+ 4
I like OOP, but it’s really based on your opinion.
3rd Feb 2018, 5:16 AM
Jacob Pembleton
Jacob Pembleton - avatar
+ 4
It depends on the application, if it is small, I would choose POP, since it would also be faster, but for bigger projects that might be updated over time OOP, since it's easier to debug.
3rd Feb 2018, 8:28 AM
Sanford Mascarenhas
Sanford Mascarenhas - avatar
+ 3
There's definitely a time and a place for both. For example, I prefer using POP for simple web pages that don't need to display complex data. But for a larger application, I would prefer OOP. The larger a project gets, or the more complex it is, the more OOP would be better suited. I also think OOP is much better for organizing large, complex projects. That said, however, I do love using POP. I feel, for me, it's better for very rapidly prototyping, or for proof-of-concept work. I like using POP for that, because I can start writing rough code and kludging together something functional without having to worry about the "overhead" of setting up a fully structured OOP Design Pattern from the get-go. Heck, I don't even need to know how I'm going to solve a problem prior to writing any lines of code. I can figure it out as I go, one line at a time. In other words, I often use POP in the early stages of a project so I can build something line by line, piece by piece, to help me figure out how the application will work as a whole. I use it to build a sort of "vertical slice" of a project. Once I know how it should all work, I can go about picking the proper Design Pattern, and writing the "final" code in OOP. Admittedly, this sometimes isn't the most efficient work flow, and it would probably horrify some folks who are better programmers than I. But it's great for me and the way I think and approach a project, and I can often whip together something "quick and dirty" in POP very, very quickly. Sometimes, for smaller projects, that may even be all that's needed. Sometimes, in the thick of business, a working solution is more valuable than an elegant one. Again, I'm sure some better and more experienced programmers would advise against this kind of workflow, but don't let that take away from the fact there are definitely pros and cons, strengths and weaknesses to both approaches.
3rd Feb 2018, 5:48 PM
Rawdge
Rawdge - avatar
0
Try functional for a change.
3rd Feb 2018, 6:44 AM
1of3
1of3 - avatar