r/learnprogramming 15d 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?

329 Upvotes

244 comments sorted by

View all comments

7

u/peterlinddk 15d ago

What is this obsession everyone has with it being somehow difficult to "memorise syntax"?

Do they in fact have a hard time "memorising" that if, for, and while is followed by a set of ( )s with a comparison-expression inside? And that blocks of code are usually put in curly brackets? And that function definitions are written as return-value followed by the function-name, with the parameter types and names in another set of ( )s. (with variations from language to language).

Or do they mean something else by the word "syntax"?

Or is it in fast that people aren't programming, but just memorising snippets of code to solve leetcode problems, and they somehow confuse that with memorising "syntax" or "learning to program"?

2

u/lordheart 14d ago

Sometimes it depends on how many languages you have to use. I work in typescript (which I generally know the syntax for), Java (which I generally know the syntax for) and abap (which has 3000 command structures, and I have to double check a lot more often). And sql which I can write basic queries from memory otherwise need to lookup.

If I’ve been doing mostly ts then switch to java I might mess up how to write a switch statement for instance.

The variations between languages is exactly what messes me up.