11,881 reputation
52742
bio website
location
age
visits member for 3 years, 9 months
seen 6 hours ago
Very senior embedded real-time systems programmer (Texas law is very picky about the use of the term "engineer"), unsuccessful candidate for U.S. Congress, and unreconstructed Cold Warrior.

6h
comment Is it a good idea to return a default value if a field in a query cannot be found?
@supercat: Observe that there is no real semantic difference between what you suggest and what I espouse. The only difference is how the caller supplies the default returner. In your method, you pass a callback method with your key when you call the get(). In mine, you wrap an exception catcher around the get(), and call the callback method yourself if the exception is thrown. Observe that it is usually easier to track down an unhandled exception than it is a branch to Never-Never Land. (Worst case is when a branch through a null pointer yields a valid code address: you die screaming.)
Jun
30
comment Is it safe to rely on static analysis to “reproduce” concurrency bugs reliably?
Something to add: 6) NEVER acquire and hold more than one lock at any given instant. 7) If you absolutely, positively MUST acquire and hold more than one lock at any given instant, make damned certain that they are ALWAYS acquired in the SAME order. If process A and process B must both acquire locks Red and Green, they can deadlock if one of the acquires Red first and the other acquires Green first.
Jun
30
comment Is it safe to rely on static analysis to “reproduce” concurrency bugs reliably?
@delnan: EXTREMELY cogent, perceptive comment. +100 if I could.
Jun
26
comment Which are the alternatives to using a stack to represent function call semantics?
@LorenzoDematté: Precisely. That was how the CDC 6600 Return Jump (RJ) subroutine call worked. "RJ xxx" stored a jump to PC+1 in xxx and then jumped to xxx+1. When the subroutine finished, it jumped to xxx, which jumped back to the calling routine. This works fine for nonrecursive languages like FORTRAN, but it doesn't work for recursive languages like PASCAL. PASCAL had to implement a call stack in software.
Jun
17
comment How to define different names for the same type and have the compiler check them?
The question is whether you want to catch the error the moment you utter it, or when you try to store it and discover the types don't match up. Over fifty years of computer science seems to suggest that you want to catch the error as early as possible. A complicated expression with two errors, in the presence of implicit type calculus, could wind up generating total garbage with a correct result signature, which is the worst-case scenario.
Jun
17
comment How to define different names for the same type and have the compiler check them?
@kevincline, the explicit instantiation requirement is arguably a Good Thing. As I recall, it was Tony Hoare who proposed a set of default typing rules, analogous to the FORTRAN I-N integer rule, to the ALGOL committee. They chastised him most severely, explaining that requiring explicit declaration of variables, and their types, reduced programming errors. (The author of that tale added that this happened BEFORE anyone knew the possibly-apocryphal story of the lost interplanetary probe, caused by a typo combined with default typing in FORTRAN.)
Jun
14
comment Looking to simulate the rolling of a ball around a roulette wheel, while the resulting number is already known
37 for a Monte Carlo wheel, 38 for a US wheel. (All wheels have 36 numbers, divided evenly red/black. Monte Carlo wheels have one zero, colored green. US wheels have zero and double-zero green, to increase the house take. The Wikipedia article traces the history, and it is actually quite interesting.)
Jun
12
comment Why are so many languages passed by value?
@supercat: You're on your own. At best. Some places, you'll get a free spa treatment, complete with tar and feathers.
Jun
12
comment Why are so many languages passed by value?
@supercat: Deliberate aliasing. Undefined behavior. You'
Jun
12
comment Why are so many languages passed by value?
@supercat: No. In/out parameters are by definition readable and writable by the called routine.
Jun
11
comment What methods exist for assessing an organisation's development capability?
SEI CMM, albeit dated, and its more recent flavor, CMMI, is in fact exactly what you are looking for.
Jun
11
comment Is my work on a developer test being taken advantage of?
Here's a suggestion, for people in the US. Whenever a firm asks you to submit code samples, or do example work for them, every chunk you submit should carry a copyright notice: "COPYRIGHT (year) (your name). ALL RIGHTS RESERVED." If it generates code that will be run in a user's browser, make sure that the generator also generates a comment line containing that copyright notice. Honest outfits will have no problem with this. Dishonest ones will scream.
Jun
4
comment are programmers more forgiving of buggy software?
+1000 if I could.
Jun
4
comment Are there advantages for using recursion over iteration - other than sometimes readability and elegance?
@KChaloux: Tail call optimization is not an attribute of a language, but of the language translator (compiler). In this, The Year of Our Lord Two Thousand Fourteen, a production-quality compiler that does NOT do tail call optimization must be regarded as brain-damaged. (We used a PowerPC compiler at Nortel Networks in about 2000, as I recall. I had occasion to test tail call optimization, ON REAL CODE FOR A REAL SYSTEM, and proved that the compiler did do it correctly. More recently, 8051-derivative and PIC compilers have surprised people by doing TCO correctly.)
Jun
4
comment Are there advantages for using recursion over iteration - other than sometimes readability and elegance?
@delnan: No, a function call does not NECESSARILY "need to do more than a loop backedge". Read "Debunking the 'Expensive Procedure Call' Myth, or, Procedure Call Implementations Considered Harmful, or, Lambda: The Ultimate GOTO", by Guy Lewis Steele, Jr. MIT AI Lab. AI Lab Memo AIM-443. October 1977. BRIEFLY, Steele shows that a procedure call is just { push RETURN_ADDRESS; jump routine }, and, in some cases, the "push RETURN_ADDRESS" step can be optimized out of existence.
Jun
3
comment Does anyone still use logic analyzers for debugging real time systems?
Quibble: The term is "logic analyzer", not "logical analyzer".
May
16
comment I am making 4-5x more story points than average, but producing bugs at half the rate. Graphs say it's 2x more bugs, how to deal with that?
@Telastyn, there are some important domains where "good" is just plain NOT GOOD ENOUGH. Review the Therac-25 case for one example. (Note: Therac-25 is not the best case to review. A competent hardware design would have included a MECHANICAL interlock on the beam power level control, so the high-power electron beam mode could not be engaged unless either the X-ray target or a special testing adapter was mounted properly in the beam path.)
May
16
comment I am making 4-5x more story points than average, but producing bugs at half the rate. Graphs say it's 2x more bugs, how to deal with that?
@mrjoltcola, again, read up on the Message Flow Modulator. They used a language, and a programming system, that was specifically built around formal proof of correctness as well as "testing". Part of the problem is that C is inherently unsafe and unverifiable, C++ is worse, and Microsoft Windows is a veritable morass of bugs and stuff, meaning that any attempt to write bug-free code in that environment is likely to be quite a bit more difficult.
May
16
comment I am making 4-5x more story points than average, but producing bugs at half the rate. Graphs say it's 2x more bugs, how to deal with that?
@mrjoltcola, see also the US Space Shuttle avionics. There was exactly one bug in the code when the bird retired. It was a growth provision, for a second robot arm, that was ultimately never done. The review committees looked at it, and determined that (a) it did no harm to anything, and (b) it would cost more than it was worth to "fix" it, because of part (a).
May
16
comment I am making 4-5x more story points than average, but producing bugs at half the rate. Graphs say it's 2x more bugs, how to deal with that?
@mrjoltcola, read up on the Message Flow Modulator project at UT Austin in the late 1970s/very early 1980s. Zero-defect code IS possible, and it is not that hard to do, IF you use the right tools and the right people and the right mindset.