by arjonagelhout · 1y ago · 0 comments
Take this example: "When debugging I typically:"
> Write tests to isolate the problem
In the case of math functions, or more primitive building blocks, writing tests can help ensure correctness of the underlying functions, to exclude them from the problem search.
> Reason about the code logically first
This is always useful.
> Use a debugger to step through code systematically
Useful when dealing with a larger codebase and the control flow is hard to follow. The call stack can give quick guidance over trying to manually decipher the control flow.
> Add print statements to understand data flow:
Useful when debugging continuous data streams or events, e.g. mouse input, where you don't want to interrupt the user interaction that needs to be debugged.
Similar to how when presented with the trolley problem some will ask many follow up questions about the individuals on each track, the train, etc.
That’s not the point.
Not the OP, but what would be the point to that? In any practical scenario there is always context, isnt it? I guess I don't quite get what we are trying to measure here.
In this case, one tacit assumption is that a given developer will typically adopt just one of these approaches. Another is that they can meaningfully and objectively be ordered along either of the axes purportedly being measured.