2,679 reputation
1127
bio website
location Argentina
age 37
visits member for 3 years, 2 months
seen 2 days ago

Software developer and science fiction fan.


Feb
7
comment When to write Unit Tests : Is there any or list of terms to take right decision
Unfortunately the rule of thumb lacks real world nuances. For example, it's not always a good idea to write unit tests for GUI code. Or anywhere else the costs of maintenance outweight the benefits.
Feb
7
comment When to write Unit Tests : Is there any or list of terms to take right decision
@LaurentBourgault-Roy If the warp coil is seconds away from an explosion, it's bye-bye Enterprise either way :P
Feb
7
awarded  Yearling
Feb
4
comment Is path coverage stronger than condition coverage?
@MichaelIT You are referring to something else. CONDITION coverage cares about boolean subexpressions, which is different to BRANCH coverage which only cares about the outcome of the whole decision. I do remember being told the distinction on my CS/software engineering courses.
Feb
3
comment How should you TDD a Yahtzee game?
The million dollar question is, did you derive the Yahtzee AI using pure TDD? My bet is that you can't; you have to use domain knowledge, which by definition isn't blind :)
Feb
3
comment How should you TDD a Yahtzee game?
"Write the simplest thing that works", like @Carson63000, is actually a simplification. It's actually dangerous to think like that; it leads to the infamous Sudoku TDD debacle (google it). When followed blindly, TDD is indeed braindead: you cannot generalize an non-trivial algorithm by blindly doing "the simplest thing that works"... you have to actually think! Unfortunately, even alleged masters of XP and TDD sometimes follow it blindly...
Feb
1
comment Is it time to deprecate synchronized, wait and notify?
@StephenC A nitpick: going by the Java docs you linked to, I don't think deprecation means the deprecated code is broken. That's one reason, but as the docs says, an API can be deprecated when it's superseded by a newer, better API (as, the OP argues, is the case with concurrency). And low-level concurrency, if not actually encouraging bad practices, is certainly very error prone.
Jan
31
comment Copying (forking) an open source project to your own repository
As far as I can tell it seems to be allowed by the license (Microsoft Public License), but why don't you email the author?
Jan
30
awarded  Nice Answer
Jan
30
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
So that's your argument? "Java designers needed the new keyword because otherwise Java's syntax would have been different"? I'm sure you can see the weakness of that argument ;) And yes, you keep discussing syntax, not semantics. Also, backwards compatibility with what? If you are designing a new language, such as Java, you are already incompatible with C and C++!
Jan
30
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
Sorry, I don't follow your argument. You are effectively arguing syntax, not semantics, and anyway the question was about new for managed languages. I have shown that new is not at all needed (e.g. Scala doesn't need it for case classes) and also that there is no ambiguity (since you absolutely cannot have a method named MyClass in class MyClass anyway). There is no ambiguity for String s = String("hello"); it cannot be anything else but a constructor. And finally, I disagree: code conventions are there to enhance and clarify the syntax, which is what you're arguing about!
Jan
29
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
Oh, right. C# has different conventions. To be fair, your example was Java. And anyway, my Scala example shows it's not important even then.
Jan
29
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
But it's not obvious. First, having a regular method named String goes against Java style conventions, so you can just assume any method starting with uppercase is a constructor. And second, if we aren't constrained by Java, then Scala has "case classes" where the constructor looks exactly like I said. So where is the problem?
Jan
29
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
But this wasn't the question. The question was "why not String myString = String("myString");?" (note the absence of the new keyword)
Jan
29
comment I don't understand why algorithms are so special
@CWallach Using a library function in your own code is also an algorithm, if you understand the term to mean "following a series of steps in order to produce a result"; it's just that one of those steps is "call this library function". Also, someone has to write that library!
Jan
29
comment Why Java does not allow function definitions to be present outside of the class?
@Baqueta In Java you can achieve this with interface and class :) No need for headers!
Jan
28
comment I don't understand why algorithms are so special
If asking about "awesomeness" of something isn't an example of Bad Subjective, I don't know what is :/ I've already read this question multiple times and don't understand what the author thinks algorithms "fail miserably" at. Maybe at shattering preconceptions, or mind altering? I suggest using drugs!
Jan
28
comment I don't understand why algorithms are so special
This doesn't answer the question. Admittedly, it's a poor, off-topic question, but this isn't the answer :)
Jan
28
comment How to improve efficiency with functional programming?
You are giving a contradictory answer. On the one hand, you assert the OP "hasn't misunderstood anything", and that the slowness is inherent in Haskell. On the other hand, you show the choice of algorithm does matter! Your answer would be far better if it skipped the first two paragraphs, which are somewhat contradictory with the rest of the answer.
Jan
25
comment Is Ken Thompson's compiler hack still a threat?
Or, since most people don't compile anything from source (say, on Windows) your average trojan will suffice :) (I'm agreeing that a compromised compiler is way overkill)