Heisenbug
21–30 of 34 posts
Re: Heisenbug
#22Earlier quoted context omitted.
Probably 'bug' is not the best word, but many programmers definitely consider excessive complexity as 'bad design' (unless complexity is inherently unavoidable due to the very nature of the problem).
And others pile it on in the name of "user friendliness" or "security"...
Re: Heisenbug
#23If you hate heisenbugs, use Functional Programming (or data-race-safe langs such as Rust). It will kill 99.99% of them.
Re: Heisenbug
#24One of the first heisenbugs I encountered was IE8's console.log. That object/function was only defined when the developer tools were open. Otherwise you would get an exception (but of course you couldn't see that exception in any place). Daily effect was funny: When you forgot a console.log in your code your page JS would hang. When you tried to debug it by opening the developer tools everything worked- and you start…
But... how on earth did that escape QA? I mean surely even whoever was developing IE8's developer tools would have had accidentally forgotten a console.log() or two during development, surely?
How did this ever manifest itself? The only thing that seems a plausible explanation is that the console injects the console object or the console.log function into the global JavaScript scope when it is opened and according to the behaviour described and either garbage collected or removed from scope when the console was closed. This seems like it could have only really been the intended behaviour.
[0] https://developer.mozilla.org/en-US/docs/Web/API/Console/log...
Re: Heisenbug
#25Re: Heisenbug
#26If you hate heisenbugs, use Functional Programming (or data-race-safe langs such as Rust). It will kill 99.99% of them.
That's assuming that heisenbugs are caused by concurrent programming alone. But a ton of heisenbugs happen in boring single-threaded programs.
Re: Heisenbug
#27Re: Heisenbug
#28I transitioned over from hardware design long ago. We had a similar concept where the circuit would work, but only when an oscilloscope probe is attached at the right place..
Re: Heisenbug
#29Earlier quoted context omitted.
That's assuming that heisenbugs are caused by concurrent programming alone. But a ton of heisenbugs happen in boring single-threaded programs.
Tons? In my entire career I haven't found one of those.
Re: Heisenbug
#30One of the first heisenbugs I encountered was IE8's console.log. That object/function was only defined when the developer tools were open. Otherwise you would get an exception (but of course you couldn't see that exception in any place). Daily effect was funny: When you forgot a console.log in your code your page JS would hang. When you tried to debug it by opening the developer tools everything worked- and you start…
Another fun one was dangling commas in arrays, which breaks IE 7 and lower.
It used to be somewhat common to put something like this at the top of scripts:
if ( window.console == undefined ) { window.console = { log: function() { }; }