What’s the relationship between “a” heap and “the” heap?

Nothing much, to be honest. I would imagine that the word heap was simply taken with it’s everday (non-technical) usage and applied to these two concepts individually as reasonably good analogies. In the first case (tree data structure meaning), the description heap is most appropiate because “greater” objects are placed higher up in the tree … Read more

What is an example of the Single Responsibility Principle? [closed]

The most effective way to break applications is to create GOD classes. Those are classes that keep track of a lot of information and have several responsibilities. One code change will most likely affect other parts of the class and therefore indirectly all other classes that use it. That in turn leads to an even … Read more

What is the meaning and reasoning behind the Open/Closed Principle?

It means that you should put new code in new classes/modules. Existing code should be modified only for bug fixing. New classes can reuse existing code via inheritance. Open/closed principle is intended to mitigate risk when introducing new functionality. Since you don’t modify existing code you can be assured that it wouldn’t be broken. It … Read more