Formating Your Source Code

What are source codes?

This is what mr.Wiki explains:
"In computer science, source code is text written in a computer programming language. Such a language is specially designed to facilitate the work of computer programmers..."
Put it in a nutshell, it's a computer code in text. For example,
<b:include data='blog' name='all-head-content'/>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
<title><data:blog.pageName/> | <data:blog.title/></title>
<b:else/><title><data:blog.pageTitle/></title>
</b:if>
Above this, the box contained source code.
Messy Source Code
Messy Source Code
Why we have to format our source code when posting them in a post (blog post, forum post...)?
This is not related with SEO, backlinks, and so on. This is about how you get your post handled neatly when you insert source code, it’s all about readability and visibility.

If your blog post goes in this way,
Hey, today I'm going to show you some tutorial on formatting source code....Here we go,
<b:include data='blog' name='all-head-content'/>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
<title><data:blog.pageName/> | <data:blog.title/></title>
<b:else/><title><data:blog.pageTitle/></title>
</b:if>
Instead, we should add a format to these source codes in this way,
Hey, today I'm going to show you some tutorial on formatting source code....Here we go,
<b:include data='blog' name='all-head-content'/>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
<title><data:blog.pageName/> | <data:blog.title/></title>
<b:else/><title><data:blog.pageTitle/></title>
</b:if>
The second one would be much more neatly than the first one, if you see them with a pair of normal eyes. =) But, if you still see no difference, then go further reading on my explanation.

If we were putting the source code like the first example, the source code and the writings will be eventually messed up together and make the readers dizzy. The second one looks better right?! In common sense, these source codes should have some formatting and style, to beautify them as well as making the contents stay neatly tidy! Well, the examples have the short source code, what if they were ten times of the length of these source code? You will really need a box to seal them off!

This is all about readability and visibility of your contents. Without a good looking of your contents, even how much traffic you get, you will eventually lost them. So, when you try to insert source code, don't be idle to style them neatly which will just take you about less than a minute.

How to format source code?

There are a lot of ways formatting source codes. I found one of the sites which has the function to format your source code neatly with one click. Click here to visit the site. Just insert the source code in the first column and click the format code, then it will convert your code into the HTML code, which will eventually box the source code up. There is a lot of styling and formatting of source code, this is a simple and handsome style.

0 comments

Leave a Reply

Related Posts Plugin for WordPress, Blogger...