1,933 reputation
410
bio website
location
age
visits member for 3 years, 9 months
seen Jul 4 at 8:15

Mar
4
comment Duplication in parallel inheritance hierarchies
I have since learned that this problem has a name in the programing languages literature "the expression problem".
Jan
13
comment How is Python used in the real world?
+1 we also use python for automated testing
Dec
22
comment Would you rather make private stuff internal/public for tests, or use some kind of hack like PrivateObject?
@AlanDelimon Might it not hurt the mind of subsequent maintenance programmers?
Dec
21
comment What's the worst question you were ever asked at interview?
@DVK - "standard feminist beliefs"? I swear I nearly wet myself! (You did mean that comment to be a joke right?)
Dec
21
comment Why was I asked general, non-technical questions during an interview?
Ermmm, sorry to be a bust, but I was wondering if someone could cite some quantitative scientific research that supports the assertions being made about "people of Asian cultures" and "westerners" in this post? Where did these claims about the behaviour of maybe several billions of people come from? I would also like to know why the assumption is made that the amazon interviewer is first language english and not infact Asian himself? Or am I missing the point?
Jul
20
comment Duplication in parallel inheritance hierarchies
I have used this solution in a few cases, and it does work in the somewhat simple example I have given here. But the number and complexity of generic parameters grows very quickly if a few more classes are involved. It seems to me to end up with the "Container" class having a generic parameter for every type that can vary in the graph. For example an actual model I have built has about 7 classes that vary by protocol. The topology of the object graph is the same, but the attributes of each object vary by protocol and "foo" objects cannot mix with the "bar" objects.
May
10
comment Duplication in parallel inheritance hierarchies
I think that this solution requires a language with dynamic dispatch? Although something similar is possible in Java, etc, using a visitor or double dispatch pattern. But I am thinking of the question more from the point of view of using OO to modell the domain. I want to capture the rule that "Destinations are associated with Sources" as well as the rule that "FooDestinations are associated with FooSources" and "BarDestinations are associated with BarSources" with as little duplication as possible.
Apr
5
comment Duplication in parallel inheritance hierarchies
So, a more concrete example is a network. A network consists of, say, clients and servers each with an "address". However, a network also has a protocol associated with it. All addresses within a Foo network have to be FooAdresses, and all addresses within a Bar network have to have BarAddresses. I never want a FooClient in a BarNetwork. However, some operations (e.g.) drawing a diagram of the network in a GUI do not really care about that rule as they maybe don't even render the values of the addresses. So you have an abstract use but still need to enforce the business rule for the protocol.
Apr
5
comment Code Smell: Inheritance Abuse
thanks I understand now
Mar
16
comment Duplication in parallel inheritance hierarchies
I agree, they should probably be in different packages, but I left the packaging/file arrangement out for simplicity. I don't think it really affects the underlying design issue, which is that the underlying structure of the object model is repeated for each new flavour (here foo and bar, but in reality often many more times).
Mar
15
comment Is Agile the new micromanagement?
+1 estimating relative complexity
Mar
15
comment Code Smell: Inheritance Abuse
Could you maybe expand a little on what you mean by "composition will require some violation of DRY" please?
Feb
22
comment How to refactor while keeping accuracy and redundancy?
@Péter Török sorry, yes I agree, when I said old code I meant code that is not being called or executed but has been left around by accident during some other non-refactoring change. I realise now that isn't quite the right interpretation in this context.
Feb
9
comment Is it bad to have an “Obsessive Refactoring Disorder”?
how does you proposed process handle people quitting? How does the code get taken over by someone else? And how long does that take?
Feb
9
comment How to refactor while keeping accuracy and redundancy?
@Andrew S. Arnold - my comment is maybe a bit pedantic, but that is not the whole point. Refactoring is also used to make code, and the design of the code, clearer and easier to understand. Removing old code and duplicate code is just part of it.
Jan
10
comment Skeptic in a Scrum Team
I am pretty sceptical of the value of the SCRUM process. I don't think it is very agile for a start. I do turn up to the meetings. But I don't think anyone is going to fire me, as it was partially my fault we implemented SCRUM in the first place (if anything I think they should fire me for that! They do not agree). If your company is going to fire workers for trying to do there job the best they can. The you will probably just end up with workers that blindly follow orders, and I can't see that producing much decent code.
Dec
24
comment What's the most absurd myth about programming issues?
@MAK - check out en.wikipedia.org/wiki/Handel-C
Dec
24
comment What's the most absurd myth about programming issues?
@orokuskai: good code is simple. The things it is doing may be complex but the simplicity (elegance) of the code is what makes it good in my opinion! Of course, code does lots of other things, and rubbish code can make you lots of money. But my goal is to write simple code even in complex situations.
Dec
24
comment What's the most absurd myth about programming issues?
@Jouke van der Mass: of course. But it does not matter how complex the algorithm, the goal is to express the algorithm simply. i.e. good code expresses complex algorithms, rules, optimisations, in a simple and unambigiously understandable way. Expressing simple things simply is comparatively easy. Expressing complex things simply is where the skill lies.
Dec
24
comment What's the most absurd myth about programming issues?
@Kyralessa - I think that I now know enough about the underlying theory of computing and functions of computers to not make basic errors in any programming language. I can read the documentation. However, something that a language specific hire with limited engineering skills /will/ do is make basic errors in the structure, design, correctness, scalability, reliability and maintainability of the program that will potentially cost large amounts to fix. If you don't lose all your customers due to the low quality of the software in the meantime (assuming your project actually gets anywhere).