|Problems? Is your data what you think it is?|
Please 'hack' nicely...by vladb (Vicar)
|on May 23, 2002 at 13:07 UTC||Need Help??|
When I first started writing simple Perl programs, I should admit I didn’t take Perl all too seriously. In the back of my mind I used to associate Perl heavily with the word ‘hack’. Here’s one of the ways in which this word is being defined at http://www.dictionary.com:
1. To cut irregularly, without skill or definite purpose; to notch; to mangle by repeated strokes of a cutting instrument; as, to hack a post.
Having originally come from C++/Java roots, to uninitiated self programming Perl in fact meant “hacking”. I had friends (err.. still do) who used to apply the word “hack” in a similar context too. Hack! There are a number of websites dedicated to nerds/programmers such as SlashDot.org and codingstyle.com where the word is a common occurrence.
I recall back the days when writing a true “hack” made me somewhat proud of myself. I would feature the word prominently in my code just before where the true ‘masterpiece’ (aka ‘hack’) was placed. For example, take a look at this snippet:
Compare the ‘HACK’ portion of the code with an equivalent and render your own judgment. Well, revisiting my old code, sticking with the community of fellow monasterians, and reading various articles/books on proper software coding practices made me rethink a lot of old notions and ideals I once cherished and now came to despise. Having had to maintain my old code and deal with seemingly childish ‘hacks’, I became increasingly frustrated by any mentioning of the word ‘hack’ in the context of programming (especially Perl). In my conversations with fellow developers, I try to use the word with extreme caution and very very seldom. I’m trying to be careful not to excite any other developer (especially junior type) into writing a lot of ill hacks that I might eventually have to deal with later in my work.
Have you had similar bad experiences in your career as a Perl programmer? Did you ever have to deal with stubborn ‘hackers’ or haunted by the shadows of certain ‘hacks’ you had implemented in the past?
UPDATE: Or is my interpretation of 'hacking' invalid? ;)