Search code examples
oopencapsulationabstraction

What is significance of abstraction from an end user perspective


Recently I was asked a question in an interview that even if we are using abstract classes or interfaces in our code the end-user, who is most probably be clicking buttons on UI, won't be exposed to inner functionality. So even if we don't implement our logic using abstract classes or interfaces, assuming end-user don't have access to my code, he won't know how this is implemented internally. So why do we use abstraction when eventually user won't get any details about the implementation. Is it just because of best practices or something else?


Solution

  • I would tell the interviewer that abstraction leaks, that base classes are for standards not abstractions, and that the enormous mess he plans for me to clean won't be cheap, because every lazy employer allows programmers to make them. What is he offering me that I can't get elsewhere?

    The guy who started StackOverflow wrote an article about the subject of abstraction. It would behoove you to read it and stop caring about selling yourself. Knowledge and science will sell you better than any academic rehearsal.