in reply to Breakin' the rules, Breakin' the rules

Something like that sounds like it's far too easy to take out of context and likely miss the entire point.

First, rule-breaking: we've (probably) all heard that goto's are evil. That's a pretty good rule. But you need to understand what's evil about them before you can go and break that rule (which I do regularly, especially in C, and I try to in C++, but some of my coworkers make that difficult).

That said, it's just as likely (from this perspective, not having read that book, or even heard of it) that it's just talking about thinking outside the box. Your boss gives you a box to think in - it's ok to think outside that box for a more holistic solution. I regularly do, and it seems to do me well.

  • Comment on Re: Breakin' the rules, Breakin' the rules

Replies are listed 'Best First'.
Re^2: Breakin' the rules, Breakin' the rules
by ikegami (Patriarch) on Jun 01, 2007 at 14:13 UTC

    I'ved used goto in C to handle cleanup of dynamically allocated resources.

    BOOL some_func() { BOOL success = FALSE; allocate_temp_resources(); if (might_fail()) { goto Cleanup; } if (might_fail()) { goto Cleanup; } success = TRUE; Cleanup: free_temp_resources(); return success; }

    Suiteable alternatives can be written in C++ and Perl thanks to destructors.

Re^2: Breakin' the rules, Breakin' the rules
by blazar (Canon) on Jun 01, 2007 at 14:11 UTC
    That said, it's just as likely (from this perspective, not having read that book, or even heard of it) that it's just talking about thinking outside the box. Your boss gives you a box to think in - it's ok to think outside that box for a more holistic solution. I regularly do, and it seems to do me well.

    Currently I'm so "lucky" that I don't have to work, and even when I did, it was not for a big corporation. But I thought that in those environments this famous lateral thinking was one of the big buzzwords managers use when they want to seem particularly smart, next to "synergy" and "proactive". So, do they want you to think lateral or in a box? (I know that people's mileage will vary!)

Re^2: Breakin' the rules, Breakin' the rules
by perlfan (Parson) on Jun 01, 2007 at 20:48 UTC
    The problem with GOTOs are not that they are bad when used responsibly, but it is hard to not use them. In otherwords, they make you lazy.