Interface or abstract class?

Generally speaking, the approach I use in this kind of situation is to have both an interface and an abstract class. The interfaces defines, well, the interface. The abstract class is merely a helper. You really can’t go wrong with this approach. Interfaces give you the flexibility to change implementation. Abstract classes give you boilerplate … Read more

What is a Y-combinator? [closed]

A Y-combinator is a “functional” (a function that operates on other functions) that enables recursion, when you can’t refer to the function from within itself. In computer-science theory, it generalizes recursion, abstracting its implementation, and thereby separating it from the actual work of the function in question. The benefit of not needing a compile-time name … Read more

Why are Redirect Results not allowed in Child Actions in Asp.net MVC 2

The limitation exists because MVC has already started rendering a view to the client. The effect of redirecting from this point is undefined. It could work perfectly, it could continue rendering the original view without redirecting, it could throw a different exception, etc. Since the result of performing this action is undefined, the framework blocks … Read more

What is referential transparency?

The term “referential transparency” comes from analytical philosophy, the branch of philosophy that analyzes natural language constructs, statements and arguments based on the methods of logic and mathematics. In other words, it is the closest subject outside computer science to what we call programming language semantics. The philosopher Willard Quine was responsible for initiating the … Read more

What is the point of interfaces in PHP?

The entire point of interfaces is to give you the flexibility to have your class be forced to implement multiple interfaces, but still not allow multiple inheritance. The issues with inheriting from multiple classes are many and varied and the wikipedia page on it sums them up pretty well. Interfaces are a compromise. Most of … Read more