Reputation
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
13 30
Newest
 Yearling
Impact
~137k people reached

Mar
31
comment Ethicality of online license checks
Nitpick: Piracy is the wrong term for this. Because these are legitimate users (i.e. paying customers), at worst they are violating the terms of your license, but they are not pirating or using pirated software.
Mar
30
comment Does path coverage guarantee finding all bugs?
Good point. Agreed.
Mar
30
comment Does path coverage guarantee finding all bugs?
Agreed that that's part of the issue, but the real issue is more fundamental than that. Even with a theoretical computer with infinite memory and no concurrency, 100% test coverage does not imply the absence of bugs. Trivial examples of this abound in the answers here, but here is another: if my program is times_two(x) = x + 2, this will be fully covered by test suite assert(times_two(2) == 4), but this is still obviously buggy code! No need for memory leaks :)
Mar
30
comment Does path coverage guarantee finding all bugs?
@JørgenFogh Path coverage doesn't let you know whether the program halts. That's not the formulation of the halting problem. (Trivial counterexample: f x = if x == 0 then 1 else f (x - 1) can be fully path-covered with inputs 0 and 1, but doesn't halt for -1. And regardless, the comparison was with finding all bugs via path coverage, not with path coverage itself)
Mar
30
comment Does path coverage guarantee finding all bugs?
@Leushenko In other words, the answer could be "for some non-Turing complete languages, path coverage is NOT like the halting problem". However: a- that's not what the OP seems to be asking, b- it still doesn't answer whether path coverage is enough to find all bugs! (I'm not familiar with Coq et al, but I'm going to risk that the answer is still "no").
Mar
30
comment Does path coverage guarantee finding all bugs?
@Leushenko Agreed, but that's not the case here, is it? We're talking about a general guideline for programming languages: "is path coverage good enough?". In the general case for general purpose languages, this is similar to the halting problem, and the answer is "no, it's not good enough". We are obviously not talking about Coq here; and if you're using a small enough subset of C, then this is not within the constraints of the original question (e.g. the C lang subset that is only printf("hello world\n") can be covered and shown to be bug-free... but not what we're discussing here).
Mar
30
comment Does path coverage guarantee finding all bugs?
@JørgenFogh But when trying to find bugs in any program, isn't it a priori unknown whether the program halts or not? Isn't this question about the general method of "finding all bugs in any program via path coverage"? In which case, isn't it similar to "finding whether any program halts"?
Mar
30
comment Does path coverage guarantee finding all bugs?
@PaŭloEbermann Agreed, slightly more than nothing. However, it is tremendously less than "finding all bugs" ;)
Mar
25
comment Is there a reason to have a bottom type in a programming language?
You are mistaken: bottom is used to indicate computations that do not terminate. Here "return" means "terminate". So in this case the function does not return and the program is not able to continue. Like Alexey commented, you're thinking of unit, not bottom.
Mar
25
comment Implementing common logic in base class
@AK_ Pretty sure the Agile school of thought is "the test suite should run constantly and very fast. If your tests run slow, that's a problem."
Mar
13
reviewed Approve Understanding basics of object declaration in Java
Mar
11
comment In a program written in Pascal, what hardware components are used?
+1 For actually answering the question, which like you said is very clear (and an understandable confusion for people new to computers and software).
Mar
11
comment What is the logic behind the use of different arrows (-> <-) in Haskell?
@Doval Excellent comment. You should convert it into a (partial) answer.
Mar
6
comment Should the method describe its side effects?
@kobac An externally visible side effect is not an implementation detail. For example, let's say your function that computes ASomething needs to write to a temporary file. If the disk is write-protected it will fail, even if the caller doesn't care how the function achieves its result. This is because "writing to disk" is an observable side-effect, even though it's not the primary reason why the caller used the function.
Mar
3
comment Differences between Instruction set (architecture) and machine language?
What do you mean "a programming language is a set of some programs"? Do you mean the set of all programs that can be written using that language? Do note that's an infinite set, even if you remove filler sentences.
Feb
25
comment Is there any necessity to pass a variable parameter to a method while the variable declared global?
Muztaba, that's not enough. How would someone reading the signature of monteCarlo know that the method modifies a global variable?
Feb
25
comment Is there any necessity to pass a variable parameter to a method while the variable declared global?
Mods: doesn't this kind of question belong in Code Review?
Feb
25
comment Is there any necessity to pass a variable parameter to a method while the variable declared global?
Your monteCarlo method is problematic: it modifies a global variable not passed as an argument, which may be puzzling to readers of your code. Better to assign to matrix outside the method.
Feb
25
revised Is there any necessity to pass a variable parameter to a method while the variable declared global?
fixed code formatting and removed "thanks!"
Feb
24
comment When to use a SortedMap interface?
Your first example is a case of "Use the most general type/interface possible": Map is more general than SortedMap; hence, if you just need a Map, use a Map. No need to invoke the second principle about simplicity :)