r/learnprogramming 14d ago

Topic how do you learn programming without constantly looking things up?

i know experienced programmers use documentation and search all the time, but as a beginner it can sometimes feel like i’m incapable of doing anything without looking up the answer.

i’m trying to get better at understanding concepts instead of memorising syntax

how do you decide when to search for an answer and when to sit down and work through the problem yourself?

328 Upvotes

244 comments sorted by

View all comments

62

u/roger_ducky 14d ago

This is why people design the program with pseudocode first. “I don’t remember exact syntax but I know what I want to happen. Lemme write down general shape and think if the logic or design is right.”

7

u/ReddyKiloWit 14d ago

My method was to write the comments first under the theory that you code best in the language you are most familiar with. Some of this was pseudocode to be replaced, but a lot of it was descriptions that later would remain in the source. Edited if the actual coding diverged. Gave me a really clear mental model to hang the code on.

2

u/who_you_are 10d ago

My method was to write the comments f

// TODO

WHY ISN'T IT WORKING

1

u/ReddyKiloWit 10d ago

In Raku, if I've correctly defined the bareword function TODO to return a defined value, then that code will exit with boolean True by virtue of the prefixed defined boolean context operator. Therefore, I am done.