in reply to Please 'hack' nicely...

I hack, and I program. I hack when I want it done now, the one-off script, when I'm not quite sure what I'm doing but not letting that hinder me, and when seeing what can be done. I program when I want stuff I'm going to reuse, stuff others may need to maintain, and when I have that tremendous inner calm that makes me program when I've set out to hack.

Some of my programs have ended up with hacks in them, this is regretable and I've clearly marked them with comments like 'This is the largest kludge I've seen since the last one'. I then go back and fix them, some may call it refactoring but when it's so ugly I don't think it deserves such pretentious description.

Equally, some of my best hacks have become programs. Quite often when I'm beginning a program there'll be two or three areas which I'm not experienced in which are needed, and so I'll start off writing a small script to try out each area. Sometimes I'll then think 'But how will this X script interface with feature Y?' and build that on there too, and before I know it the script has organically grown to become a full program.

I think my last three large projects here all germinated from a hack. The first being a hack to test something regarding it's data structures, the second a hack concerning connection Perl to Java via the command line in a nice way, and the third controlling the number of processes running doing a certain thing- irregardless of which user was running them.

I consider this to be an okay thing, assuming I don't mind going back and tidying up any bits that even marginally resemble hacks. Sweep ugly hacks under the carpet of good code. When I read about the 'write a bit, test a bit, rinse and repeat' of XP I ended up realising that was pretty much what I did.

Oh, I also prefer the definition of hack from the Jargon file. It's a nicer definition, and may eventually make you happy to say 'Yes, I'm a hacker'. Then again, people who go by the 'Beautiful hack' kind of definition may want to meet me in a dark alley whilst they're carrying a selection of sporting equipment beginning with a reasonably sturdy baseball bat for what I just said.

Replies are listed 'Best First'.
Re: Re: Please 'hack' nicely...
by dsheroh (Monsignor) on May 23, 2002 at 22:45 UTC
    when I have that tremendous inner calm that makes me program when I've set out to hack.

    Uh, OK...

    While I may lack any desire to set upon you with my collection of medieval weaponry, I must be one of the 'beautiful hack' people you're talking about. To my mind, "tremendous inner calm" is a good place for a hack to begin and almost certainly where it will leave you afterwards. (Well, either tremendous inner calm or "Oh my god... How did I ever manage to come up with something that elegant?" (Note that, in my world, clarity is a prerequisite for elegance. Unless you're working on an obfu.))

    But am I happy to say, "Yes, I'm a hacker"? No. I'm not nearly that good. (Yet?)