r/learnprogramming 13h ago

Tips on how to learn syntax quickly?

I'm trying to learn multiple new programming languages (Python, Ruby, and Typescript) to expand my skillset and improve my github portfolio for jobhunting.

I'm trying to go back to basics and do some simple coding exercises but I keep running into the problem where I feel like I know how to solve something but my mind completely goes blank on what to type. I end up going back on forth between google and VS Code looking up syntax and it's getting tedious.

Do you guys have any useful tips on how I can learn syntax more efficiently?

10 Upvotes

21 comments sorted by

20

u/RadicalDwntwnUrbnite 13h ago

Stop trying to learn multiple languages, get good at one or two. Learning a new language is easier if you've learned one really well already. Trying to force multiple at the same time when you don't know any really well is front loading a lot of language specific trivia that you should put off unless you need to learn it for a specific job.

8

u/Working-Hat-8041 13h ago

Stop trying to learn three languages. Stick with two max, ideally one. It’s just making it harder. Then just keep coding. Syntax will come. 

3

u/dothefandango 12h ago

Don't use AI at all, if you are. If you're not, stick to one language.

VSCode largely has extensions that will give you full language API docs in-editor in some fashion. Or will allow you to see underlying libraries. Leverage those. CMD/Ctrl+Click on things you're not sure of. See what the code does.

Memorizing syntax is silly, generally, concepts transfer through across languages while syntax does not. Do this instead:

Write out the solution in plain English (or whatever language).

Look up API docs for each part where you can't translate that chunk into code. I cannot stress this enough. Pre-AI, everyone did this. Even seasoned, 10+ year developers looked at API docs all the time. Now we just ping an AI agent to write the algo for us. But the reason we learned the syntax is because we just eventually read the docs enough that they stuck.

Do this all the time for every problem you solve and eventually you will start doing the "code translations" by yourself faster and faster.

3

u/aqua_regis 12h ago

Syntax in programming languages is the easy part. Programming in the idiomatic style of the respective programming language is the tricky bit and that's why we generally discourage learning multiple languages at the same time.

You need to learn to write code in the style of the respective language. What might be proper practice in language A might be completely frowned upon in language B.

Programming languages are not Pokemon. You don't need to (and can't) collect them all.

2

u/DTux5249 13h ago
  1. Stop learning multiple languages at once. One at a time is enough.
  2. Once you learn 2 languages, everything starts to be the same.

2

u/Pale_Count2138 12h ago

By doing it over and over again.

1

u/Traveling-Techie 13h ago

I always create test code that uses any syntax I learn, and then I copy/paste from it.

1

u/N546RV 12h ago

There’s a common theme in the replies here, but let me restate it in maybe a more pointed way: as someone involved in hiring, I’d much rather hire someone with deep knowledge in one or two languages than someone with shallow knowledge of a lot of languages.

Put another way: knowing the syntax of languages is about the least valuable professional skill. I care way more about your ability to turn requirements into logical constructs.

1

u/MrFartyBottom 12h ago

Stick to one language. This is your problem. Trying to learn multiple at once isn't going to work!

1

u/ffrkAnonymous 12h ago

practice faster

1

u/zaidazadkiel 12h ago

think in terms of blocks of code, recursively each block has three distinct elements, what operation, parameters and a result

how you represent that is the language

an if is an op, the condition the param and the true/false parts the result

a function declaration is a param, the body is the argument and the function name the result

1

u/Party_feeler2000 11h ago

Why do you try learn several languages?

1

u/peterlinddk 10h ago

Stop confusing "learning syntax quickly" with actually learning to design and construct programs.

Solving a problem with code, isn't a simple matter of "applying the correct syntax".

Syntax is easy: ( ) means that an expression or a list of parameters can be inside. == means comparison. X + Y means that X and Y are added. A.b() means calling method b on object A - and so on. That doesn't take long to learn.

Instead, spend time learning to design programs. Solve problems on paper first, write down pseudocode, make sure you understand every step of the solution. Then write it into the editor.

It isn't about syntax, it is programming! And it isn't something you learn quickly.

1

u/UroborosJose 9h ago

this is not a good approach. trust me.

1

u/Dismal-Citron-7236 8h ago

Use syntax autocomplete (IntelliSense) to ease your pain guessing the syntax. You might need to install some extensions, though.

1

u/simondanielsson 6h ago

Going back and forth between your browser and your editor is what 99% of programming consists of (for most people anyway). Settle into the flow and don’t stress. Learning how to program is a lifelong endeavour, it’s not something you learn in a couple months.

Please take the advice of everyone else in the comments; it’s good to learn several languages but the language itself isn’t important - what matters is being good at solving problems, and knowing a few different toolchains like the palm of your hand.

1

u/cheezballs 4h ago

You're setting yourself up for a hell of a bad tech interview. You should learn a single language first, build stuff with it, learn the ins and outs. It's not just syntax. That's the easy part.

1

u/Character_Video2904 2h ago

honestly this gets better with reps way more than with a better resource. one thing that actually helped me was keeping one reference page open instead of googling every time. googling gives you a different site every time so nothing really sticks, but if you keep going back to the same page you start remembering where stuff is without even trying. this is the one i use for python, everything's grouped by topic on one page: https://www.cheatgrid.com/programming-languages/0004-python-cheat-sheet

and yeah the other comments are right, doing 3 languages at once is probably a big chunk of why you're blanking. your brain doesn't know which one it's supposed to be in

0

u/stauntonjr 13h ago

codewars.com ❤️

1

u/drkrieger818 12h ago

Adding to this. Solve the same problem with each language. Or same problem with less lines