I have developed a habit of writing comments in my code by putting the comments on the same line as the opening brace, after the brace. I've found that this saves vertical space. It also leaves a hint why something was done, but I'm wondering if it's readable for others.
Example:
void DoSomeInterestingImageManipulation(char *pImage)
{//This will convert the image to formatABC which allows x% space savings for storage
if(pImage && pImage[0] == 0xFF)
{//Process the extra case where image internal format needs decompression
++pImage;
//...
//...
//...
}
//Proceed normally
*pResult = Foo(pImage);
}
Do you consider it easier to read or harder to read?