Category: Tools

gooLego: Google’s software building blocks

Google Inc.
Image via Wikipedia

Over the past few years, Google has open sourced several projects that provide some commonly used building blocks in any large software project. Some of them I was aware of since when they were launched (like protobufs), while others I discovered only recently. I couldn’t find any location where all the projects were listed together and combing through Google Code looking for them was painful, so I’m putting together a list myself. Hope some of you find it useful.

  • protobufs: Platform agnostic messages. Critical for any distributed system. Note that protobufs only provide message serialization/deserialization (for various languages). An important missing piece is an RPC framework built on top of them. There are several projects attempting to build one using protobufs, but none of them are robust or mature enough for production use.
  • style guide: The importance of a style guide is probably understated. It is not about what is the “right” style — it is about consistency. While people may have different opinions, if everyone follows the same style, the code becomes much more readable and maintainable. Google maintains style guides for C++ and Python.
  • config flags: Another important building block for all command line programs.
  • logging: Self-evident. Google’s logging library supports various log levels and other useful macros.
  • core dumper: A very nifty library — it allows you to dump core from within a running application. Extremely useful for debugging production systems.
  • perftools: An extremely useful library for measuring and monitoring performance of programs. By simply linking against perftools, your application gets a much better malloc, heap checking, visual CPU profile of various routines (via graphviz), visualization of memory usage etc.
  • googlemock: A framework to quickly build mock objects — useful for testing.
  • googletest: Google’s C++ unit testing framework, built on top of xUnit. Integrates well with googlemock.

Of course, this is not an exhaustive list. There are numerous other open source projects from Google, some of them probably much more bigger and visible than the ones listed above — such as Wave, Go, GWT etc. If there’s a project that is a software building block that I missed out, do chime in the comments below.

Enhanced by Zemanta

Reconsidering Vim

NOTE: This post is not about the editor war — so please don’t try to start one either.

First, some background. Lets just say that I lost my editor virginity to Vim. It was a brief, but violent introduction — the modal editing was too unfamiliar, the learning curve too steep. After dabbling with a few other conventional editors (such as KWrite), I settled upon Emacs (XEmacs actually, but thats another story).

For the next three years, I tweaked my .emacs file, fiddled around with settings and plugins and modes, played games and browsed the web, checked my email and newsgroups, all within the comfortable confines of Emacs. But I was getting wary of the long startup times and (at that time) the inability to use the same interface and features in console mode (such as over SSH) as in GUI mode. It was time to move on.

I rediscovered Vim around 6 years ago. I started with a clean slate. As the saying goes, Emacs is an operating system that also happens to have an editor in it. The relatively more focused feature set of Vim was refreshing in comparison. I loved that I could work in GUI mode, save my session, go back home and resume my session in a terminal over SSH, which the exact same interface and keybindings. I quickly became very productive with Vim, and over the years have honed my plugins, settings and color themes to just how I like them.

But recently, I’ve been thinking about this again, and I might just reconsider Vim. I highly recommend reading these two blog posts to better understand where I’m coming from:

Don’t get me wrong — I think Vim still has a lot to offer. But, I can not deny that Vim is not what I would call a “forward looking editor.” Here’s why:

  • Development community: the Emacs development community is a lot more open and vibrant right now than the Vim community. Part of this has to do with the BDFL model in Vim. Bram Moolenar has done a tremendous job in bringing Vim to the stage where it is. People can and have forked Vim in the past. But for one reason or another, Vim has stayed Vim, and its development trajectory has been slow and incremental.
  • Source code: Vim’s source code is not clean. At all. I just briefly skimmed over the source tree for Emacs 23, and it looks a lot more understandable and well structured.
  • Architecture: Vim 7 finally got spell check. But the spell check does not use any of the existing tools or formats. Vim has its own scripting language, with its own interpreter, grammer and data structures. Why not just use one of the many wonderful programming languages out there? Yes, there are interfaces to allow writing Vim code in Python, Ruby, Perl etc. But why reinvent the wheel all over again?

When Bram Moolenaar — the lead developer of Vim –  joined Google, I had hoped that Vim would generate a lot more interest and enthusiasm. But so far, it hasn’t changed much.

And so, in the next few weeks, I’m going to take another look at Vim as well as Emacs. I’ll try to do an objective evaluation of where the editors stand today, where I perceive they are headed. I hope to make my decision on whether to move away from Vim or not by the end of this year.

Reblog this post [with Zemanta]

Vim and the future of editors

As is evident from the image below, something about my last post clearly struck a chord with a lot of people.

Traffic spike
Traffic spike

I don’t know if it was “vim” or it was “sexy”, but somehow this post landed up on Reddit. This is the closest I’ve come to being slashdotted — for that one day, Reddit drove nearly 95% of the traffic to my site. Also, before you start jumping to conclusions from the graph above, let me put some numbers out there. On average, my site gets anywhere between 200 to 400 visitors daily. On April 18th, my site got 7000+ visitors, an order of magnitude more than I normally get. That is the spike you see, and now the traffic is back to normal, thank you very much.

Since a lot of people seem to be interested in Vim hopefully, I want to discuss the space of text editors (in particular, editors for programming) and where I think we are headed.

The first observation is that both of the giants on the editing world — Vim and Emacs — are ancient by any standards. Depending o how you look at it, I think it is fair to say that neither editor has evolved significantly in terms of the underlying code, architecture and usage model in the past two decades, if not more.

The second observation is that despite the large number of editors out there, IMHO few have any significant mind and market share other than Vim and Emacs. Obviously there is Eclipse, Visual Studio, IntelliJ etc.

And so I wonder, what would the text editor landscape look 5-10 years down the line? There are many who would say if it ain’t broke, don’t fix it. However, I’m a big believer in change, and I think over time, change is inevitable. However, at this point I don’t know what, if any, substantial change is happening in the text-editor arena. No new editors with fundamentally new ways of manipulating text or amazingly compelling features are emerging. I actually don’t mind reinventions of the wheel either, as long as the reinvention delivers a much better wheel. For instance, the Vim source code is not the most modular, extensible or maintainable. And it is in C — not that there is anything wrong with it, but I think an object oriented language is better for a complex piece of software like Vim.

The only recent buzz has been about Textmate and the many clones it has since inspired. I’m really looking forward to Yzis reach a usable milestone. What are other promising editors out there that you are excited about?

Vim is still sexy!

NOTE: This post is not about the editor war — so please don’t try to start one either.

I use vim as my editor of choice. As I note above, to each his own editor.

However, Vim is not what one would call a “sexy editor”. After all, it has been around (in some shape or form) since before I was born. It does not generate as much buzz in the blogosphere and is not the darling of all the new kids on the block, as some of the other editors out there. Not many Ruby on Rails developers, for instance, seem to be using Vim for coding (actually, saying that a lot of RoR developers seem to be using Textmate is probably more accurate, but you get the point). It is written in C and does not use git for hosting. The Vim website leaves much to be desired. In the social networking world, Vim barely has a presence.

Vim attitude

But, I contend that Vim still has a lot to offer. Here are few of the things you can check out to spruce up your Vim usage:

I’m also very happy to see the number of Vim related repositories on github. Bottomline: don’t give up on Vim. Vim is still sexy baby, you just need to look in the right places :)

Update: I’m including a screenshot of Xoria below.

xoria, GUI, C

Web services I wouldn’t mind paying for

Here are some web service I wouldn’t mind paying for, simply because of the value they add to my day-to-day life. Note that some of them already have paid plans, it is just that I haven’t reached a stage where I actually need to upgrade. All I’m saying is that these websites have enough real value add for me to be worth for real money.

Having all my financial data pulled in a single place is fantastic. Previously, I used to have to go and log into 5 different websites to check on all my bank accounts and credit cards. Add to that the ability to examine spending trends, watch your investment grow (or crash, as is the case with the current economy) over time, alerts for fee, low balance and over-budgets etc, and you’ve got a killer service in your hands. Of course, Mint is not without its problems, but the benefits far outweigh the snags.


Passpack has been a real time saver for me. I have written about web based password managers before, and so far Passpack has been just fantastic! I just wish they would bring back search-as-you-type…


I’m a big believer in using the right tools you help you work smarter. RTM is a great way to offload your todo list from your brain. It has all the key elements of a good web service good — a great UI, keyboard shortcuts, the ability to email tasks, integration with services like IMified, a nice API (so you can use desktop apps such as Gnome DO or Quicksilver to interact with RTM without ever leaving your desktop).