At last night's Toronto Perl Monger's meeting, Richard Dice talked about a gee-whiz piece of code that he cooked up using the three modules CGI::Application, Class::DBI and HTML::Template. But the reason for today's meditation is about something he mentioned during the presentation: his (somewhat irrational) pride at the code he'd written, to which he referred as Stupid Emotional Programmer Attachment.
As soon as he uttered those words, I understood what he was talking about .. when we as software developers rise above the mundane and create something really brilliant, don't we get attached to it?
My examples are not all Perl, but they include
- A piece of C code that maneouvered robotic arms around so they didn't crash into each other. Because of the geometry involved, they had to swap roles (and I had to reverse the voltage) for some configurations. So amazing to watch the arms move.
- A piece of C code that was the communications subsystem for a Point of Sale system: it ran under both DOS (as a Terminate and Stay Resident program) and PC-MOS (as a seperate task), and handled transactions either via 3201 (poll select) or dial modem, all from a single binary. A state machine, arrays of function pointers, object orientation, the works. Beautiful.
- One of my first Perl scripts that translated memory model information into chunks of SQL, complete with checks that the foreign keys format matched the original table index, and checks that tables were declared only after the tables they referred to had been declared. Very, very cool.
Life is short: get busy!