Saturday, July 23, 2016

You don't know Javascript (Scope and Closure)

Javascript is one of the 3 main core technologies in world wide web. Since it's origin 2 decades back, it has evolved a lot and as per today, it is the trendiest programming language on earth.

Since 2009 I have used javascript to do web development and until recently I used it with basic dom manipulations with jquery, simple UI logic with vanilla JS and with some frameworks as AnuglarJS. The basic knowledge I had about JS was sufficient enough to get above things done. But recently when I started doing some serious development with React and GraphQL, I realized that my knowledge on JS is pretty primitive and I'm not really applying any core JS concepts or patterns in my code. At the same time, while I was listing to a podcast in Software Engineering Daily I found Kyle Simpson was explaining about series of his books called "You Don't know Javascript". With that, I got the interest in reading the book to sharpen my saw in JS. It's a pretty interesting book and it covers many basic concepts in JS. Following series of articles will cover what I learned in each of 
these books.


The scope is one of the core concepts in Javascript and it's a must to have a thorough understanding of the scope to write better JS code. Let's dig in further to scope.

What is scope?

The scope is set of well-defined rules on how to store and retrieve variables in a program. In one way or other, you are always dealing with these rules when writing and execute code in JS. 

In JS assignment for the scope can be performed in two ways.

1) by using = expression

a = 3;

2) or by passing an argument to a function parameter.

function foo(x) {


Lexical Scope

In JS, the scope is defined by Lexical Scope. Lexical Scope is defining the scope at author time based on where the functions are placed.

But there are two other ways to overwrite the lexical scope in JS. Those are JS core functions which will manipulate the scope at runtime. Those are,

1) eval() function
Eval function takes a string as an input and executes the content in the scope of the code execution.

2) with() function
Takes an object as the input and consider the object as a new separate lexical scope.

function foo(obj) {
foo({x:5}); // will print "5"

Cheating lexical scope makes the code performance intensive so better to avoid it.

Nested Scopes

In JS we can define different levels of scopes. The most outer scope is global scope and new scopes will be defined as nested scopes when we are creating functions or blocks.

var a = 5;

function foo(x) {
  var b = 10;
In above example "a" is in global scope and "b" is in a new function scope.

When Javascript engine finds a variable in an inner scope engine starts searching for it in the given scope and if it isn't there, it checks the variable in the immediate outer scope and likewise it traverse until it finds the variable and returns it. Once it reaches the most outer scope, it automatically stops traversing.

There is a really tricky part in how the fall back happens when the engine cannot find a defined variable in any given scope. If a variable is not found in any parent scope and if it's for an assignment purpose, then a new variable will be created in the global scope. You should be really careful on this.

var a = 5;

function foo(x) {
  b = 10;

When Javascript engine finds a variable in an inner scope engine starts searching for it in the given scope and if it isn't there, it checks the variable in the immediate outer scope and likewise it traverse until it finds the variable and returns it. Once it reaches the most outer scope, it automatically stops traversing.

Note: Global variables are automatically being part of the global object. In browser, it's the window object. So you can create global variables as "window.a". Using this technique you can access the variables in the global scope without getting affected from shadowing. Ex:

var a = 5;

function foo() {
  var a = 10;
  console.log(a); // will print "10"
  console.log(window.a); // will print "5"


This will print two lines as follows.


There is another interesting point demonstrated in the above example. It's shadowing.


Overriding the outer scope variables in inner scopes. Shadowing is commonly used in JS which allows developers to isolate variables within functions while using same variable names.

Since scope is really powerful as well as dangerous when misusing it, there are identified best practices to avoid surprises. All these best practices are targeting common objectives such as avoiding spoiling global scope, isolate variables in function scope as much as possible. Following are some of such best practices.

Isolate in objects

It's a best practice to create an object in the global namespace and define variables and functions as properties of the object. In this way, we will only define a limited number of variables in the global scope and all the other variables will be properties of carrier objects.

var myLibrary = {
  foo: function() {
    console.log('this is foo');
  x: 5
}; // will print "this is foo"

Module Managment

Most of the modern JS libraries wraps its variables in a module and expose via dependency management. When using these libraries in code, we have to import scope into another object scope which will prevent spoiling the global scope. 

Will be covered more under Closure section.

Functions as Scope

When we have named functions, it pollutes the global name space. That can be avoided with following technique by treating function as an expression rather than a declaration.

(function foo() {
    console.log('How are you');
})(); // will print "How are you"

Also you can pass a variable into the function as follows.

(function foo(x) {
})("Hi"); // will print "Hi"

In above code first () make the function an expression and second () execute the expression.

Anonymous vs Named functions

Function expression can be anonymous but function declaration cannot be anonymous. It's prefer to have named function which has less drawbacks than anonymous functions. 

Following are valid syntaxes because there the function is an expression.

var x = function(x) {

x('wow'); // will print "wow"

(function(x) {
)('wow'); // will print "wow"

Following syntax is invalid because the there we use a function declaration.

function(x) {

Blocks as Scope

Generally if we define a variable with var keyword it belongs to the scope beyond the block and applicable for the whole scope.

if (true) {
  var n = "How are you";

console.log(n); // will print "How are you"

In above code variable "n" will belong to global scope. That happens becuase of variable hoisting in JS engine.

Variable Hoisting

Variables and function declarations are move to the top of the scope block. In here subsequent function declarations will override the previous.

a = 2;
var a;
console.log(a) // will print 2

console.log(a); // will print undefined
a = 2;
var a;

But if you define a variable with "let" keyword, it'll only belong to the current block. Variable declarations with "let" keyword will not effect to variable hoisting.

if (true) {
  let m = "How are you";

console.log(m); // will give an error

You can create a constant variable using const keyword and it's scope will be limited to the current block.

if (true) {
  const m = "How are you";
  m = "Changed"; // will give an error



What is Closure?

Closure is when a function is able to remember and use it's lexical scope even when the function is executing outside of the lexical scope.

Closure is one of the least understood features  in JS, but it is one of the most powerful features in JS. 

function foo(a)
  function bar() {
  return bar;

var baz = foo(2);
baz() // will print 2

In above example, "bar" still has the reference to the scope of a function, and that reference is called closure.

Closure is heavily used in JS programming all over the programs. One of it's main application is there when developers create modules to isolate and expose variables and functions to outside.


Function return an object with references for internal functions. Those function will run outside the defined lexical scope and it's a good example for a closure.

function myModule(a, b) {
  function sum() {
    return a +b;

  function substract() {
    return a - b;

  return {
    sum: sum,
    substract: substract

var operations = myModule(2, 4);
operation.sum() // Will print 6

This is a great way to keep the global scope clean as well expose necessary components to outside while maintaining an internal state of the module.

Now we have come to the end of this article about Javascript Scope and Closure concepts. Hope you got some quick interesting points about them and if you need further readings it's highly recommend to read the series of  "You Don't know Javascript" books. I'll bring some more interesting points in my next article about Javascript Objects and Prototyping. 

Wednesday, July 13, 2016

Rethink your API with GraphQL

Rest is the underline architecture of Web and how the clients and servers communicate each other. Using Rest, clients and servers can communicate each other without a prior knowledge. Because of the power of Rest principles, over the time software architects have grabbed the core principles from it to implement APIs in applications. Following are some of the core principles in Restful APIs.

  1. It works over HTTP protocol which is stateless
  2. The architecture fully operates with the concept of individual Resources which are identified uniquely through URIs.
  3. Resources can be manipulated using basic HTTP verbs such as GET, PUT, PATCH...
Since Restful APIs fully focused on individual resources, there are several consequences you'll face other than all the advantages you are getting with Restful APIs.
  1. Since the resource manipulation is done through HTTP verbs, the ability to perform complex manipulations containing multiple different types of resources is not straightforward. There may be situations where clients needed to have multiple roundtrips to perform such an operation.
  2. In order to manipulate multiple related resources, clients will have to maintain the state between operations through headers or other way.
  3. Service discovery and client tooling will be difficult due to lack of a strong type system at back end.
  4. Since resource representation should be generic at the API and all the clients will share the same representation, there won't be any control on the amount of transfer data to clients(over fetching).
When it comes to mobile clients, the disadvantages such as multiple roundtrips, over fetching data will be really critical because those are used in low bandwidth environments.

When Facebook has started their mobile apps in 2012, initially they have decided to use a Restful API to communicate with backend services. With drastic development cycles, they have found that many versions of their mobile app are out there in use(one in each two weeks) which calls to the same backend service runs on Rest architecture. This has lead to serious issues on managing and maintaining their API to support different versions of the client apps. A set of engineers at facebook have started to find a new way of overcoming these problems and GraphQL has come out as a result of that effort.

What is GraphQL?

A data query language for client applications defines a flexible way to request and provide data requirements. It allows developers to define the data requirement as same as they think about the data.

Following are some of the main advantages in GraphQL over Restful APIs.

  1. Hierarchical: Most product development today involves the creation and manipulation of view hierarchies. To achieve congruence with the structure of these applications, a GraphQL query itself is a hierarchical set of fields. The query is shaped just like the data it returns. It is a natural way for product engineers to describe data requirements.
  2. Product-centric: GraphQL is unapologetically driven by the requirements of views and the front-end engineers that write them. We start with their way of thinking and requirements and build the language and runtime necessary to enable that.
  3. Client-specified queries: In GraphQL, the specification for queries are encoded in the client rather than the server. These queries are specified at field-level granularity. In the vast majority of applications written without GraphQL, the server determines the data returned in its various scripted endpoints. A GraphQL query, on the other hand, returns exactly what a client asks for and no more.
  4. Backwards Compatible: In a world of deployed native mobile applications with no forced upgrades, backwards compatibility is a challenge. Facebook, for example, releases apps on a two week fixed cycle and pledges to maintain those apps for at least two years. This means there are at a minimum 52 versions of our clients per platform querying our servers at any given time. Client-specified queries simplifies managing our backwards compatibility guarantees.
  5. Structured, Arbitrary Code: Query languages with field-level granularity have typically queried storage engines directly, such as SQL. GraphQL instead imposes a structure onto a server, and exposes fields that are backed by arbitrary code. This allows for both server-side flexibility and a uniform, powerful API across the entire surface area of an application.
  6. Application-Layer Protocol: GraphQL is an application-layer protocol and does not require a particular transport. It is a string that is parsed and interpreted by a server.
  7. Strongly-typed: GraphQL is strongly-typed. Given a query, tooling can ensure that the query is both syntactically correct and valid within the GraphQL type system before execution, i.e. at development time, and the server can make certain guarantees about the shape and nature of the response. This makes it easier to build high-quality client tools.
  8. Introspective: GraphQL is introspective. Clients and tools can query the type system using the GraphQL syntax itself. This is a powerful platform for building tools and client software, such as automatic parsing of incoming data into strongly-typed interfaces. It is especially useful in statically typed languages such as Swift, Objective-C and Java, as it obviates the need for repetitive and error-prone code to shuffle raw, untyped JSON into strongly-typed business objects.
Following video explains the syntax in GraphQL.

 GraphQL opens up and talk about very powerful stream of concepts which allows us to rethink about our API designs. Even though it won't replace Restful APIs in all the contexts, there is a high chance of immediately dominating how the backends get exposed to the mobile clients.

Following are some resources to learn more about GraphQL.

Monday, August 13, 2012

Managing Computer Vision Syndrome

Computer has became the most influential invention which was the seed for many other concurrent inventions. There are about 1 billion computer users all over the world. Most of them works with the computer as there profession. Out of them majority are suffering from serious eye issues which is called as computer vision syndrome.

There are many causes for this syndrome and most of them are there because of the carelessness of the computer users. Some of them are,

  1. Not taking rests for your eyes for a long time
  2. Not using proper lighting for the computer screen and background
  3. Not maintaining proper distances with the screen and the eyes.
With all these bad habits your eyesight is getting worst day by day. This will end up with serious damages to your eyes in the rest of your life. 

But you can overcome it by following simple techniques as a habit while using the computer. Those are  as follows.
  • Get a computer eye exam to check for dry eyes and vision

  • Use Proper lighting

  • Minimize glare

  • Brightness of the screen should be same as your work environment

  • Text size should be three times the smallest text size you can read from your normal viewing position

  • Make blinking more often a habit(otherwise your eyes get dry because of less blinking)

  • Relax your eyes
    • Every 20mins look at object far away(at least 20 feats away from at least 20 seconds)
    • Or close your eyes for 20 seconds

  • Take frequent breaks
    • Micro breaks: 20/20/20 rule
    • Mini breaks: 1-2 hourly for few minutes, stand up and stretch
    • Maxi breaks: This could be a coffee of a lunch break
Out of all these 20/20/20 rule is the most exiting rule which I have heard and which is mostly missing from computer users. 

What is 20/20/20 Rule?

    Every 20 minutes look at an object which is located 20 feats away for 20 seconds

This gives a huge rest to your eyes and allow your eye muscles to focus on distance objects which will preserve normal operations in an eyes. But most of the people don't get remind to do this when they are stuck with work.

You can find a simple reminder program for your machine and allow it to remind you for every 20mins to have a rest. After you get used to, it will be automatically done by you. 
For Ubuntu users I have written a small bash script which will remind you every 20mins to have a rest.  You can download it and follow the instructions in the Readme file. 

Start protecting your eyes which will never comeback after get damaged. 

Saturday, May 12, 2012

Improve Performance by Profiling Web Applications

Since web seems to be a trend these days most of the new comers try to make alive their fascinating business ideas through web applications. They use nice UI components for their application to make it attractive. Initially they don't worry about the performance of the application because they won't feel it makes a huge impact at this moment. Even though your application is not an optimized design, you won't see it for a small set of data. But it really matters while your application grows. If there are some non optimized plugins, classes or functions running in your application it may slow down your application when it handles large data sets.

At this point you may wonder how to deal with this. If your application has only couple of classes you will be able to go through the code and identify bottlenecks in your application. But what if it is a application with 100+ classes. You can't go through it manually. That's where "Profiling Tools" act as life savers of developers. 

Profiling tools debug the web application and keep the records of your application at run time. Then it interpret those records to visualize execution process of each code segment in module level, class level and function level.  Using these output developer can identify 
  • what is the hierarchy of classes/ functions running on this action
  • How may time each class/function get called by parents
  • what are the execution time of each segment.
Bases on this developer can see what are the classes/functions which took most of the execution time in your applications and identify performance bottlenecks of the application. To get a basic idea on profiling tools, I'll explain how to profile a PHP application with Xdebug and KCacheGrind.

Xdebug is a PHP extension which facilitate the developer to debug and profile web applications. While you running the application xdebug tack all the events running on the application(by tracking the server) and log it to a file. This file contains stack trace information, function trace information, memory allocation and many more useful information. We can visualize those data using a visualize tools.  

KCacheGrind is a data visualization tool which is used as a profiler frontend. We can use KCacheGrind to open the Xdebug output file and analyze its output in a meaningful manner. 

Following are the simple steps to install Xdebug and KCachegrind in Ubuntu to profile your application. 

Install Xdebug

Install it via pecl is easy and reliable. 
pecl install xdebug

Enable it by adding the following file path to php.ini or xdebug.ini file.(Use full path)

Then activate debugging by enabling following features in xdebug.ini file or php.ini file. 

Enable all requests to profiling
xdebug.profiler_enable = 1

In some occasions you may need to skip some requests and only profile selected requests. To enable only GET/POST requests or COOKIE with name XDEBUG_PROFILE you have to enable following property.
xdebug.profiler_enable_trigger = 1
Following properties are also important to make your life easy with xdebug. 

Append the output at each time when same request comes to the server. 

Name of output files
xdebug.profiler_output_name = cachegrind.out.%s

Name of the output directory (This directory should have write permissions).

Now you are done with configuration process. Restart the web server to apply your  changes. 
/etc/init.d/apache2 restart

Install KCacheGrind

Install it via the OS package manager. 
apt-get install kcachegrind

There are some alternatives to KCacheGrind. WebGrind is a web based tool which has subset of features of KCacheGrind. But KCacheGrind is rich in features so I recommend it. 

How to profile your application

Now you are armed with enough tools to profile your application. Now access your web application through the browser and run the necessary page which needs to be profile. After a success full page load, you can find the corresponding xdebug output file in /tmp/xdebug directory. Now you can open it using KCacheGrind to visualize the output. 

As an example run the following code on your browser to examine output. 

function innerLoop($limit) {
    for($count = 0; $count < $limit; $count++) {
        echo "*";
function outPut($rows) {
    for($count = 1; $count <= $rows; $count++) {
        echo "


Output of xdebug will be as follows.

Flat Profile will list all the events run in your application as follows. By default events are sorted in the order of time taken.

Following are the explanation on the values displayed in this table. 
  1. Incl - Total value that event took
  2. Self - Time spent only within that event
  3. Called - Number of times that event get called
  4. Function - Function name
  5. Location - File
And also KCacheGrind provide a execution graph which simplify above data. You can get that by selecting "Call Graph" tab  of each event. 

With these you can find the time each event spent on executing, the hierarchy of events and how many times each event get called by other. This is a nice interpretation which help developer to find issues is huge web systems. When we consider large systems which were build on frameworks as Zend or Symfony, there are number of utility functions running in the background. So the "Flat Profile" will be too complicated to get an quick decisions. Following screenshot is a part of the flat profile of an application which was built on top of Symfony. 

This is too complected and most of the events are related to framework. We can use "Call Graph" in similar situations to make our life easy.  Following is a part of the "Call Graph" of it. 

This nicely shows the execution path and you can get quick decisions based on this. 

Likewise there are more advance options in KCacheGrind which helps you to profile your application. Tryout those options and find most suitable options to profile your application which will lead to have a smart web application at the end of the day. 

Saturday, March 17, 2012

How to use Mysql Transactions with PHP

Web applications are more popular today than ever with the increasing number of internet users. Most of the standard alone applications converted as web based applications or at least they try to provide a web interface for users. PHP and Mysql are two leading technologies which allow uses on rapid development of web based systems. "Transaction" is a powerful concept which comes with Mysql 4.0 and above versions. Lets explore that.


Web based applications have different types of requirements and some of them prefer more consistency on its data than others. As an example Banking software expect its data to be more secure and consistency. Assume a situation where one person (Bob) is transferring some amount of money (XXX) to his friends bank account (Alice) directly form account to account. The queries for the banking software database on this transaction will be as follows.

  1. Deduct XXX amount form Bobs account.
  2. Add XXX amount for Alices account.
If both queries executed successfully, it will be great. But assume a situation where the first query executed successfully and then the database connection get lost. At that situation the second query will not run on top of that database, so nothing will add to the Alices account. The deducted amount form the Bobs account will also not get recovered. These will make a disaster for Bob, Alice and for the Bank.

"Transactions" can solve this problem with a great solution which will ensure the consistency of the database states. Simply with Transactions the database can be role back to the initial state where it was before the deduction query executed on the database. Its like this.

  1. Transaction Start
  2. Deduct XXX amount form Bobs account.
  3. Add XXX amount for Alices account.
  4. If both queries run successfully then commit the changes
  5. Otherwise role back to the initial state.
For these operations Mysql provide several commands with it and lets see how we can implement that with PHP.

For support Mysql transactions PHP 5.0 and above provides set of methods which are very similar to the normal mysql functions but with an additional "i" letter with them. The most important functions out of them are as follows.

  • mysqli_connect() - connect with mysql
  • mysqli_select_db() - select a database
  • mysqli_autocommit() - enable and disable the auto commit option
  • mysqli_query() - run the mysql query
  • mysqli_rollback() - role back the database to the initial status
  • mysqli_commit() - commit all the changes to the database
  • mysqli_close() - close the mysql connection
Lets look at how you implement a transaction as a solution for the above problem.

Since transaction only supports from InnoDB storage engine you have to make sure all the database table are with InnoDB engine in your database.

$host = 'localhost';
$user = 'username';
$password = 'password';
$db = 'transaction';

$con = mysqli_connect($host, $user, $password);
mysqli_select_db($con, $db);

//Cancel auto commit option in the database
mysqli_autocommit($con, FALSE);

//You can write your own query here
$query1 = "query for deduct XXX amount form Bobs account";
$results[] = mysqli_query($con, $query1);

//You can write your own query here
$query2 = "query for add XXX amount for Alices account";
$results[] = mysqli_query($con, $query2);
$sucess = true;

foreach( $results as $result) {
if(!$result) {
$sucess = false;

if(!$sucess) {
} else {

In above code the changes will done temporary because we have disabled the auto commit option in the database. After the two queries executed it will check for the results of those queries. If some thing went wrong with the database connection in the middle of the operations the changes will not be permanently applied to the database. And at the end it checks for the success of all queries and if all went fine it will commit the changes to the database.

With this code you will be able to make a consistent database operation for the money transfer action in your database. So your done with set of great consistent database operations on your database with PHP and Mysql.

Still Mysql allows only few operations such as update, insert and delete to be role back using its "Transactions". Following operations cannot be rolled back using Mysql.

You have to be aware on these limitations before you use "Transactions" for your application. Have a great time with Mysql "Transactions".

References :

Saturday, March 3, 2012

Select the Best Training Place

"Your work is the presentation of your capabilities". You need to find the correct job on correct time. There are several milestones which are considered as the hardest decisions you have to make ever in your carrier path. Those are
  • Choosing your first industrial training place
  • Choosing your first job
Out of those two, choosing your first job is also highly influenced by your industrial exposure you earned at training place. You have to make the correct decision on that, or else you'll suffer from the bad influences of your decision through the entire life. It's not an easy task to do that correctly. You have to spend days and days to take the right decision. In this post I try to point you some important facts which will help you to make the correct decision on choosing the best fit training place for you.

As an undergraduate student you may not have much experience on how your academics related with the industry. Industrial training is the first time you get a chance to go into the industry and feel the reality of the industry. But at this point if you have chosen the wrong place to taste it, you will definitely get lost. When you get the list of opportunities, please consider following factors before shortlisting them.
  • It should accordance with your future carrier.
  • Companies expectations and your expectations should be inline.
  • Nature of the company.
  • Ask your seniors about the company and the culture.
Even though these ideas seems so simple they are very powerful. Following are the explanations of those facts.
  • It should accordance with your future carrier - You need to have a clear idea on what technologies you are going to use in your future carrier. If you have a dream to be a Java programmer in the future, it will have more weight for your selection algorithm. If you need to be a Java programmer do not select something else, such as Web development or Mobile development. Even though all the technologies share some core concepts with them, each technology is using some unique concepts to decorate it. So by choosing the wrong option you will loose some interesting areas in your future plan. As an example if you choose php development for the training you may not need to define your variables at coding. So after couple of months you may loose the practice of defining variables which you gained by Java. It's a simple example and you can find many more crucial things with them.
  • Companies expectations and your expectations should be inline - You need to know what are the expectations the company has on you. If they hire you only because they have some extra works which need to finish early as well as they don't need to let you learn anything new with those works, it will not be the correct option for you. Some companies hire trainees because it is cost effective for them. They don't let trainees to learn new things. They ask trainees to do the internal bug fixings, QA and documentations which will never expose you the the industrial experience. I have seen some students who didn't even experienced on version control systems during their internship. So don't choose that kind of companies for the training. Always choose companies which have higher expectations on trainees as well as have a good vision to help the trainee to improve himself in technology as well as communication.
  • Nature of the company - If you need to learn everything withing a company, the best fit model is a small scale company. Small scale companies allow you to go through all the stages of a project as well as the marketing and sales strategies of those companies. So if you have an idea of having a start up in the future, you should select an small scale company to extract that knowledge. If you need to learn the big processes used withing large companies, you need to select a large scale company as your training place. But in most of the large companies you will not expose to the real business process they use. If you need to work on an opensource company you need to select such a company who work with opensource projects and products, or else you can choose a company which works with closed source projects and products.
  • Ask your seniors about the company and the culture - There is a set of people who always willing to help you. Those are your seniors. So please contact your seniors who are working on those companies. They will definitely tell you the truth about the company unless they are the owners of that company. It's better if your training place has a peaceful culture which don't have unnecessary restrictions and collisions. If you hate working at night for the whole year, you should definitely avoid such companies. Even though it is must to meet the deadlines we cannot do it for all 365 days. If you don't care about night shifts and your only vision is to get the maximum exposure during your training period you better choose a company which expects your hard working.
In all those points I never mentioned about the salary your get. The salary has the minimum weight when comparing with above factors. Your salary in the training periods say nothing about the quality of the training you get. So don't think about salary. Money is not everything and it's only a one thing.

When you face to your fist job interview, they will definitely ask you about the training place. So there should be something to say about your training experience. I cannot say this is the best fitting model for your internship. You have to match your expectations with those factors.

Think Think and Think. Make your decision which will decorate your bright future.

Friday, March 2, 2012

Enjoy your summer with GSOC

Since most of the students ask from me "How to get in to GSOC", I though to write down some important facts which will help you when applying for a GSOC project.

First of all if you need to get more detailed description on GSOC you can refer this set of slides which were prepared by Kathiravelu Pradeeban.

GSOC is full of competition. People who have more commitment on it successfully finish it. It's not a matter of your knowledge on technologies, capacity on academics or fluency on language. Its all about you commitment to that project. It's not just the money you get or the package you receive, it's about your enthusiasm towards the opensource world. So ready your backpack to join the memorable journey.

Selecting an Organization

When you are in the competition, selecting an organization for the project plays a major role in your success path. Most people lost their enthusiasm on the competing as soon as they realize the difficulty on selecting a proper organization. Don't be silly. There are few simple steps you can follow to get rid of this headache.

  • Find out what are the organizations which were acted as mentoring organizations in the last GSOC competition. Most of the organizations which were at the last competition will be repeatedly get selected to the next upcoming sessions. So rather than searching here and there, you can directly refer the last years GSOC web page for the information. You can find last years mentoring organizations in that list. Now you get an idea about what kind of organizations participate for this competition and what are the relevant technologies they use.
  • Now you can shortlist some of the organizations according to your awareness on those technologies. But it is not necessary to be an expert on those technologies. It's okay to select it even though you know nothing about mentioned technologies, you have few more weeks to get ready with that. In this page you can find how many project slots those organizations got last year. If you select organizations which get more slots, you can be assure that your project idea will not get thrown off at the last moment. Now you have couple of targets on your head.
Selecting a Project

Now you are done with selecting organizations. Next step id to select an project idea.
  • Search for the 2012 GSOC ideas of those organizations. As an example if you select PhpMyadmin as an organization, you can google for "phpmyadmin 2012 gsoc ideas". It will give you set of links which are related to that topic. Among those you can find this wiki page which solves half of your problems.
  • Now you can find what are the latest project ideas they have, who are the assigned mentors for those ideas and what are the technologies they expect from you. If those project ideas match with your expectations you can proceed, or else you can find for other organizations. Assume that you are interested on an idea which was in the Phpmyadmin wiki page.
  • Then you can find whether this is a continuation of a previous GSOC project or a new one using the gsoc project list which I have mentioned above. If it is a continuation your are lucky. You have person to ask. So find who was the last student and drop him mail to get more information. It's okay to drop one or two private mails to him for more information but not too much.
Dropping your first mail
  • Since this a project with a community your visibility to that community is a crucial factor when they select students for their project. So your private mails add less advantage on the competition. So find what is the developer mailing list and the IRC channel of that organization. Then subscribe to them. Now you are ready to put your first mail to the organization which will get a reply with a warm welcome to the community.
  • In the first mail you can introduce your self to the community and mention that your are willing to participate on gsoc with that organization. You need to specifically mention the project idea which is in your focus on that mail and ask for more information.
  • Then you'll get a reply with related information, links to students guides and many more useful things for that project. Now your have to read them and follow them to be prepared for the project. As always you can ask questions on the mailing list for more details.
  • Since all the community people help you voluntarily, you should not bother them asking quick replies for your mails. If they have a time they will definitely reply you. So be patient and polite on the IRC and the mailing list.
Continue with the community
  • You have work with the community and impress them before applying for the project. Most of the communities expect students to fix some bugs which are listed on their bug tracks to make sure that the student is committed to this project.
  • So you can select some easy bugs from the bug list and try to resolve them. You can ask for more help on the mailing list.
  • You can suggest your own ideas to the project and discuss them on the mailing list.
Early bird gets the worm
  • Since this is highly competitive, more and more students will try to get the same project. Most of projects get huge number of request at the last moment. So it is better to active on the project earlier and be on safe side.
  • One other advantage of being active on the community is get rid of unnecessary competition. Most of the students look at an idea from the list and then go and check in the mailing list to make sure someone is not active on that project idea. If they see that there are many number of mail threads related to that project which were sent by you, they will think twice to compete with you. They may think it's better to move on to a another project which will be more easy to drag.
Get ready your proposal

By the time of your proposal submission, you'll have sound knowledge on the project as well as the community. It's better to prepare it couple of days before the deadline and get your proposal reviewed by the community and the mentor. It will enhance the quality of your proposal as well as avoid unnecessary changes during the project time.

Now you are done with the proposal submission and if you correctly follow these steps you'll definitely get selected to the project. After that the project success is all depend on your commitment.

We warmly welcome you to GSOC. Enjoy your summer.