Wednesday, March 20, 2013

A late realization on embedding the code using gist

Off late I started using gist to embed source code in my blog entries. I was thinking about the consequences of doing this (or any form of embedding text using an external site). I realized the following:

  1. First and foremost the search engines don't get to index the page based on the key words in the embedded source code. For e.g. consider an embedded gist that demonstrates ServerSocket. Unless I mention about ServerSocket in my blog somewhere, the serarch engine will not associate the blog entry with the ServerSocket as that word appears only in the embedded source code.
  2. When peopele search for a specific key word in the embedded source code, they will be taken directly to the gist page, instead of the blog entry. This is bad because the user will not get the context and explanation around the source code.
To understand the depth of the problem, please search for alias-to-jumphosts-alist in Google. You will find that the gist is shown first and then the blog entry. Even in this case the blog entry is shown only because it mentions the function in it.

In future I should try to embed the source code in the blog itself and make use of a source code formatter like SyntaxHighligher.

No comments: