9 min read

The Very First Story of ggbash

A Star Which Changed the World

For this entire week, I worked on my project called ggbash. It is a library for drawing graphs or figures in R language in a much simpler way.

I first tweeted about the library last week (Dec. 29th) on my private twitter account. All followers are my friends or acquaintances, and it would be a good review of what I did and would like to do in the project.

After posting a few tweets, I found out that the ggbash project on Github earned a star before I knew it. Did I press the button by mistake? If not, who pressed the button? Who gave a star for software that she cannot execute on her machine? At that time there was a README for the library features but no document about installation.

It turned out that the star was from my friend, Spinute. He was an internship student of Google Summer of Code 2016 – in which he implemented an optimized version of Ruby data structures called Rope. He has a keen interest in language designs, and we are friends for a long time.

He is very friendly with me, friendly enough to frankly criticize my previous projects without jeopardizing our friendship (I like it). Actually, he criticized all of my past projects.

Looking back the past, I usually worked on “too-personal” projects, in which anyone in the world cannot find value: a brand-new typing software where users can learn any arbitrary keyboard layout (too general goals), a variant of Go board-game with a few eccentric additional rules (which few test players regarded fun), or a translated document website of super minor network software. His comments were fair. I enjoyed programming them, but they did not help others. I usually felt that if I could convince him my project is great, that means something substantial for me as a programmer. Looking back the past, I usually worked on “too-personal” projects, in which anyone in the world cannot find value: a brand-new typing software where users can learn any arbitrary keyboard layout (too general goals), a variant of Go board-game with a few eccentric additional rules (which few test players regarded fun), or a translated document website of super minor network software. His comments were fair. I enjoyed programming them, but simply saying they did not help others. I usually felt that if I could convince him my project is great, that means something substantial for me as a programmer.

And he now gave me a GitHub star for such an early-stage product. It was a real bolt from the blue.

One more strange thing was that ggbash is a library for R, which is a language he (probably) never used before. I became curious about his action and asked him why he gave me a star for a library which he would probably never use later in his life.

His answer was to his eyes ggbash is alike to pry project. pry is an enhanced version of Ruby interpreter (irb) and has highly sophisticated features for making Ruby programming more comfortable. Now, pry has earned more than 4,500 github stars. He told me that ggbash looked interesting from a design perspective, especially regarding namespace handling and states for queries, and that was the reason of his star.

I was surprised by that answer because in the past project, however hard I tried convincing him to play my games, he plainly said that he didn’t think the games are entertaining. Now, he voluntarily said my project is interesting. I felt like I finally got over a long-standing barrier in front of me, and thought I should take this ggbash project a little more seriously.

Stars from Unseen Developers

So, one of the non-R programmers considered ggbash is interesting. How about actual R programmers? What kind of impression will they have for ggbash?

I opened my public account and tweeted about ggbash with #rstats hashtag, which is a recommended way to tell R users a new package arrival.

It cannot be too emphasized that this project is just one-week-old and it does not take more than 2 minutes for any users to find a show-stopper. However, surprisingly enough it already earned 16 GitHub stars in a day. Although three of the stars are “questionable” stars from my friends (they might be from their kindness), I didn’t know any of the other 13 programmers. They just seemed to press the button seeing something on the ggbash repository. And this is the first time that I won a form of approval for my project from other unseen programmers.

This might be a small thing for famous, talented programmers who can earn 500 stars regularly, but for me, this is the first time that the problem I tried to solve is matched with the problem that other programmers also want to solve. It is a revolutionary match in my life.

Looking Back: Backgrounds of Epiphany

This is perhaps my first (small) success in open-source development, and here I would like to organize my understanding on what led me to this meaningful match.

I recognized four factors as essential:

  1. Experience: wrote an original shell before
  2. Unpleasantness: spent tens of hours of plotting graphs in R language
  3. Direction: keep the prerequisite of problems to solve in mind
  4. Long holidays: so long that you can start anything if it came up

1. Experience for a Specific Type of Software

I wrote a simple shell program in C as my homework in the previous semester. The shell has nothing new in its functionalities, but writing it gave me feelings that writing shell is not so hard and have a lot of room to improve. At the time I never thought of the possibility of shells in R. I just felt that shell is one of the options that I would implement someday somewhere if I feel like.

One thing to note here is that although I took a class of formal language theory when I was an undergrad, that experience didn’t directly contribute to the idea of a shell for R. It is true that the framework I learnt in the class was super helpful when I refactored my shell (ggbash v0.1) by lex and yacc (ggbash v0.2) following my friend’s advice, but for some reason I feel the cursory a-few-hour knowledge about shell was more helpful for the very first idea.

2. Repetitive Unpleasantness in Daily Tasks

The past four months I spent plotting hundreds or even thousands of R graphs by ggplot2. Gradually I remembered most of ggplot2 grammars and tried to find faster ways to do the same thing such as skipping x= and y= argument names by positional information or defining a shorter version of functions like p <- geom_point. But the latter approach significantly contaminates global namespace and ends up name conflicts (like p by geom_point and geom_polygon). The other approaches I tried is to make a big wrapper function for repetitive plottings, but that was too inflexible, and I had to care a lot about how R processes plots internally. Simply put, I have an annoying problem to solve as a programmer in front of me.

3. Directions from an Expert

During the previous semester, I had a lucky opportunity to attend a lecture meeting of a famous R package developer, Hadley Wickham. Before that lecture, I vaguely thought that I could use my coming holidays for writing my first R package, but I had no idea what is a good package to write. So I just asked him that how he discovered the ideas of each package he previously wrote. He is well known as a prolific R package writer, and most of his packages are widely used as de facto standard packages in R workflow. The success rate of his packages is remarkable – I conjectured that there is some secret “sauce” for making a great package.

But the advice he gave me was a very simple one. He advised solving a “real” problem. He recommended a conversation with other R programmers, in which I would find some constantly-appearing issues in the current R toolsets.

Unfortunately, I haven’t had an opportunity to talk with other R programmers about what are their issues. But since I did two data analysis project in the past four months and accumulated enough frustrations about the current R toolsets, I managed to find a right problem to solve. 20 GitHub stars would probably be a small sign for its rightness.

4. Long holidays

I was amazed that holidays in America are such long. That is in stark contrast to the hectic schedule during semesters, and I have tons of time to do what I feel like doing.

I just spent my first several days for just relaxing or simply enjoying doing nothing. Looking back that turned out to be productively unproductive, I could say. The day I had an epiphany about the ggbash project was December 28th, 2016, 11 pm at my home. That day I visited a museum called MoMA with my friends, strolled around all floors by more than 15,000 steps, had a good Cuban dinner, chatted about how each other spent holidays. I remember that day involves no programming stuff. I just wondered in a totally free way.

Actually, in the previous day, I plotted a lot of GIS data using ggplot2 and felt as usual unsatisfied with my makeshift wrapper/shortcut functions. Unfortunately, the result of the exploratory data analysis was also fruitless. So I recognized that the previous day was a bad day. It is a surprise that a revolutionary day follows such a lousy day.

What mattered?

So the timeline of ggbash advent was, hectic school days involving shell programming and data visualization, advice from an expert, unusually long holidays, a bad programming day, and a no-programming day. Then the moment. I believe the reason that I, a developer who couldn’t find the right software problem to solve, succeeded to find a good problem to solve is I went through a great combination of them in a very miraculous order.

In addition to the order, the contents were also important. The shell programming had nothing to do with R programming (because it’s a class of C language), but ended up in contributing something for R community. I feel like I’m borrowing some ideas in other languages and remake them for R.

Conclusion

ggbash is hosted on http://github.com/caprice-j/ggbash and is still its infancy.