21
My buddy said to just use "while true" loops for everything and I crashed my laptop 6 times in one afternoon
He told me it was fine because infinite loops are "just a rite of passage" for beginners, but my fan sounded like a jet engine for 20 minutes straight before I realized I forgot a break condition. Has anyone else had a friend give them terrible coding advice that seemed smart at first?
2 comments
Log in to join the discussion
Log In2 Comments
sandra_black26d ago
Yeah, "while true" is fine if you know what you're doing but telling a beginner to use it for everything is just setting them up for a bad time. Your buddy meant well but forgot to mention the most important part, which is the break condition.
5
cora_martinez26d ago
I mean I kind of disagree, sometimes an endless loop with a break inside is the clearest way to write certain things.
10