DEV Community

Discussion on: Is Object-Oriented Programming "Dangerous"?

Collapse
 
shovelmn12 profile image
shovelmn12

The chances of shooting your foot with OOP are far more grater then with FP... Thats my main issue with OOP.
You need to think 100 times and write much more code, as Suzdalnitski showed in his article, therefore yes OOP is really dangerous

When i just started programming most of my code was spaghetti because of OOP, the more i leaned towards FP the code was cleaner

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

You need to think 100 times and write much more code, as Suzdalnitski showed in his article, therefore yes OOP is really dangerous

The exact same could be said about FP when you don't have lots of experience with it. I'm not saying OOP is any better, just that this particular argument (which I hear all the time) can be applied to any programming paradigm if you don't have good experience with it and proper training in it's use.

Some people just 'get' FP, and it comes as naturally to them as breathing once they learn about it. The same is true of OOP, and the traditional procedural paradigm, and state machines, and almost any other programming paradigm you can think of.

When i just started programming most of my code was spaghetti because of OOP, the more i leaned towards FP the code was cleaner

That just means that you happened to get better at writing clean code as you learned FP. For all you know, you could have just naturally developed better coding habits independent of the fact that you were learning and applying FP principles.