Reputation
9,475
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
9 42 95
Impact
~447k people reached

Jan
15
awarded  Popular Question
Jan
14
accepted Do any object-oriented programming languages support “collective constructors”?
Jan
14
comment Do any object-oriented programming languages support “collective constructors”?
I find the idea of a builder pattern in combination with freezable object very good. It is not exactly what I had in mind but it solves my problem without introducing a new ad-hoc concept, which is IMO good.
Jan
13
comment Do any object-oriented programming languages support “collective constructors”?
@Telastyn: I am not sure I understand your scenario completely. My point is that sometimes I would like to build (and freeze) a certain object configuration, and normally the code for doing this is spread over the constructors of the individual objects (and possibly an extra factory method supervising the whole). I would like to have the whole operation defined in one place, but certain things (like setting an immutable reference) can only be done in a constructor. So I am kind of stuck.
Jan
13
comment Do any object-oriented programming languages support “collective constructors”?
@JensG: I thought about that, but a factory has some limitations. For example, if an object contains an immutable reference, you cannot set it in a factory: you can only set it in the constructor. I am considering the Java semantics here, but I think this can be a general problem.
Jan
13
comment Do any object-oriented programming languages support “collective constructors”?
Can the voter please explain the close vote? I am asking if there exists a programming language with a very specific feature. The question does not seem to be off-topic or poorly formulated to me but I am open for feedback.
Jan
13
asked Do any object-oriented programming languages support “collective constructors”?
Jan
13
comment Is it sufficient to use acceptance and integration tests instead of unit test?
I agree with you: I am a bit skeptical when I see TDD applied blindly with the assumption that it will automatically produce good design. Furthermore, sometimes TDD gets in the way if the design is not clear yet: I am forced to test the details before I have an overview of what I am doing. So, if I understand correctly, we agree. I think that (1) unit testing helps to verify a design but design is a separate activity, and (2) TDD is not always the best solution because you need to organize your ideas before starting to write tests and TDD can slow you down in this.
Jan
13
comment Is it sufficient to use acceptance and integration tests instead of unit test?
As Doc Brown has pointed out, unit tests only work well if you have well-designed code. And sometimes you have to write some code as a proof of concept for your design. Writing tests in this phase just comes in your way. At least this is what I have experienced several times.
Jan
13
comment Is it sufficient to use acceptance and integration tests instead of unit test?
@Robbie Dee: I agree that TDD can disrupt the natural development flow, not because I'd like to save time and meet a deadline, but because it forces me to write tests for code whose structure is still not clear to me. I become very frustrated when I write a test, implement a function, and then discover that I need a different function and have to throw away the test as well. So, instead of helping me understand my code, writing tests often interrupts my flow of thought and forces me to bother about many details before I have an overall picture of the code I want to write.
Jan
13
comment Is it sufficient to use acceptance and integration tests instead of unit test?
"This means, when the components already are designed well.": I agree with you, but how can the components be already designed if you write the tests before writing the code, and the code is the design? At least this is how I have understood TDD.
Jan
13
reviewed Leave Open What languages are more suited for long term projects?
Jan
13
reviewed Leave Open Can you apply the same lexer rules to all programming languages?
Jan
13
revised Questions about God's algorithm and Rubik's cube
"Optimal" means "best", so you do not need to say "the most best way".
Jan
13
reviewed Leave Open How should one debug a PHP web application securely without exposing secrets to competitors?
Jan
13
comment Does 'consider returning Null Object' apply to a DAO read method?
@Crowie: I agree with you that mapping an exception to null is probably a conceptual error (sweeping an error under the carpet and transforming it to a valid result). On the other hand, what is an error on a lower layer could be a valid result on an upper layer, e.g. if you use some library function whose only way to report a certain condition is to throw an exception.
Jan
13
comment Does 'consider returning Null Object' apply to a DAO read method?
@Brandon: I would use an exception to indicate an error, not a valid empty result (which is what Crowie seems to have in mind).
Jan
13
reviewed Leave Closed Why the Scala fascination with flatmap? (This doesn't seem to be the same for mapcat in the Clojure world)
Jan
12
comment Fastest Haskell library sort implementation
Sorry that it took me so long to answer. I am working on this project in my free time and I kept postponing it. I have now tried out your implementation and it is definitely faster than the Data.List.Sort. I also have implemented my own merge sort on mutable arrays and it runs a bit faster than introsort, at least on my examples. I haven't tried Data.Vector.Algorithms.Intro.sort yet.
Jan
12
accepted Fastest Haskell library sort implementation