Testing Godwin's Law

January 2nd, 2008 by Mitch Frazier

Your rating: None

Last week I came across Godwin's Law. Many of you may already be familiar with it. For those of you who aren't, Godwin's Law, according to wikipedia, states:

As an online discussion grows longer, the probability of a comparison involving Nazis or Hitler approaches one.

To test this law I wrote a little program to look at comments in the drupal database that contains the Linux Journal web content. The script first gets all the distinct article ids (nids in drupal speak) from the comments table where the comment includes one of the key words. Then it gets a count of the number of comments for each article, sorts the list, and outputs the count along with the article title.

Here's the script:

#!/bin/bash

source mysqlpwd.sh

echo "<table border=\"1\">"
echo "<thead>"
echo "<tr><th># Comments</th><th>Article Title</th></tr>"
echo "</thead>"
echo "<tbody>"
mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
    -e "SELECT DISTINCT nid FROM comments WHERE comment LIKE '%hitler%' OR comment LIKE '%nazi%'" |
    while read nid
    do
        if [[ $nid != 'nid' ]]; then
            count=$(mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
                -e "SELECT COUNT(*) AS cnt FROM comments WHERE nid = $nid")
            count=$(echo ${count/cnt/})
            printf "%d\t%d\n" $count $nid
        fi
    done | sort --numeric --reverse |
        while read count nid
        do
            t=$(mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
                -e "select title from node where nid = $nid")
            t=$(echo ${t/title/})
            printf "<tr><td>%d</td><td><a href=\"/node/%d\">%s</a></td></tr>\n" $count $nid "$t"
        done
echo "</tbody>"
echo "</table>"


Here's the output:

# CommentsArticle Title
259A five year deal with Microsoft to dump Novell/SUSE
205Penguins for President?
192My Visit to SCO
178Saving the Net
165Obsolete Microkernel Dooms Mac OS X to Lag Linux in Performance
123Software Freedom for Macedonia?
59Why I Don't Use the GPL
58What Can't Open Source Achieve in the Next 10 Years?
56A Penguin Angle on the Ox: Day One at Macworld
55Miguel de Icaza plays fast and loose with the facts and history
37Linux in Government: Linux Desktop Reviews, Part 6 - Ubuntu
32Looking for Answers
31Bit Prepared: A Missing Link?
13Scientology Lawyer Promises to Continue "Appropriate Action"
12Hey Microsoft, Sue Me First
7Linux in Government: Understanding Federated Identity Management
5Open Source Radio


For comparison we need to get a list of articles that contain a large number of comments but that do not contain the keywords. Now we look at each article, then we check to see if it has any comments that contain the keywords. If it does not then we count the number of comments and output the article if the associated discussion was long. I arbitrarily chose 100 as the minimum number of comments needed for a discussion to be classified as long.

Here's the script:

#!/bin/bash

source mysqlpwd.sh

echo "<table border=\"1\">"
echo "<thead>"
echo "<tr><th># Comments</th><th>Article Title</th></tr>"
echo "</thead>"
echo "<tbody>"
mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
    -e "SELECT nid FROM node" |
    while read nid
    do
        if [[ $nid != 'nid' ]]; then
            count=$(mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
                    -e "SELECT COUNT(*) as cnt FROM comments WHERE nid = $nid AND
                        (comment LIKE '%hitler%' OR comment LIKE '%nazi%')")
            count=$(echo ${count/cnt/})
            if [[ $count -eq 0 ]]; then
                count=$(mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
                    -e "SELECT COUNT(*) AS cnt FROM comments WHERE nid = $nid")
                count=$(echo ${count/cnt/})
                if [[ $count -gt 100 ]]; then
                    printf "%d\t%d\n" $count $nid
                fi
            fi
        fi
    done | sort --numeric --reverse |
        while read count nid
        do
            t=$(mysql -u $MYSQL_USERNAME -p$MYSQL_PASSWORD drupal_lj \
                -e "select title from node where nid = $nid")
            t=$(echo ${t/title/})
            printf "<tr><td>%d</td><td><a href=\"/node/%d\">%s</a></td></tr>\n" $count $nid "$t"
        done
echo "</tbody>"
echo "</table>"


Here's the output:

# CommentsArticle Title
423Why Python?
244Getting a Windows Refund in California Small Claims Court
222Perceptions of the Linux OS Among Undergraduate System Administrators
192GNU/Linux DVD Player Review
160The Toshiba Standoff
153What Application Do You Want Ported to Linux?
127SCO to Reveal Allegedly Copied Code
127Linux from Kindergarten to High School
124Red Hat 7.3 beta: A Product Review
108Gentoo for All the Unusual Reasons
105Boot with GRUB
101The Great Software Schism


Can we conclude anything about the validity of Godwin's Law from this? Ahhh, I dunno.

p.s. File this under blather #2.

__________________________

Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous's picture

It's a counter-meme. The purpose is to invalidate itself.

On January 14th, 2008 Anonymous (not verified) says:

The point of Godwin's law is to be a counter-meme:

http://www.wired.com/wired/archive/2.10/godwin.if.html

"In time, discussions in the seeded newsgroups and discussions seemed to show a lower incidence of the Nazi-comparison meme."

Seppo's picture

godwin's law

On January 6th, 2008 Seppo (not verified) says:

Perhaps an additional refinement would be to look for some kind of time related association - like if the h & n stuff is increasing or lessening with time, or something... you can probably find several more similar ways of studying this... ;)

here in Europe one might try for a EU grant for studying this in depth... ;)

Best
Seppo

Anonymous's picture

Wow, this Godwin is one

On January 3rd, 2008 Anonymous (not verified) says:

Wow, this Godwin is one messed up dude.

Some professor at Standford came out with a more pertinent observation about 10 years ago, saying as time goes on it's inevitable there will be a nuclear war. I'm sure there are an infinite number of pithy observations that can be made when you take something and apply infinity to it. They all seem profound. They all need a bit of common sense to override the insanity behind them.

Maybe they should require all high school students to take enough logic and math to understand "laws" before being allowed to graduate. If nothing else if we inundate them with a few hundred of these mental puzzles they won't be so susceptible to them when they encounter them in real life. Ahh, who am I kidding. We'd have to teach them how to read, locate the USA, and teach them a little history first and you know that's never going to happen.

Anonymous's picture

That's not Godwin's Law

On January 3rd, 2008 Anonymous (not verified) says:

That's not Godwin's Law, as I understand it. Godwin's Law states that in any given discussion, whoever is the first to make a comparison to Hitler or the Nazis loses the argument, by definition.

Jeff Eaton's picture

Not quite.

On January 3rd, 2008 Jeff Eaton (not verified) says:

"As an online discussion grows longer, the probability of a comparison involving Nazis or Hitler approaches one." That's Godwin's Law, and it was formulated as a tongue in cheek way of *reducing* Nazi comparisons in usenet board threads -- by making light of an increasingly common rhetorical hot-button.

It's definitely an amusing experiment. Maybe we can find someone who runs an active political site to conduct the same test on their data. RedState? DailyKos?

JLF's picture

Post length Distribution

On January 3rd, 2008 JLF (not verified) says:

Could you provide us the full length distribution ?

Then we can normalize the "Godwin" comments distribution and figure out if the normalized frequency increases with the length.

See, I love the effort you put into this. Really, I do. The part that ticks me off, however, is that it's taking all the effort I can muster not to comment about hitler and nazis on every article on the website. Or any website for that matter.

Now my Saturday is shot.

__________________________

Shawn Powers is an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter

Mitch Frazier's picture

Resist the temptation

On December 1st, 2007 Mitch Frazier says:

I almost titled the second table "These Articles Need Help", but I resisted the urge. I find that push-ups help.

__________________________

Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.

Taran's picture

Hah!

On January 2nd, 2008 Taran (not verified) says:

And here I thought Hitler was going out of style. Fun post, Mitch. :-)

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.


Read this issue