O
25
c/coding-for-beginnerscaleb140caleb14014d agoProlific Poster

A guy at the coffee shop told me something that changed how I learn code

I was working on a Python tutorial at The Daily Grind in Austin, getting stuck on a loop. The guy next to me saw my screen and said, 'Just write the print statement first, then build the loop around it.' He explained that starting with the result you want to see makes the logic click. I tried it right there and it worked perfectly. Has anyone else found a simple trick like that to get past a beginner's block?
2 comments

Log in to join the discussion

Log In
2 Comments
elizabethwhite
Yeah, that's a solid tip. But what about when you're not just stuck on the syntax, but you can't even picture what the code should do? I'll open a blank file and just write in plain English what I want to happen, step by step, like a recipe. Then I translate each line into code. It turns a big scary problem into a bunch of small, solvable ones. Why do we always jump straight to typing code before we even know what we're building?
8
mark_smith59
mark_smith5914d agoMost Upvoted
It's like writing the manual before building the machine.
7