+ 14
What is the most efficient way to debug your code?
Debugging is considered as one of the most important skills for a programmer. As we come across many types of situations in which we have to debug our code, I wanna know the efficient way to achieve it.
4 Answers
+ 4
Checking logs, monitoring files that are configuration specific.
Monitoring related services and application servers whether they are working or not in running state.
Debugging skills using console, print command, breakpoints, debuggers etc. (depending on the programming language you are using) will be some of the best practices for debugging.
+ 5
gdb is a good debugger for C/C++ programs.
+ 1
unit testing
0
Dependant on the programming language, but I would put logs throughout the code to see where it stops working and try to figure out why it acts like it does.
For example using console.log when developing JavaScript.
This may not be a rellevant answer if your code is big as it would be annoying to put out function to log all over hundreds or maybe thousand lines of code, in which you should use any debugging tool to help you find the issue in your code.