Well, have you ever put code samples in your blog? If you have did that, but without using any code syntax highlighter, it will certainly look like a mess. Don’t agree? See this. This is a code fraction for java. It doesn’t have any of those text-formatting, just typed using only the normal Blogger fonts.
/**
* This application simply prints hello world in the screen
*/
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the text
}
}
What do you say? Is it readable or look pretty? Not at all! This kind of code samples will certainly drive your readers out of the site. Even we wrap the code with the HTML 'code' tag, it won't look much better. Therefore you should use a code highlighter. I was searching for that stuff and finally one of my friends tell me about a syntax highlighter. And later I found another technique. So I thought I will share it with you.
/**
* This application simply prints hello world in the screen
*/
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the text
}
}
What do you say? Is it readable or look pretty? Not at all! This kind of code samples will certainly drive your readers out of the site. Even we wrap the code with the HTML 'code' tag, it won't look much better. Therefore you should use a code highlighter. I was searching for that stuff and finally one of my friends tell me about a syntax highlighter. And later I found another technique. So I thought I will share it with you.