O
24

Coding with my cousin led to a big fight over loops.

My cousin, who codes for work, says for loops are always cleaner and easier. I found a tutorial that says while loops are better for some tasks, like when you don't know how many times to run the code. We argued so much that now I'm second-guessing every line I write. Should beginners learn from family and friends, or is it safer to follow online guides alone?
3 comments

Log in to join the discussion

Log In
3 Comments
shah.ben
shah.ben4d ago
Have you ever watched a friend stress over coding style until it ruins their fun? My buddy Sam had this exact thing happen, his older brother taught him to always use list comprehensions in Python. But then Sam tried some online exercises where for loops were the standard way, and it confused him so much they had a huge fight. The thing is, both methods work, and tutorials exist because there's more than one path to solve a problem. Family help is solid, but online resources show a wider range of real world examples. In the end, Sam learned to use both and now he codes without worrying who's right.
9
andrew430
andrew4308d ago
Your cousin codes for work, but your tutorial about while loops is totally valid too.
5
the_taylor
Seriously, @andrew430, you know my cousin codes for work and still think my tutorial is valid? That's shocking because he makes fun of my basic examples all the time.
8