Forum Moderators: coopster
if you have 30K lines of code and there are 4 to 10 individual lines per numbered line in the file and then you get an error on line 2456.
well, is it one of the 10 lines on that line or one of the 7 on any of the 5 lines above that?
debugging will become very time consuming.
In my case, it's mostly just a matter of not wanting to go blind!
I have even mostly switched to the ultra space-inefficient "Allman" style braces instead of "K&R" style, as in
if (cond)
{
}
instead of
if (cond) {
}
On indenting/braces and the various styles
[cs.bris.ac.uk...] (search on Allman)
According to the Wikkipedia [wkonline.com], Allman and Whitesmith are most popular (it ran overwhelmingly Allman when Dan Fernandez did a bit on it on his blog).
Why? Because with consistent tabbing it becomes so much easier to make sure you have you nesting right and I just find it a lot more readable, though I can see why K&R didn't use it back in the days of punch cards and tiny monitors.
I've been using the unique Timotheos style
if (whatever) {
echo "this";
}
else {
echo "that";
} Tim
From resource listed in msg# 6:No mixed code and comments
n++; // increment x
This one nailed me recently. I was using brackets on a single line if statement. Later, cleaning up the code, I pulled the statement all together, so I had:
if ($a) { $b // comment }
A few hours later I was cured of mixed code and comments.
personally, i have found for simple line it's easier for me to read one line...
like...
if ( this == that ) { echo "something"; }
but if the code contains lots more functions, attributes and such, it would be obvious that it would be easier to format the code with indenting. what i think is most important is that the designers chooses a formatting that works for him/her and uses it all the time. when working in a team, you may need to choose a formatting structure that others can easily read too.
in any case, my original question has been answered
thanks again :)