implementation-details

When should I return the Interface and when the concrete class?

Hello SO people, when programming in Java I practically always, just out of habit, write something like this: public List<String> foo() { return new ArrayList<String>(); } Most of the time without even thinking about it. Now, the question is: should I always specify the interface as the return type? Or is it advisable to use the ...

The stack is an implementation detail, or not?

According to http://msdn.microsoft.com/en-us/library/ms229017.aspx, value types "are allocated on the stack or inline with other structures*". Yet in the stack is an implementation detail, Eric Lippert states that that's an implementation detail. To my understanding, an implementation detail is "a behavior produced by code which may be...

What is the difference between various implementations of dc?

dc is the Unix standard desktop calculator. AFAIK, there are different implementations (like Solaris or GNU for instance). What is the exact difference between these implementations and what is the minimal subset of operations you can be sure a dc implementation has? ...

Variable value assignment operation duplication

Context From The Pragmatic Programmer: Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. Questions How is that statement reconciled with directly setting a private member variable's value throughout a class in multiple places? Does it matter as there can be no external de...

Virtual dispatch implementation details

First of all, I want to make myself clear that I do understand that there is no notion of vtables and vptrs in the C++ standard. However I think that virtually all implementations implement the virtual dispatch mechanism in pretty much the same way (correct me if I am wrong, but this isn't the main question). Also, I believe I know how v...