> On Jun 16, 2023, at 6:23 PM, Thomas Kurz via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> Whether it's elegant is a different question. In my opinion YES because it 
> often gives better readable code than nested "if" statements inside the loop. 
> But I've also read that using "break" is discouraged because it shows a bad 
> choice of the loop range.

This is highly suspect. Doing an early break in loops is the essence of how to 
do linear searching. No idea who thinks that's a bad idea.

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to