Get the latest tech news

Every line is a potential bug (2009)


September 19, 2009 Last summer I wrote some code to get a message out of a hash table. The message was going to be put there by another thread.

In order to save the computer one rare thread switch, he introduced a bug that would have occasionally and mysteriously caused operations to fail. (Update 3-15-2010: Ajit Mandalay pointed out another bad scenario: the subtraction yields 0, which means “infinity”, and the loop potentially never exits.) Do not write any line of code unless you absolutely need it right now and your program will suffer for the lack of it.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of line

line

Photo of potential bug

potential bug

Related news:

News photo

Telefonica Eyes EU Consolidation After Meeting Expectations

News photo

AI is blurring the line between PMs and engineers?

News photo

US and UK out of step with rest of the world on AI | Why the Paris summit on artificial intelligence failed and how Silicon Valley is toeing the Trump administration’s line