Reputation
3,165
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 16 31
Newest
 Yearling
Impact
~184k people reached

Apr
16
comment Is Haskell/Clojure actually unsuited for dynamic systems such as particle simulation?
Who told you they were unsuitable? Link to answer/comment?
Apr
16
comment Teaching `class`es and objects in C++ to university students
Why would you want to pick between C++ and Java when teaching classes and objects? For this goal they are essentially the same. If true object orientation is your goal, you'd better pick something like Smalltalk. If not -- which is what I'm guessing -- then stick to Java. Nothing to "unlearn" when moving from Java to C++; don't assume your students are idiots :)
Apr
15
comment How to determine most challenging test-cases to test any algorithm?
Agreed, I think several complementary approaches are needed. And yes, nothing beats actually understanding how the algorithm works and what its special cases are (which is why TDD is hopelessly inadequate for this task)
Apr
15
comment How to determine most challenging test-cases to test any algorithm?
+1 The random approach you suggest (verifying properties against randomly generated samples) actually exists! See tools such as QuickCheck (for Haskell) or Scalacheck for Scala :)
Apr
15
comment How to determine most challenging test-cases to test any algorithm?
Maybe I'm being a nitpicker, but your most relevant answer is the last line (about Pex). Why not move it to the top, since it's the actual answer? The rest is either wrong (the tongue-in-cheek part) or incomplete ("design your programs in such a way..."). Partitioning the test space is usually at least a whole chapter in software engineering books, and there are published papers about it. Obviously "design your algorithms well" is not the complete answer, but only one side of the equation!
Apr
15
comment How to determine most challenging test-cases to test any algorithm?
I don't understand why you started your answer with a misleading paragraph, which you later acknowledge to be "tongue in cheek"? Shouldn't you remove it, or at least move the relevant part of your answer to the top? (that TDD isn't the answer to input space partitioning is a given)
Apr
13
comment Why do some of object oriented languages let programmer use primitive types?
Um, isn't Double in C# not a primitive type, just like Decimal? In which case, the performance increase had to do with the differences between both abstract types, rather than with primitive vs non-primitive. Double is an example of a performant non-primitive type.
Apr
13
comment Why do some of object oriented languages let programmer use primitive types?
@tgkprog Why would a primitive be handy for a simple "next loop"? I assume we are not coding in assembly language here, but a high-level OO language.
Apr
8
comment Immutable vs mutable object as returned parameter for class method
Immutable objects are not only about multi-threading, like Jimmy Hoffa correctly pointed out. Making an object immutable also makes it simpler to reason about single-threaded code: for example, if I see x mentioned somewhere, more code follows, then x again, I know it represents exactly the same value or object state as before; I don't even have to look at the function calls in between.
Apr
8
comment In Unit Testing, why would I create a Repository twice?
@Theomax Depends on the context: if you are unit testing a software component which is not your ExampleRepository, then it's best to use a mock. The justification being that you are not unit-testing the repository but something else.
Apr
6
comment How important is it to reduce the number of lines in code?
By definition, if a task absolutely requires N lines of code to accomplish (which is something hard to determine in the first place), then it cannot be done in less than N lines. So your 10,000-line task cannot be done in 2,000, period. I guess the OP is talking about the cases where there is some leeway, i.e. "the requirement can be fully accomplished either way, so which one is better?"
Apr
6
comment How important is it to reduce the number of lines in code?
Your second example is especially good, because it's not only simpler, it also makes it more clear this is an assignment of one of two options, with no side effects. The if-then-else obscures this; for example, it's all too easy to assign to a different variable in each branch of the if (which may or may not be a mistake, but it's hard to spot).
Apr
5
comment About Artificial Intelligence
Why is object orientation needed for AI?
Apr
5
comment How should you deal with a popular project that you no longer want to maintain?
Out of curiosity, what is the project? Link? (assuming it's open source)
Mar
27
comment In Java, would you sacrifice type safety for a nicer programming interface
If you want to sacrifice type safety, why are you using Java? You end up with the worst of both worlds! :)
Mar
26
comment Why do some big projects, like Git and Debian, only use a mailing list and not an issue tracker?
Great answer! Email is better known than issue trackers, and easier to understand (which is not to say everyone "gets" email :P )
Mar
22
comment What is Java's primary focus? Why does it take so long to get new features?
I may be wrong, but my understanding is that Haskell is also a "design by committee" language, and it's a cutting-edge language. So maybe that's not what's hindering Java?
Mar
16
comment Why do we call it “production”?
Um, in our industry "production" doesn't mean "final, deliverable product" and I've never heard it used like that. It means "has gone live, and is being used to accomplish the business purpose it was built for". It may or may not be "final"; that's orthogonal.
Feb
21
comment Why isn't Java being used for web multimedia applications?
@Craige ...said the COBOL programmer ;) Not willing to debate this, but keep in mind simplicity by definition does not obscure anything (if it did, it wouldn't be simple). The word you're looking for is succinctness (the opposite of verbosity). I claim that succinctness helps simplicity, and that verbosity hinders it. Function is only obscured by boilerplate.
Feb
21
comment Why isn't Java being used for web multimedia applications?
@KyelJmD Verbosity hides meaning and obscures what should be simple.