In this context, it is not recommended to avoid using loops. They are fundamentals of a programming language. If you don't use them, your code will easily get messy and hard for others to read. do...while
, for
while
are equally important. You can't say, "I just want to learn while loops but not the others". Because you eventually need to read others' code and when you see a do...while loop you can't just ignore it, can you?
Conclusion: You can use only one kind of loop in your program (NOT RECOMMENDED). It is possible. But you still have to learn them because they will appear in others' code.
However, in programming, there are some other things that you can have preferences. If you don't care about other factors, you can say, "I like using insertion sort to sort arrays". You can just use insertion sort. I mean this kind of stuff is personal preferences but loops? Just no.
Let me just sum up my points here:
In this special case, don't use only one kind of loop and learn ALL of them. However, in other areas, you can have your own preferences, such as sorting arrays and reading files and design patterns (if you don't care about other factors)
Note: Actually as a software developer, you have to keep learning. If you don't understand something, learn it! Look at the experience of NikG below