M
Mathew Cucuzella
It seems like the convention is to use blocks instead of more
procedural loops. I'm really used to blocks now, but are there
situations where a 'for' or 'while' loop is a more suitable
choice?
The only situation where a 'for' loop seems more natural is when
searching through an array, and you want to 'break' out when you find
the element. Breaking out of a block doesn't seem right, if it even
works.
Thanks,
-mat
procedural loops. I'm really used to blocks now, but are there
situations where a 'for' or 'while' loop is a more suitable
choice?
The only situation where a 'for' loop seems more natural is when
searching through an array, and you want to 'break' out when you find
the element. Breaking out of a block doesn't seem right, if it even
works.
Thanks,
-mat