Minimizing the number of lines is not making the code more readable. Also, next and for loop do not even produce the same results (if the target is not found). Also, For loop can be more performant (if you can break early), and more importantly, it has much more uses than "find one and break", which makes the title incredibly click-baity

Alibek Cholponbaev
Alibek Cholponbaev

Written by Alibek Cholponbaev

Database Developer & Data Engineer. Passionate about technologies, self-improvement and making the world a better place.

No responses yet