News for hackers. Stuff that matters.
Re:Interviewing programmers: coding test example explained by edanm on Thursday June 03, 2010 @12:58PM (#1401821)
I love higher language's foreach construct. Have to work with what we've got though, and in C, the `for` loop is it.

By the way, I don't know what a Hoare triple is, and reading a little on Wikipedia didn't enlighten me. Any chance for an explanation?

Re:Interviewing programmers: coding test example explained by jemfinch on Thursday June 03, 2010 @01:20PM (#1401885)
I assume you read http://en.wikipedia.org/wiki/Hoare_logic ?

Basically, the (relevant) state of the computation is represented as a set of logical propositions which are true before a statement, and a set of logical propositions which are true after the statement. For each kind of statement the language supports (`if` statements, `while` statements, etc.) there are natural ways to reason about those triples.

Do you understand the "While rule" on the link above? I can explain it in natural language, but I'd rather not expend the effort if it's not something you've already seen.