As explained to me by our professor, one thing that professional coders do not like to see is the same lines of code written over again. Personally, I can understand this feeling, coding is complex and takes quite a bit of time, so providing the programmer with the proper tools to be more efficient is ultimately extremely beneficial. To prevent the need to create the same line of code multiple times, loops were created. To further explain, if we want a certain line of code to run more than one time, rather than type out that code into individual lines, you use a loop to have that code run a set amount of times. There are three types of loops: the “for” loop, the “while” loop, and the “do-while” loop. Loops were certainly very difficult for me to understand, I was unsure of how they were implemented into the code. After reading over some of my peers’ blog posts, they all did a great job really breaking down the different kinds of loops, and ultimately they’re the ones that helped me gain a better understanding of how they work. As I previously stated, in business being efficient is extremely important, and the implementation of the loop allows for much time to be saved and less errors to occur.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
The title makes me laugh, but I agree that it will save someone so much time possible. Eventually it will keep going until it is initiated to stop.