Posted: Sun Apr 02, 2006 8:01 pm
I wish. I'm really just a random 15-year-old who codes in his free time.Sounds like your style is very similiar to mine...you must be a top notch developer?
That is an interesting problem. Convention says that you use i, j and then k for loops, and i is pretty much synonymous with loops nowadays, but I always think, "Hmm... what letter comes after k? A, b, c..." I would propose using that only for deeply nested loops. Keep i for the other ones.For instance...I always use single character identifiers for loop indices, but I always start with i
For now on...I think I'm gonna start with a and each time a new one is needed I increment the ordinal value and go from there.
I have run into bugs when dealing with deeply nested for loops, etc...and re-using a counter variable...so this new convention would eliminate that all together...
Edit due to post phasing
I hate it when people omit braces like this:
Code: Select all
if ($condition)
do_something();Code: Select all
if ($condition)
do_something();
do_something_else();Code: Select all
if ($condition) do_something();