on porting

Maybe I'm a big elitist, but I really dislike porting bad code. I'm always torn between wanting to rewrite and restructure it, and wanting to just push it through. I feel like it makes my brain dirty every time I read it.

It does hurt me...the code duplication, the completely extraneous code, the badly named varibles... I understand that it's just the nature of a large project like this, that just accrues code, that sometimes it's easier to copy and paste than to encapsulate, but... it still hurts me. 

It's the missing sense of pride, I guess?  Like, in porting this, I'm not really on the line for algorithm design or anything, the game already works... but I still feel bad passing on these terrible tangles to whoever else will have to work on them.  I feel bad putting my name at the top of the file, I want to put a disclaimer next to it.

Basically, I've been spoiled this past year by only working on our in-house code.*

*elitist fist bump, mabreu.


  1. How mechanical is the port? Is it possible to write a tool that can do (some of) it for you? I find meta-programming to be so much more satisfying than turning myself into a machine.

    "We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris." -- Larry Wall, Programming Perl (1st edition)

  2. Regular expressions get me pretty far as far as the syntax, but there's some structural stuff like the event flow and the display code that has to be overseen by hand.

  3. That's funny, I've always considered humility to be a much better virtue for a programmer than hubris.


    Also I'm fully on board with the statement that copy and paste is a design error. I probably would end up putting that disclaimer next to my name...

  4. Humility is disqualified, you need to come up with a word with a negative connotation (see: laziness, impatience) in order for it to be a fair comparison.

  5. ok, now I agree with you. Laziness and impatience I understand as programmer's virtues, but I'm curious what the argument for hubris is?