# Coding For Violent Psychopaths

**URL:** <https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304>\
**Category:** blog\
**Created:** [June 17, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304 "2008-06-17T00:00:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![codinghorror](https://discourse.codinghorror.com/user_avatar/discourse.codinghorror.com/codinghorror/32/36371_2.png) [@codinghorror](https://discourse.codinghorror.com/u/codinghorror)\
**Post date:** [June 17, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/1 "2008-06-17T00:00:00Z")

</div>

Today's rumination is not for the weak of heart. It's from the venerable C2 Wiki page [Code For The Maintainer](http://c2.com/cgi/wiki?CodeForTheMaintainer):

* * *
This is a companion discussion topic for the original blog entry at: [http://www.codinghorror.com/blog/2008/06/coding-for-violent-psychopaths.html](http://www.codinghorror.com/blog/2008/06/coding-for-violent-psychopaths.html)

---

<div class="post-metadata">

**Author:** ![secretGeek](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/s/8dc957/32.png) [@secretGeek](https://discourse.codinghorror.com/u/secretGeek)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/2 "2008-06-18T00:00:00Z")

</div>

given the hiring policies in this place, it’s not so much a guideline as a rule.

---

<div class="post-metadata">

**Author:** ![Andy\_Wong](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/a/9dc877/32.png) [@Andy\_Wong](https://discourse.codinghorror.com/u/Andy_Wong)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/3 "2008-06-18T00:00:00Z")

</div>

I has very bad memory, and I don’t even remember codes I wrote 2 weeks ago. So I always design first, and try to make the structures simple, refactor the codes every half hour, review design every 1 or 2 days through reverse-engineering of UML tools, and supplement more comments. With simple and clear structures, and consistent design patterns for similar stuffs, I leave traces to myself for the future maintenance, because, in 2 week time, I will become a fresh programmer touching codes left by the other (actually me).

---

<div class="post-metadata">

**Author:** ![Jim\_McKeeth](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/j/a88e4f/32.png) [@Jim\_McKeeth](https://discourse.codinghorror.com/u/Jim_McKeeth)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/4 "2008-06-18T00:00:00Z")

</div>

I wish some of the code I am maintaining was written by someone who followed that guideline. Sometimes I feel like becoming a violent psychopath and hunting someone down. Here is an example from today:

// Goto used to enhance simplicity and readability.  
label GOTO\_NEXT;

That is the original comment used to explain the use of the GOTO. I would think GOTO and Readability are mutually exclusive.

---

<div class="post-metadata">

**Author:** ![pikapi](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/p/48db29/32.png) [@pikapi](https://discourse.codinghorror.com/u/pikapi)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/5 "2008-06-18T00:00:00Z")

</div>

I’m an obsessive commenter in my own code, and almost every few lines of code comes with painfully detailed documentation on what kind of stuff the code does to each variable, so I think the psychopath code maintainer would still come after me: for commenting too much

---

<div class="post-metadata">

**Author:** ![Mike](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/m/58f4c7/32.png) [@Mike](https://discourse.codinghorror.com/u/Mike)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/6 "2008-06-18T00:00:00Z")

</div>

Being a student I’ve never had the pleasure of dealing with real-world code, but maintaining what some students write in their projects brings me ever closer to slamming my own head through my monitor in despair. There’s a fine line between not being able to code well and having better things to do than to code well, and when some people write awful code just so they can leave early to watch TV it really bugs me.

---

<div class="post-metadata">

**Author:** ![Kooch](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/k/a87d85/32.png) [@Kooch](https://discourse.codinghorror.com/u/Kooch)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/7 "2008-06-18T00:00:00Z")

</div>

Oh man, I so want to axe murder some of the people who wrote the god-awful code I have to maintain.

---

<div class="post-metadata">

**Author:** ![JoshS](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/j/e5b9ba/32.png) [@JoshS](https://discourse.codinghorror.com/u/JoshS)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/8 "2008-06-18T00:00:00Z")

</div>

Jeff, why couldn’t you tell this to the person who wrote the shit I am currently working on?!

---

<div class="post-metadata">

**Author:** ![l33tminion1](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/l/9f8e36/32.png) [@l33tminion1](https://discourse.codinghorror.com/u/l33tminion1)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/9 "2008-06-18T00:00:00Z")

</div>

Heh, I first heard that advice today, but from a completely unrelated source (a guy giving a talk on typing systems for scripting languages at ITA software). I think it’s good advice: “Throwaway code” often isn’t and good documentation is key (especially in weakly-typed languages).

---

<div class="post-metadata">

**Author:** ![DavidV](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/d/4af34b/32.png) [@DavidV](https://discourse.codinghorror.com/u/DavidV)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/10 "2008-06-18T00:00:00Z")

</div>

lol! This is perfect advice for myself as I prepare to hand off a little VBA ‘app’ I’ve been working on - I think I’ve commented to code and even supplied a semi-detailed design doc to go along with it. It’s not complex code, just a ton of it, mostly revolving around form validation.

Maybe next week I’ll get to take the training wheels off :S

---

<div class="post-metadata">

**Author:** ![ilcavero](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/i/a87d85/32.png) [@ilcavero](https://discourse.codinghorror.com/u/ilcavero)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/11 "2008-06-18T00:00:00Z")

</div>

I heard that quote first from the missed Kathy Sierra. I have an even better quote:  
“Always code as if the person who ends up maintaining your code is going to be yourself, because at first it will always be”

---

<div class="post-metadata">

**Author:** ![CharlieL](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/c/a587f6/32.png) [@CharlieL](https://discourse.codinghorror.com/u/CharlieL)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/12 "2008-06-18T00:00:00Z")

</div>

Sorry Jim, just need to vent a bit  
What up with everyone hating GOTOs? There’s a good reason why they are still here. Sometimes there just isn’t a nicer way to show that without taking a horrible lag-hit.  
GOTOs are like OO, like functions, like everything in programming a tool that has it’s moment and use, rare indeed, but it’s still there. And believe me, I’ve seen spaghetti code built entirely with objects (can you imagine having to jump up and down in object hierarchies to see how a function works? WHY?)  
Dijkstra talked about misuse of GOTOs to jump all over that code which made it impossible to read and didn’t even help for efficiency that much. Thinking that means GOTO should never be used is like thinking that the word like should never ever be used, not even on similes, because your english teacher said that people shouldn’t use like as much as they do.

---

<div class="post-metadata">

**Author:** ![Andy\_Chase](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/a/e19adc/32.png) [@Andy\_Chase](https://discourse.codinghorror.com/u/Andy_Chase)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/13 "2008-06-18T00:00:00Z")

</div>

Most of the code I have to work with is always written partly the old way, partly the new way, partly “I thought we got rid of all that”, and partly stuff that doesn’t do anything, but looks like it does, and basically a mess. I’m sure it was coded well in the first place, it just got blended together with “better” code.

---

<div class="post-metadata">

**Author:** ![DanielC](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/d/a3d4f5/32.png) [@DanielC](https://discourse.codinghorror.com/u/DanielC)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/14 "2008-06-18T00:00:00Z")

</div>

A very good habit I was taught in university was to comment first, code later. What approaching a programming task, write out the comments for the code that you haven’t written yet. Helps you plan and you end up with detailed comments when you’re done.

---

<div class="post-metadata">

**Author:** ![ElvisM](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/e/f1d935/32.png) [@ElvisM](https://discourse.codinghorror.com/u/ElvisM)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/15 "2008-06-18T00:00:00Z")

</div>

Oh, boy! Is it just me or is everyone else also scared [insert vulgar slang for feces here] by this picture? If the world had more zombies, we’d all be better coders. Right, Jeff? :-)

---

<div class="post-metadata">

**Author:** ![Ian00](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/i/5f9b8f/32.png) [@Ian00](https://discourse.codinghorror.com/u/Ian00)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/16 "2008-06-18T00:00:00Z")

</div>

I just got my first coding job, and it is maintaining and bug fixing. Its hard to get used to. I feel you.

---

<div class="post-metadata">

**Author:** ![Legacy](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/l/e495f1/32.png) [@Legacy](https://discourse.codinghorror.com/u/Legacy)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/17 "2008-06-18T00:00:00Z")

</div>

Code is in maintenance from the second it’s checked-in, just like software is legacy the minute it’s in production.

---

<div class="post-metadata">

**Author:** ![Patrick](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/p/b2d939/32.png) [@Patrick](https://discourse.codinghorror.com/u/Patrick)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/18 "2008-06-18T00:00:00Z")

</div>

Poor choice in picture my friend. I comment my code generously and coherently… not sure programmers that document well deserved this. :(

---

<div class="post-metadata">

**Author:** ![david12](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/d/ed655f/32.png) [@david12](https://discourse.codinghorror.com/u/david12)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/19 "2008-06-18T00:00:00Z")

</div>

Hell is other people’s code!

---

<div class="post-metadata">

**Author:** ![Viktor](https://discourse.codinghorror.com/letter_avatar_proxy/v2/letter/v/d6d6ee/32.png) [@Viktor](https://discourse.codinghorror.com/u/Viktor)\
**Post date:** [June 18, 2008, 12:00am UTC](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304/20 "2008-06-18T00:00:00Z")

</div>

I choose to write code in such a way that the person who ends up maintaining the code believes that I am a psychopath and likely know where he lives. I achieve this by leaving threatening comments dispersed throughout the lines, as well as short bits of prose that details my abused childhood. This way I can pretend to do my job and after I’m gone he will be too afraid to tell anyone out of fear of me murdering his cat.

[Next page](https://discourse.codinghorror.com/t/coding-for-violent-psychopaths/304.md?page=2)
