11
Clueless
19d

"What are the four pillars of OOP?"

Me:(I'm not an OOP guy, but focused on design patterns)

1. Encapsulation
2. Abstraction
3. Polymorphism
4. ??(was it inheritance or composition).

Fuck, Because of the phrase "composition over inheritance". I've been mixing both composition and inheritance at the same time.

Comments
  • 0
    @torbuntu It's not an interview, but a common OOP questions that I got recommended from my relatives. I told them I'm not an OOP guy but applying the concepts of Design patterns to both OOP and FP world.
  • 2
    @Clueless
    Oh for fucks sake.
    OOP and FP aren't related in any way.
    No opposites, not equal, nothing.
    Get your paradigms right.
  • 0
    actually thats something that you prove when you design a solution..
  • 1
    Once someone asked me what SOLID stands for. I screwed up the D - it’s apparently not Don’t Repeat Yourself. The hiring architect wasn’t happy.

    To this day I don’t understand this fascination of SOLID during recruitement. You show that your code is clean by writing it, not by recitation of formulas. Workplace is not Sunday school ffs.

    BTW:

    S is impossible to define and therefore useless.
    O is obsolete.
    L describes rules for code that should not be written in the first place.
    I is fundamentalism
    D (dependency inversion principle) is OK, but totally obvious.
Add Comment