A lesson on formatting code...
Since I've been noticing some people posting mangled code lately in the community, I'd like to take a moment to explain how to post readable code.
HTML entities:
< is <
> is >
& is &
Use these (respectively) when they occur in your code, or else Livejournal gets confused and won't display your post properly.
eg.
Encasing your text in
This text is ten spaces from the left.
The
Encasing your text in
This text will appear hidden from your friends page.
Hopefully this has cleared up a few issues for some people. Formatting your code makes everything nice and easy, and is more likely to get constructive comments. Not formatting your code makes it painful to try and read, and you'll most likely just end up getting a few nasty comments. Maybe even a dead rat in your mailbox. (Just kidding!)
Good luck!
HTML entities:
< is <
> is >
& is &
Use these (respectively) when they occur in your code, or else Livejournal gets confused and won't display your post properly.
eg.
#include <iostream>, or if ( x < 1 && x > -1);<pre> tag:Encasing your text in
<pre> and </pre> retains the formatting of the text. Here is the <pre> tag in action:This text is ten spaces from the left.Here is the same text, entered with the same spacing, but without the
<pre> tag:This text is ten spaces from the left.
The
<lj-cut> tag:Encasing your text in
<lj-cut> and </lj-cut> hides that text from the friends view of the person reading the entry. This is useful for when you want to post long bits of code or something else which will take up loads of space on someone's friends page.<lj-cut text="This is an lj-cut. Click here to see an example of how to use it.">This text will appear hidden from your friends page.
</lj-cut>Hopefully this has cleared up a few issues for some people. Formatting your code makes everything nice and easy, and is more likely to get constructive comments. Not formatting your code makes it painful to try and read, and you'll most likely just end up getting a few nasty comments. Maybe even a dead rat in your mailbox. (Just kidding!)
Good luck!
