Sunday, December 8, 2013

Tips for newcomers!

I composed a journal entry for the GNOME Journal sometime in June of 2011 but since the journal seems unrevivably dead, I thought, it's a good idea to share it on my blog.

Now that FOSS Outreach Program for Women internships is at it's verge of its action, what better time would it have been for this post to come.

Here it goes:

Becoming A New Contributor (Lessons from Empathy)

GNOME+Ubuntu was the first desktop and OS combo I ever used since installing the first linux distribution on my computer. GNOME made my transition from Windows very simple. As I explored more of it, I started to love the flexibility Linux provides and decided never to go back to the world of Windows which had always been hard on pocket. GNOME was my catalyst for this change!
Contributing to an Open Source project is more of a passion to learn and grow in an environment where all doors to knowledge are inherently open, rather than a compulsary chore that you are bound to complete in a set time duration. A community where everyone is willing to share his/her knowledge with you, without expecting anything in return, becomes an abundant, friendly sea which you are free to explore and collect the best of the pearls from, as you get to implement the aggregated knowledge mixed with your own skills and creative ideas and receive appreciation for every little effort of yours! The GNOME community is one such community I have witnessed :)

Getting started is the hardest part in any new endeavour. For a developer, the understanding of the development environment, having sound grasp of the developer tools and understanding the underlying APIs is what will lay the foundation for your contributions. The best way to learn them in fun manner is to exercise with them and to explore them as their need arises! GNOME's outreach program for Women and Google's Summer of Code are excellent programmes with which you can get in touch with experienced mentors who will help you overcome all sorts of fears of working on large projects with lines of code in some tens of thousands, and will be having a to-the-point answer to most of your queries. Also you'll simultaneously achieve a decent amount of stipend for your hard-work in return!
GNOME contribution becomes very easy for a FOSS enthusiast who uses it and takes it in high regard. You can contribute in many ways irrespective of you having a technical background. Contributions to GNOME can come in any of the designing, developing, documentating or marketing forms. I chose development simply as this was the most intutive way for me. I used to be just a daily user once. Slowly, I began reporting bugs as I experienced them and placing my desired feature for improvisation of applications I used and cared about. I also remember acting as a bugsquadder for a while.. And one fine day (which barely marked five months of first installing linux on my machine), I builded Empathy from source (thanks to Danielle and jhbuild :). It was tough for the first time and I started to code and debug using the Eclipse CDT IDE instead of using the in-built development environment Linux offers; I wish I had worked with "Beginning Linux Programming" by Niel Mathew and Richard Stones[1] or something similar beforehand! This book will prove an excellent reference if you are new at developing in Linux environment and want to boost up your development time through the fast and efficient tools your Linux distro has in store for you. After going through this, you will know how to be sure that your code is lint free and contains no memory leaks. My first developer contributions began with introducing improvements to my favorite application in GNOME- Empathy[2] which is mostly written in C programming language.

The foremost thing to begin is understanding the Git version controlling system[3] (GNOME uses that as do many worthy projects which you admire and use including the Linux kernel) which would be easy for anyone who had used any version controlling system in past (was not the case with me though). Next comes the APIs which the GNOME applications use. Most ubiquitous ones being, the GTK+ user interface API [4] and the core, GLib[5] and GObject[6] APIs. The An excellent mention over here would be the Andrew Krause's "Foundations of GTK+ development"[7]. For working on Empathy particularly, one has to understand the Telepathy specifications[8] aided with the Telepathy Developer's manual[9]. Yes they are huge but the approach should never be to understand all at once (I still keep unrolling them as need arises and when I feel like contributing more :).

People get to learn a lot with examples and I acknowledge the wealthiness of apt illustrations in almost all the important APIs you would need getting started ensuring a steep learning curve. To aid this, I also used to look up alternative full working examples for instance one might seek Tim-Philipp Müller's tutorial on GTK+ 2.0 TreeView[10] (you are right, I didn't came across the "Foundations of FTK+ development" till then).

The phase when I got involved in GNOME as a developer was a rocky one. GNOME was transitioning from version 2.32 to 3.0 and so were the many underlying core APIs. GTK 2.0 to 3.0 transition infused a series of API and ABI breaks rendering all applications built on top of it unbuildable and the developers were usually found adapting to the changes for most of the time. Albeit this, my starting was a lot eased with GNOME's Outreach Program for Women Internships 2010 and the supporting hand of an experienced Empathy and Telepathy developer, Danielle Madeley, who was my mentor. She was there to help me out whenever I got stuck and she is always ready to help even now! See how good and welcoming people of this community are! (One of the reasons I love GNOME so much! :)

Empathy is a multi-protocol messaging client which offers one-to-one and multi-user text chats and one-to-one voice and video calls over supporting protocols. At the first view of Empathy's code, nothing seemed familier to me except the C language constructs. I was clueless about how the pieces were put together. The overall design was utterly uncomprehendable with over 96k lines of code increasing at a tremendous rate. Now with huge applications like this, getting to know the entire application is not possible in a short duration if one has to be immediately productive so I decided to maintain my focus on multi-user chat features and bugs for the internship duration. Having sound knowledge of object oriented systems helps and with a little understanding of GObject one can begin to relate things, associate them and see how data flows among modules. Due to its object-oriented design, Empathy has all the advantages of any modular piece of work just like any other project based on GTK. Each file is a single class having certain set of private encapsulated data it works upon, and only a required subset of the data is accessible to other "classes" by means of public getter and setter "methods" while abstracting other data. Classes inherit other GObject classes and implement GObject interfaces. C immitating C++ ! Sounds cool, doesn't it? I was immediately a fan of GObject and its umbrella- generic C library, GLib, which besides Empathy is used by many other GNOME applications.

Owing to the fact that Empathy makes use of a lot of open source projects and libraries, one might wonder how can anyone actually begin to work without spending days of learning on it. The answer to it is Devhelp[11], a GTK+/GNOME browser for API documentation. It works natively with a library's gtk-doc generated documentation. It has this extremely useful search tool using which you can find the exact class/constant/function/signal you are looking for, almost instantly, for say, implementing some new feature. One easy way to keep devhelp updated with the latest documentation is to build the latest versions of libraries with "--enable-gtk-doc" option before installing and modifying the XDG_DATA_DIRS environment variable to include the "library_install_prefix/share" path before launching devhelp. Another useful tool is Git's grep tool using which you can locate the exact line of code you want to be at in a snap! So no more getting lost in the maze-like repository! Debugging and tracking sessions make one learn a lot! Among others, for debugging solely I got to experience new and useful tools like D-Feet[12], the D-Bus debugging tool to check values returned by methods on system/session buses and Wireshark[13] to monitor packets sent to and received from a network. Knowledge of these makes a prolific developer.

The work I completed under internship spanned a wide range of bugs the details of which have nicely been listed in my blog-posts[14] between December 2010 and March 2011. You can also track them from the slides of my talk titled "Contributions made by a newbie to the free desktop's Empathy" at GNOME.Asia Summit 2011[15]. All of my work branches have been merged upstream now and you'll be able to enjoy them in Empathy 3.2 :) Do let me know if you like and appreciate them. It keeps me motivated to contribute even more and gives me the satisfaction of impacting a large audience- the rare feeling which GNOME contributions can bring to someone!

Being a part of the GNOME community allows you to be with highly motivated people and think like them. If you are still wondering, or if there is still something stopping you from contributing, just know for once, that being here requires you to be ambitious and if you are here, you'll see yourself as a worthier person who is learning something new each day!

GNOME is lovable. GNOME reciprocates if you love it. Hope to see you soon; happy contributing!




LINKS
[1] http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764544977.html
[2] http://live.gnome.org/Empathy
[3] http://git-scm.com
[4] http://developer.gnome.org/platform-overview/stable/gtk
[5] http://developer.gnome.org/glib/stable/
[6] http://developer.gnome.org/gobject/stable/
[7] http://www.gtkbook.com/home.php
[8] http://telepathy.freedesktop.org/spec/
[9] http://telepathy.freedesktop.org/doc/book/
[10] http://scentric.net/tutorial/treeview-tutorial.html
[11] https://live.gnome.org/devhelp
[12] https://live.gnome.org/DFeet/
[13] http://www.wireshark.org/
[14] http://chandniverma.blogspot.com/
[15] https://live.gnome.org/GnomeAsia/2011Summit/Slides

Featured Post

interviewBit Medium: Palindrome Partitioning II

Problem Name:  Palindrome Partitioning II Problem Description : https://www.interviewbit.com/problems/palindrome-partitioning-ii/ Problem Ap...