Showing posts with label abstract class. Show all posts
Showing posts with label abstract class. Show all posts

Tuesday, March 17, 2015

Differences between abstract class and interface

it is obvious, right?

No, it’s not. I have conducted a lot of interviews and very often one of the first questions I used to ask was the one about the differences between interface and abstract class. And still I met a lot of programmers who couldn’t give me the right answer.
In my opinion even a junior programmer should know them, maybe not necessarily with understanding what reasons lie behind, but still ­­­­­- structural differences, specific for particular language (and the same for almost all OOP languages) should be more than known.

What do I find instead? Candidates who were applying for other positions (sometimes even senior ones) who didn’t knew the differences or knew only a few or one.
I know that only the things that we know very well are easy, but those are OO basics and we have to know them to write well-designed code.

Tuesday, December 30, 2014

OOP - how to do it right? - part 1

When I started my journey with Object Oriented Programming I quickly found out many tutorials and trainings, which showed how to use OOP structures in code. Unfortunately, most of them demonstrate only how to write your first own class, interface. How to create an object. All of this was about language “grammar”, about key words, the way how to create structures used in OOP, etc. Yet, somewhere authors lost the most important information to share - why we decide to do this instead of looking for other solutions? Why an interface contains nothing more than abstract methods? Why all of those are public? What for are those visibilities? And so on...