Cheeky bastard

Ovid on 2003-05-01T18:34:13

One of our programs needs to be renamed and there's a variety of places in one of our systems (written in Perl) where it needs to be changed. Our newest programmer (and a good friend of mine) piped up and said "If you want, I can write a Python program to go through and fix your Perl code!"


And the Program Is?

chromatic on 2003-05-01T18:55:46

os.execlp( "perl", "-pi.bak", "-e", ... )

Cheeky Pyhackers

ziggy on 2003-05-01T18:58:53

I say let him.

Right about the time you start running perl -spi.bak -e ..., he'll realize that he's starting to solve a more general problem and start thinking about a class hierarchy.

Right about the time perl -spi.bak finishes, he'll get a brilliant flash of inspiration and start looking at some existing frameworks to make this program easier to write.

In two days' time, he'll realize that all of the existing frameworks are either too abstract, abstracted in the wrong ways, or solving problems in a completely different and totally unrelated domain. He'll start to think deeply about the problem he's trying to solve.

About a week later, he'll have the first sketches of a new framework for writing Python programs that troll about and fix programs in practically any programming language (gotta love that this framework supports plugins at multiple levels!).

A month or so after that, he'll have version 0.25 or so ready to announce to the Python list, and he'll start writing some documentation to prove that this framework is easier to learn, easier to use, faster and more reliable than any other framework. Oh, and he'll start integrating a web-based application server into it.

A few months later, when you're running perl -spi.bak for about the twelfth time, he'll return to the original problem that you needed to fix in your Perl programs three months ago.

:-)

Re:Cheeky Pyhackers

chromatic on 2003-05-01T19:59:07

How long before he discovers that he can embed an interactive fiction parser and still keep the program "mathematically provable"? That was always my favorite step.

Re:Cheeky Pyhackers

ziggy on 2003-05-02T00:28:35

Good point. And no program to "fix Perl programs" will ever be complete until it contains each of the following as well:
  1. a mail reader
  2. a web browser
  3. a templating language (customized to this task and totally unlike every other templating language ever created)
  4. a brand new paradigm for processing XML
  5. its own scripting language based on Lisp or perhaps Python
  6. and a replacement "linux kernel configuration tool"
Oh, yeah -- let's not forget that this describes the first system. I don't even want to imagine what the second system syndrome will do to a project like this. :-)

Second System

chromatic on 2003-05-02T05:13:12

It starts with a patch to perly.y to replace curly braces with Unicode whitespace characters. You have to recompile Perl to install the program and you really don't want to know any more than that.

Re:Cheeky Pyhackers

TorgoX on 2003-05-02T00:17:47

This pleases me.

BTW, I call it Charles Babbage's Disease

Estimate

jonasbn on 2003-05-01T19:23:08

Ask for an estimate, pleeeeeaze... :)