…nobody’s knows you’re a grunt. If you were to judge by the claims made on Slashdot and similar forums, you’d think that architects and consultants with decades of experience are a dime a dozen, and novice programmers as rare as hen’s teeth. Usually such fraud is merely annoying, but sometimes the cognitive dissonance between someone’s statements and their claimed credentials is downright hilarious. As Exhibit A, I offer never nest loops:

I have for the last 10 years been employed in various places as a senior architect/mentor, to instruct and set coding policy across the enterprise..

And I would shoot anyone who nested a loop under any circumstances – let alone three levels, and especially if you plan on exiting from it!

Loops come in two forms : processing loops (ie for every value we want to do something) – and search loops (we want to go through until we find something)

What a great idea. Because our “senior architect/mentor” is uncomfortable interpreting even simple control structures except in splendid isolation, we should adopt a rule that forces us to:

  • break up even fairly simple logic into multiple functions, destroying any readability it once had;
  • force local variables to be passed as arguments and return values or (even dirtier) member variables;
  • rob “return” of a potentially useful meaning, either forcing return values to be propagated through N levels or relying on exceptions which are less efficient and might not be viable for your environment;
  • abuse the stack to hold all of those arguments, return values, and function/exception frames;
  • risk subtle bugs that occur when an argument (which used to be a local variable) is modified and not propagated back to the caller (which used to be part of the same function).

I’m sure I could think of a half-dozen more reasons not to take Darren Oakey’s advice, but the point should be clear. Even if his suggestion had technical merit, it would undoubtedly cause a rebellion among the programming staff — a fact I’m sure any real architect or mentor would know. I guess it should come as no surprise that Darren also hates specs. Somehow I don’t think most employers are rushing to hire architects with that attitude. Here’s a rule that might really be useful for net.experts: if you’re going to play a role, at least try to be convincing.