17
Why does nobody talk about how hard it is to switch from Python to JavaScript?
I started coding 4 months ago with Python and got comfortable with loops and functions pretty fast. Last week I tried to build a simple button that changes color on a webpage using JavaScript and I spent 3 hours debugging a syntax error because I forgot curly braces. The asynchronous stuff is really messing with my head after getting used to Python's step by step flow. Has anyone else found this transition way rougher than they expected?
2 comments
Log in to join the discussion
Log In2 Comments
kellyr1825d ago
Oh man this is exactly what I went through a few years back. The curly braces and semicolons will get you every time at first, I spent a whole night once because I put a comma in the wrong spot. For the async stuff, try using async/await instead of promises until you get more comfortable, it looks way more like Python's step by step flow. Also a good tip is to use a linter like ESLint right from the start, it saves you from those dumb syntax errors. It does get better after a few weeks though, your brain just needs time to switch modes.
7
lucas_grant8325d ago
Bro have you tried putting a semicolon at the end of every line even when you don't need one? That's what broke me the first week, I kept missing them and my whole page just went blank. The curly braces thing is brutal too, I still forget them sometimes and stare at the screen like it's broken.
3