- pram
- Jun 10, 2001
-
|
I realize that in school they taught you to use print statements to trace your code. that’s amateur level poo poo. if you’re being paid to write code, it’s time to start using tools like a professional. learn how to use a debugger. I’ve debugged all kinds of code, from low level boot loaders whose only io was blinking a single LED to great big multithreaded monsters that spew gigs of logs. and I was able to use a debugger on all of them to make my life better and so can you.
when you start a project, the first thing you do after writing the boilerplate main function is get the debugger working. for most of you writing normal programs, it’s as easy as running the debugger that comes with your tool chain, zero effort. remember to add the debug symbols flags to your build. if you’re working with an embedded target or simulator or FPGA or gpu or whatever, it will take more work. whether it’s a debug server or jtag or ICE or some other nonsense, get that poo poo up and running before writing any more code. set up core dumps. get stack traces from crashes.
if you are asked to join a project, ask them how they debug. if they say printf tell them to get hosed. or fix that. whichever. but if they don’t want to fix it, definitely the former. if the language doesn’t support a debugger, it is a bad language and you should not use it. if your board doesn’t have a debug port, send it back to the idiots that made it and tell them it’s broken.
it’s time to put on our big boy pants and start acting like professionals.
lol
|
#
¿
Oct 19, 2019 20:35
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 16, 2024 19:00
|
|
- pram
- Jun 10, 2001
-
|
osx has lldb and dtrace which is p good
|
#
¿
Oct 25, 2019 06:07
|
|
- pram
- Jun 10, 2001
-
|
i meant dtrace is good
|
#
¿
Oct 25, 2019 15:58
|
|