Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

"Chuck Norris"-ing code

by brian_d_foy (Abbot)
on Aug 05, 2008 at 01:38 UTC ( [id://702200]=perlmeditation: print w/replies, xml ) Need Help??

Sometimes when merlyn or I consult on Perl projects, it turns out that the client expects a magic wand. Somehow, because we have our names on books or speak at conferences, when we load code into an editor, that alone should magically fix things while at the same time not changing any code or any part of the process. Randal has started calling this "chuck norris"-ing the code. I don't know if he invented the phrase, but it's likely. —Update Randal says he hasn't heard anyone use it, so I say he's the inventor.

Chuck Norris is a real, yet mythic and legendary figure for Americans. He's a kick ass martial arts guy who fought Bruce Lee in Meng long guo jiang. In his various movies and TV series he saves the world through force of will and by just showing up. Chuck Norris is the man who can do anything, and the universe is afraid of him. Not just the people in the universe, the actual universe itself. Chuck Norris's abilities are collected in Chuck Norris Facts, which include:

  • Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
  • Chuck Norris’ hand is the only hand that can beat a Royal Flush.
  • Chuck Norris can lead a horse to water AND make it drink.
  • Chuck Norris doesn’t wear a watch, HE decides what time it is.

When Stonehenge consults, we normally accept clients we think we can help. We're not firefighters or contractors; we want to help people use Perl effectively. We want to leave your work environment a better place through actual consulting (where we discover and advise) and training. Typically, these situations are one of three situations:

  • Things are slow, and we don't know why or how to fix it
  • Things take up too much memory, and we don't know how to fix it
  • Things can be better, but we don't know where to start

For most of our clients, this works out just fine. We spend a concentrated amount of time looking at everything and can point the way. It's not always that the client doesn't know, but that they need someone else to say it for them. The tech people convince the managers by having us confirm what they have been saying. In other cases, they just need a little push in the right direction.

For the occasional client, often a very big company, hires us and makes all the right noises about their commitment to improving their work process, yada yada, and we schedule a week to do the initial assessment. These clients often don't have test machines or even a test suite. No big deal. Those are things that we can fix.

However, there is this weird sub-group of companies who pay consultants for answers they never intend to use, even setting aside the situations that are just kick-backs, money laundering, and so on. We ask about getting an account on the test machine, but they tell us that's the same as the production machine. Okay, so no test machines, mark that down for the report. Next we want to run the test suite to benchmark the code. We can't report where to ended if we didn't figure out where we started. Some companies don't have test suites. That's not a big deal. Again, we're here to help. However, there's a small group that also doesn't want a test suite. "We don't have time to write tests", yada yada. They know what they need to do but have some social roadblocks to solve.

This brings us to another, even smaller group—the one that motivates this post. This smaller group doesn't want to change the code! We can make all the recommendations we like, such as "use DBI instead of system calls to talk to the database" or "expat is a lot faster than regular expressions on 100Mb files!", but that doesn't matter. Change is bad, and editing files is change, so editing files is bad. We know how to commit to revision control, but not branch or revert, so don't change anything! Oh, and we all share the same working copy and we're used to that so we're going to keep doing that. They want us to make everything better without changing anything (anything at all), as if we could "chuck norris" the situation:

  • The system works because Chuck Norris tells it to work
  • Chuck Norris doesn't need a test suite. The test suite needs Chuck Norris.
  • CPUs run faster to get away from Chuck Norris
  • Chuck Norris normalizes all schema just by inserting random data
  • Chuck Norris can compile syntax errors
  • Packets travel faster than the speed of light for Chuck Norris, but he can still catch them
  • Chuck Norris has Internet 3
  • Check Norris can parse invalid XML
  • Chuck Norris can break Moore's Law
  • Chuck Norris's brain is his revision control, and it works better than git

Most of all, though, "chuck norris" is now our code name for jobs where we were hired to do something specific which we are then not allowed to actually do:

  • Chuck Norris can fix everything without changing anything.

I like this phrase, and it might even be a way to bring up the subject with managers and other roadblocks without being so serious. I hope that we don't have more clients like that though. :)

brian d foy <>
Subscribe to The Perl Review

Replies are listed 'Best First'.
Re: "Chuck Norris"-ing code
by whakka (Hermit) on Aug 05, 2008 at 06:31 UTC
    • Chuck Norris breaks out of loops with his feet.
    • Chuck Norris has no use for rand - his values were always meant to be.
    • If you eval Chuck Norris code it punches you in the face.
    • It takes Chuck Norris code 1 second to sleep 2.
    • Chuck Norris has no memory limit.
    • What Chuck Norris does not bless, Chuck Norris kills.
    • The ChuckNorris::Roundhouse module has no dependencies. Only justice.
    • Chuck Norris has no need for Acme::Bleach. He looks at the screen and the text runs away.
    • There is only one way to do it. The Chuck Norris way.
      • Chuck Norris can finish an infite loop in 1.3 seconds.
      • Code written by Chuck Norris cannot be optimized.
      • Chuck Norris doesn't need compilers nor editors. He roundhouse kicks the disk and the bytecode appears.
      • Chuck Norris doesn't use GOTO. Code comes to him.
      • Chuck Norris had a brief conversation with Donald Knuth in the early 60s. Donald is still writing about it.
      • Chuck Norris was once angry at the world. So he created Windows.
      • 90% of the worlds spam is handtyped by Chuck Norris. It takes him only 3 minutes.
      • Every time you don't use "use strict" Chuck Norris kills a kitty.
      • All the good code on CPAN has been written by Chuck Norris.
      • Chuck Norris can fill a ZFS in seconds, without boiling his blood.
      • The best compression algorithm in existence are Chuck Norris fists.
      • The one true bracing style is the one Chuck Norris uses.
      • Chuck Norris doesn't use subroutines to break down long streches of code. He roundhouse kicks instead.
      • Every program Chuck Norris has written can be run backwards. It will rollback whatever it did.
      • No matter how you encrypt your traffic, Chuck Norris can read it by just looking at the cable. His ears can intercept wifi transmissions.
        Larry Wall, Randal Schwartz, Damian Conway, and Mark Jason Dominus are merely Chuck Norris sockpuppets.
        Chuck Norris doesn't debug, his code doesn't have bugs!! But if he is going to debug *your* code he only stares at your screen until every bug squashes itself.
Re: "Chuck Norris"-ing code
by perrin (Chancellor) on Aug 05, 2008 at 12:50 UTC
    I've seen this kind of thing too. The particular version of it I know is managers who will try anything before they change the code, regardless of cost. Performance problems? Buy a (hardware) caching proxy. Buy more machines. Buy a NetApp. Buy an entirely new commercial software platform for millions of dollars. But whatever you do, don't try to improve the existing code! That will only cause bugs.
      The sad thing is that their opinion is often well-founded from past experiences with programmers trying to "optimize" things.

        This calls for a total rewrite!

        TGI says moo

Re: "Chuck Norris"-ing code
by toolic (Bishop) on Aug 05, 2008 at 01:51 UTC
    Let me get this straight. You have clients who are willing to pay you not to do anything? Wouldn't they be considered ideal clients :)
      Only if we were in this just for the money. But I have a natural desire to actually help people, and make the world a better place as a justification for getting up each morning. All the money in the world can't replace that.

      What merlyn said + it can eat away at your self-esteem if you do excellent work for a client and see it thrown away in the surreal but not entirely uncommon idiom brian_d_foy describes. Being paid to do nothing, or even being paid to do a bad job in spite of offering good work instead, is not good for one's psychology. These kinds of clients should be avoided if you can't massage them, as it were, out of that tack.

        But it's not being paid to do nothing... Obviously the customer expects you to work. They expect to see you looking at code, they might even expect to see milestones being reached. What the customer does not want is anything in production to be changed. I've worked under these conditions, and what your mother says about psychology is an understatement. This sort of work can make you seriously depressed, even if the money is great. Perhaps there are certain kinds of people who can take this, but I won't work under those conditions again, whatever the money.

        - Boldra
      I once found myself in a curious and not entirely dissimilar situation - the client was essentially paying a retainer to my employer to make sure I was available to do something for them asap if they thought of anything they needed (the product was in the final run-up to the final release).

      The way the arrangement was worded meant that the client only paid for the hours I wasn't doing anything else that benefitted my employer. As soon as I started doing some analysis for another tender we were making, for example, the client stopped paying.

      Consequently, being an ethical kind of person, I diligently earnt money for my bosses by doing crosswords, figuring out how to do sudoku, writing a program to do sudoku for me, reading books (some technical, most not) learning ant (vile), learning perl (much much nicer), and painting my front room (with the laptop under the dust covers, and the email alert sound turned right up).

      Sadly, the paint we'd chosen didn't cover very well, so it took four coats. But I was probably the best paid decorator on the planet for a couple of days.

      And when that contract finally ended, I resigned and went elsewhere, partly because they were being bought out by a company that wanted to take them in a completely different direction, and partly because I wanted to actually change something again...

      Plus, if they decide to blame you, your reputation is on the line.
Re: "Chuck Norris"-ing code
by jdporter (Paladin) on Aug 05, 2008 at 17:21 UTC
    Change is bad...

    They are not Willing To Change. This sounds like an AntiPattern. Possibly related to If It Is Working Dont Change, but without the conditional. ;-)
    They could be afraid of change in general, or it could be that they don't trust you because you're not One of Them — you're outside their Community of Trust — and thus anything you do is Not Invented Here and a scary mystery.

    Perhaps they are gambling on being able to use you as a ScapeGoat, but to do so requires that you not actually fix the problem, so they make sure you don't.

    ... he saves the world through force of will and by just showing up.

    Reminiscent of heavy wizardry... but with deeper magic.

    Between the mind which plans and the hands which build, there must be a mediator... and this mediator must be the heart.
Re: "Chuck Norris"-ing code
by GrandFather (Saint) on Aug 06, 2008 at 03:00 UTC

    Way back when I was an electronic tech at a university. At that time a number of departments I worked for had Apple IIe computers. From time to time they would break and I would be called in to look at them. Most times that was all I needed to do - look at them, and they would burst into life again. I got a bit of a (positive) reputation as a result. Funny thing is, most of those faults didn't come back!

    My name's not Chuck by the way, and it only seemed to work like that for Apple IIe computers.

    Perl reduces RSI - it saves typing

      Care to drop over GrandFather,

      I could use your "Magic/Chuck Norris-ing on a couple of dead monitors!

        Dead monitors! Hell we have a couple of dead banks (USA) that could use that sort of revival... :)

Re: "Chuck Norris"-ing code
by marcussen (Pilgrim) on Aug 09, 2008 at 14:09 UTC
Re: "Chuck Norris"-ing code
by explorer (Chaplain) on Aug 11, 2008 at 17:49 UTC

    And... When this article can be a Wikipedia article?

      Chuck Norris uses constants for variables.
Re: "Chuck Norris"-ing code
by holli (Abbot) on Jan 17, 2009 at 19:34 UTC
    Chuck Norris doesn't need a PAUSE account. He is PAUSE.

    holli, /regexed monk/
Re: "Chuck Norris"-ing code
by ladyphnx (Novice) on May 18, 2009 at 16:27 UTC
Re: "Chuck Norris"-ing code
by Anonymous Monk on Aug 07, 2008 at 03:02 UTC
    If you can't change code, simple install a More Magic switch. :-)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://702200]
Approved by toolic
Front-paged by Corion
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-20 07:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found