DEV Community

Discussion on: Interfaces are overrated

Collapse
 
leob profile image
leob • Edited

Interfaces can be overkill, only use them when you're able to clearly articulate a reason (e.g. you expect that you'll need generalization, multiple implementations, etc), not because of dogma or because you've been told to.

And with dynamic (non-typed) languages you would simply use duck typing :-)

Since I've moved away from Java and towards dynamic languages like PHP, Javascript and Ruby I've come to appreciate that a lot of approaches in Java land are incredibly over engineered and overcomplicated, YAGNI syndrome, "patterns" even when you don't need them ... replace that with KISS - simple does it :-)

Collapse
 
gmanon profile image
GManon

Object Design is complicated, but necessary for large projects requiring many objects. It also helps the programmer on thinking on security at the object level.

Even thought functional projects can achieve high security standards, the code itself tends to be more open. The object oriented approach also hides and protects the code from other programmers, or at least the implementation. It's a different animal.

However, functional programming gives way more control and flexibility to the Developer. It's easier to tackle logical problems with functional programming.

OOP is all about encapsulating everything. Functional programming makes use of loose variables. This can be extremely useful even thought many OOP Developers resent it so much. Anyway, most functional languages can also make use of OOP, yet they are not really based on objects as JAVA where everything is an object and you can only output from main.

Interfaces can be extremely useful like everything, when it is use properly. It's all about applying good design.