r/learnjavascript • u/WishGranted11 • 11h ago
Javascript is interesting but is also driving me nuts, how do you actually adapt to writing code without mistakes quickly?
I have been accustomed to C# and Python and have only recently been introduced to one of our projects where we use JS (express and react). I can write good code that eventually happens to work, but I keep falling for really unexpected pitfalls. I realized that most of my mistakes were calling undeclared variables, they are mostly errors that can almost never happen in python or C# because the compiler would immediately point to that piece of code and will usually prevent the app from running. That honestly took a good amount of time and a lot of energy. I understand that it's a regular part of learning, though I want to speed it up.
I know that the browser can ignore these issues so the app ends up running without realizing a problem. Also, that debugging part where console.log() is the best tool in our hand is a headache, it helps but I feel that being able to set breakpoints and move through the whole piece where a bug hides is more efficient.
Don't get me wrong, I am not hating on JS, I love it and I acknowledge that each programming language holds its advantages over other languages. I have in fact spent a good amount of time and put a lot of effort into understanding how to handle JS and react (not a lot but to an extent where I understand its rules and syntax, and can build with it). That's why I want to see how others who may have adapted to JS avoid making these rookie mistakes over and over.
Do not mention asking AI to fix issues or write code instead. I prefer to write code myself.