New sourcecode formatting


Thanks to Alf, I have discovered the WordPress [sourcecode] tag. Where I would previously use <code> and <pre> and get the following result:

int true_random() {
    return 4; //Generated by fair roll of a die
}

I now use [sourcecode language="cpp"] ... [/sourcecode] and get the following:

int true_random() {
    return 4; //Generated by fair roll of a die
}

The syntax highlighting and line numbering is done client-side with JavaScript, but even without JavaScript the code looks nicely formatted with <pre>.

I have gone through all my older posts and updated them to use the new tag, please let me know if you see any spots I missed, or any errors I made in the process.

New Blog!


Welcome to my new blog! Having programmed various languages since ~1997, I have worked as a C++-programmer for a year now, and find it a fascinating language. In this blog I will post anything C++-related I come across and find interesting, in the hope that someone else will find it useful as well.