Reputation
13,102
Next privilege 15,000 Rep.
Protect questions
Badges
5 30 46
Newest
 Nice Answer
Impact
~406k people reached

Mar
30
comment Does path coverage guarantee finding all bugs?
Dijkstra actually said that on several occasions. Earliest I could find on a very quick Google was 1966 (just under 50 years ago!), again in 1970, and again in 1972, in his Turing Award lecture.
Mar
30
answered Source file shouldn't be more than 100 SLOC
Mar
4
comment Is it always a best practice to write a function for anything that needs to repeat twice?
Actually, you want something like (mapc #'print name-list), and then something like (mapc (lambda (l) (mapc #'print l)) (list vip-list guest-list)). You can actually do things like this in C and C++, but it WILL baffle those of your coworkers who have never read the Wizard Book.
Mar
4
comment In ifs inside for loops, prefer checking for true, or for false and continue?
No, different kinds of PROGRAMMERS will use different things. A lot depends on what you grew up with. PERSONALLY, I do not use "continue", and I try very hard not to use "break" in anything other than a C/C++ "switch" statement "case" arm.
Mar
3
comment Helping testers who don't have specialized domain knowledge
Thinking like a user is not enough. In an article about the development of Zork, a very early text adventure game, one of the Four Great Implementors told a tale. One day, he made a modification on the weapons technology module, and made it possible for the player to acquire the axe wielded by a certain Very Bad Dude. (Normally, the axe vanished in a puff of smoke when the VBD croaked.) He told one of their better testers. The tester immediately said "GREAT! I'm gonna go chop down some trees in the forest!" Oops.
Mar
3
revised Helping testers who don't have specialized domain knowledge
edited body
Mar
2
answered Helping testers who don't have specialized domain knowledge
Mar
1
comment Protect memory from a potentially seg faulting function call
@rwong (continuing previous comment) Gypsy was designed to be formally verifiable AND to be suitable for systems programming. It did not have direct hardware access primitives; those were required to be supplied using assembly language (and by definition were not verifiable). HOWEVER, comma, the VAST amount of C and C++ code out there does NOT require direct hardware access primitives, nor does it require the ability to GOTO heck in a handcart. (Gypsy did not have a GOTO statement. Nobody missed it.)
Mar
1
comment Protect memory from a potentially seg faulting function call
@rwong, in the late 1970s, I was an undergraduate research assistant on Don Good's Certifiable Minicomputer Project. The project was doing research into formal verification. They were doing the work in Gypsy, a language that they developed, that was specifically designed to be robust and verifiable. Verification condition ("theorem") generation was completely mechanical and NO BIG DEAL.
Feb
23
comment Are there memory-memory instructions?
Older processors, most notably the DEC PDP-11 and TI 990, provided memory-to-memory instructions. Current-gen processors are almost all load/store machines, that do not do memory-to-memory.
Feb
23
comment Are there memory-memory instructions?
The PDP-11 instruction set allowed memory-to-memory instructions to be constructed.
Feb
20
answered Can a high level language be faster than native C?
Feb
20
answered Should all possible counter-cases be tested?
Feb
20
comment Origin of the “array” term in computer science
I wasn't sure whether the original FORTRAN had arrays. I knew that FORTRAN II (predecessor to FORTRAN IV, the version I first really learned in 1970) had them.
Feb
19
comment What benefit is there to using recursive binary search over iterative binary search or vice versa?
@raptortech97: Read c2.com/cgi/wiki?TailRecursion for more information.
Feb
19
comment What benefit is there to using recursive binary search over iterative binary search or vice versa?
Binary search is tail-recursive, not generally recursive. As such, a recursive implementation should, given a competent language processor, incur NO speed or stack space penalty over an iterative implementation. Read the "Lambda: The Ultimate ..." papers from the MIT AI Lab for the gory details.
Feb
19
comment What benefit is there to using recursive binary search over iterative binary search or vice versa?
My understanding is that the JVM does not support a general GOTO operation, which is necessary for general tail call optimization. Tail recursion is a special case of tail call.
Feb
18
answered What benefit is there to using recursive binary search over iterative binary search or vice versa?
Feb
18
answered Is there a (systematic) way to convert a recursive program to a version using user stack?
Feb
18
comment Optimizing code by using registers, but what if they are not enough in number?
@delnan: Worst case, with the temporary, you fetch radius[i] once, store it once in the temp, and then fetch the temp a few times, AS OPPOSED to fetching radius[i] those few times. The question is how much extra does the subscript operation cost. Moreover, depending on what you are doing between uses of the (temp-cached) expression, the compiler may be required to assume that something could have changed, and do an expensive operation. Using a scope-limited temp tells him that the temp DIDN'T change.