%$#@ This: Combing through 183 million git commits to find out when and how developers use the f-word
Tags: bigquery, github, datascience, git
Published: 2017-04-07 15:58:16

---
title: "%$#@ This: Combing through 183 million git commits to find out when and how developers use the f-word"
published: true
description: "Spoiler: PHP and CSS were among the language most associated with the f-word."
cover_image: 
tags: bigquery, github, data-science, git
---

Programming can be frustrating. Endless debugging, cryptic error messages, poor documentation—there's a lot of things that will make you collapse into tears, or stomp your feet, or pull out your hair...

...or say, "Fuck!"

When and why do programmer drop the F-bomb, though? Thanks to the [public GitHub dataset on BigQuery](https://cloud.google.com/bigquery/public-data/github), which includes hundreds of millions of commits and their corresponding messages, we can try to answer that question. The majority of commit messages are bland or useless, [as Ramiro Gomez demonstrated with his analysis of the same dataset last year](http://ramiro.org/blog/most-frequent-github-commit-messages/). But occasionally programmers take the opportunity to express themselves when recording their changes, and sometimes they use profanity for emphasis.

**Of the 183 million commit messages in the dataset, about 33,000 contain some version of the word "fuck,"** or about one every five or six thousand commit messages (fewer than the 48,000 Sergey Abakumoff found in [his F-bomb analysis](https://medium.com/@sAbakumoff/157-million-github-commits-48-thousand-f-bombs-a84cb9fab680) when also including git subject lines). More interesting than pure totals are what exactly the programmer thinks is worth cursing about in the first place. This SQL query selects the word directly following the F-word in the commit message:

```SQL
SELECT next_word, count(next_word) as n FROM (
  SELECT commit, LOWER(REGEXP_EXTRACT(FIRST(message),r'(?:\w*fuck\S*\s)(\w+)')) AS next_word
  FROM [bigquery-public-data:github_repos.commits]
  WHERE
  REGEXP_MATCH(message, r'\w*fuck\S*\s\w+')
  GROUP BY
  commit)
GROUP BY next_word
ORDER BY n DESC
LIMIT 100;
```
The resulting table can be downloaded and visualized without too much trouble:
![](https://thepracticaldev.s3.amazonaws.com/i/twjgek1b186ncj5cxclk.png)

Citing actual commit messages from the dataset makes reviewing these results a little more fun, so examples will be included in parentheses. 

###"up" on Top
The runaway winner is "up," which you might use when taking blame (_i fucked up something by moving ui.js to lib/_), doling it out to colleagues (_fixed fuck up by peter_), family members (_Fixed the fuck up by dad_), or even insentient beings (_The bot now doesn't fuck up the silent\_review greeting_)

###Complete the Phrase
Also popular were general words to complete phrases of exasperation like "it" (_fuck it we are going to use a subprocess_), "this" (_fuck this, the statemanager is way too complicated in an async environment, getting rid of it_), "that" (_csv parser? fuck that: regex_), and "off" (_fuck off firefox noone likes you_).

###Foul Language(s)
The very process of Git came up regularly via terms like "commit," "merge," "git," and "github." Certain languages often drew users' ire, like "php" (_fuck this fucking php shit: convert bools into integers because fuck you thats why_) "c++" (_initialiser_list can be coerced to primitive types? what the fuck c++, what the actual, legitimate fuck_) and "css" (_fucking css modified_).

And so did widely used services like "heroku"(_fuck heroku port_) and "travis"(_fucking travis tests are failing, works like a charm locally, fuck this_).

###Redemption
Of course, we shouldn't dwell on only the negative. Users celebrated successes with "yes" (_fuck yes, finally figured out how to do the configuration stuff_) and "yeah" (_fuck yeah centered login/register correctly_), as well as "fix" (_Finally fucking fixed bootstrap carousel bug, was caused by smooth scrolling JS code_) and "works" (_it fucking works. Inefficient as santa on drugs but it works_).

In that sense, our results accurately portray the programming experience: plenty of frustration, but also some worthwhile victories if you stick to it.