When writing long strings or cases for switch() statements and in various languages:
stream <<"Text is delicious. "<< varA <<" Indeed, oh so delicious. " << varB
<<"Text is delicious. "<< varC <<" Indeed, oh so delicious. " << varD
<<"Text is delicious. "<< varE <<" Indeed, oh so delicious. " << varF;
string = "Text is delicious. "+ varA +" Indeed, oh so delicious. "+ varB
+"Text is delicious. "+ varC +" Indeed, oh so delicious. " + varD
+"Text is delicious. "+ varE +" Indeed, oh so delicious. " + varF;
string = "Text is delicious. ". varA ." Indeed, oh so delicious. ". varB
."Text is delicious. ". varC ." Indeed, oh so delicious. " . varD
."Text is delicious. ". varE ." Indeed, oh so delicious. " . varF;
The same style applies to any other long 'one-liners'. I also especially have a habit of condensing some function calls when they are very short usually.
/* Formula Description */
int soFunctional(int a, int b){ int c=a; a+=b*b/2; b=c*b; return a+b; }
Whether nested or not
if or loop(condition)
{
...
...
...
}
Unless it is one statement, then usually
if(condition) statement();
if(condition)
var= statement + many * operations / with +(long % lines());
Finally I often will create classes like:
class _object_
{
....
};
_object_ OBJECT;
typedef _object_ object; //sometimes
Where OBJECT is a special case of _object_ sometimes I'll use main, root or default instead of the object's name and sometimes I'll use all of them.
When I skip two, three or four lines, I feel like I'm setting a narrative. Very compulsive.
Naming scheme is somewhat crazy. Temporary variables of sufficient "obviousness" will often be named such things as "taco" "dumb" "monkey" during alpha phase. Most of my code is made so that I can easily do a search and replace on the whole file without worries, for when I'm actually sharing the code later!
At that point the naming takes on a life of it's own. One thing I notice is that usually I will say VariableName whereas I usually see variableName.
If VariableName looks wrong I'll go to Overly_Descriptive_Variable_Name. Usually all my variables except for ones like x,y,z,i and sometimes num will be fairly long. About,... 7-12 characters.