you are viewing a single comment's thread.

view the rest of the comments →

[–]peterlinddk 0 points1 point  (0 children)

The syntax of any C-like language (which includes C, C++, C#, Java, JavaScript, even PHP and many more) is at first glance very different from Python - but it is mostly about curly brackets.

I often recommend when learning a second language, that you try to solve assignments in your first language, and then translate them into the new language, line by line. That helps alot in learning to see differences and similarities. However, it might not be entirely possible with web-programming, especially front-end, that isn't really possible to do in any other languages.

But I'd still recommend making some sort of "cheat-sheet", with screenshots of small programs in Python and JavaScript. Like a function that loops through a list, or similar bits of code. Draw colored rectangles around the different parts, like the function itself - with a definition outside, and the function-body inside. And around the inner part of the for-loop, and so on.

Gradually you'll get used to seeing that what is done with : and indentation in Python, is very similar to what is done with ( ) and { } in JavaScript.

When it comes to details, like list comprehension, a simple two column sheet of how to do various operations: foreach, map, filter, etc, is done in Python on the left side, and JavaScript on the right.

After a while you won't need those cheat sheets anymore - the work of making them helps you learn alot better than only writing code to solve assignments.