News for hackers. Stuff that matters.
Re:Ask HN: Do You Use a Debugger? by shortrounddev2 on Saturday March 09, 2024 @12:16PM (#39653103)
Python is a common example. You can use a debugger in vscode but I rarely see people do this, opting instead for print statements everywhere. But for javascript, the ability to put breakpoints into sourcemaps is invaluable, because trying to debug minified or transpiled javascript is a pain in the ass, and yet I still see people console.log everything
Re:Ask HN: Do You Use a Debugger? by skydhash on Saturday March 09, 2024 @02:38PM (#39654163)
More often than not, with python and other dynamic languages, the main source of bugs is not knowing the type of the variable you're dealing right now or what it contains at this point. Setting up breakpoints can be troublesome especially if your IDE/editor is not the one launching your process (attaching to PID is often not trivial). Strongly typed language often obscures logic with verbose syntax, that's where a debugger comes in handy. Compiled languages often only have a single start point and a debugger is more useful than print statement.
Re:Ask HN: Do You Use a Debugger? by shortrounddev2 on Saturday March 09, 2024 @03:05PM (#39654343)
I find debuggers are more useful in a dynamic language because of the uncertainty of the state of the program. I am better able to write lots of code without testing frequently in C++ than I am in Python or Javascript
Re:Ask HN: Do You Use a Debugger? by anditherobot on Saturday March 09, 2024 @11:10PM (#39656652)
In a statically typed language and explicit type definitions.

int age = will never have string "December".

But in python both: age = 42 and age = "December" are possible.

Re:Ask HN: Do You Use a Debugger? by shortrounddev2 on Sunday March 10, 2024 @10:38AM (#39659475)
Yes, that's why I find it much easier to write code without a debugger in c++, though I do use one frequently