17
Switched from console.log to the debugger tool and wow what a difference
Honestly I spent my first 6 months learning JavaScript just using console.log for everything. It worked but I was spending like 30 minutes on each bug just guessing where stuff broke. Two weeks ago I finally learned how to use the built in debugger in VS Code with breakpoints and step through my code. Now I can see exactly what each variable holds at every line in like 5 minutes. It feels like cheating compared to how I used to do it. Has anyone else avoided the debugger for way too long and then regretted it?
3 comments
Log in to join the discussion
Log In3 Comments
karenb974d ago
Oh yeah I did the same thing for way too long... and @alicemurphy is right, you still gotta understand the logic, but the debugger just saves you from hunting through every line manually lol. Once you get comfortable with breakpoints you'll never go back to log spam.
10
Feels like cheating" yeah because it kinda is. You're letting the tool do all the work instead of actually understanding what your code is doing. Next you'll be like "I used an AI to write my code and wow what a difference.
8