I really appreciate all of your input, especially BrowserUK. I'll try those changes, and see how it works. I agree - testing is critical.
One thing I figure I should describe is my naming convention. Yes, I know $major_frame_index and $minor_frame_index are long, but my reasoning was that $major or even $major_frame didn't seem descriptive enough for me. See, this is part of a larger app, in which I parse a large chunk of binary data (major frame), which is in turn made up of smaller chunks of data (minor frames). This resulted in two types of data for each type of frame, a numerical index and a chunk of binary data. The indices I use to reference their locations I called $major_frame_index and $minor_frame_index, and the chunks of data I have as scalar variables, $minor_frame and $major_frame. But writing this now makes me rethink my need to have store the binary chunks in variables... I don't have access to the rest of the code now, so can't say for sure.
But, assuming I would still need both the index and the binary chunk, is there a better way to name the variables?
-- Burvil
In reply to Re^2: Refactoring nested if block
by bowei_99
in thread Refactoring nested if block
by bowei_99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |