I think that the “You’re Doing It Wrong” post hits the nail on the head: in most algorithms, it is only (the avoidance of) page faults that really matters. Thus, if you are looking for “the first all-zero row,” your strategy should be one that avoids hitting every element in the row, because you know that worst-case you are going to cause every virtual-storage page associated with the matrix to be paged-in one at a time (only to discover that no such row exists). The trade-off is always time vs. space, and so you can solve the problem by maintaining a hash-table or tree, keyed by row-number, which tells you which (range of) rows currently contain all-zero. And, you reinforce the process by sorting the list of things that you’re going to search for in that hash-or-tree, to minimize the page-faulting activity associated with that data structure.
A so-called “sparse” data structure choice is also usually indicated here, because ... if the row contains zero, why are you “storing” it at all? You only need to store that which is not the default value (e.g. zero).
When processing the data structure, you know-about and take advantage of the principle of locality of reference, sorting the list of elements you’re going to update or search for, so that the “next” hit is likely to be “close to” the previous one, thus improving the odds that no additional page-fault will occur.
None of these are theoretical, mathematical-abstraction issues. They are boots-on-the-ground hard principles of proven worth in terms of the one thing that we cannot manufacture: time.
As far as goto is concerned, I believe that the original notion remains valid: unpredictable flows of control within an application are highly undesirable and should be avoided when it makes good engineering sense to do so ... which happens to be “almost all the time.” One of the best observations I’ve seen so far is that there are usually two specific cases where you want to use goto:
One of the key technical issues with goto is that it says, “go to here from anywhere-else,” while saying nothing at all about either the context that you are coming from, or the context that you are going to. It is extremely difficult to generate good, optimizable object-code in that case. On the other hand, sometimes goto is absolutely vital: the code that is generated by yacc is (as far as I recall...) loaded with them.