this post was submitted on 22 Jun 2023
26 points (100.0% liked)

Programming

13383 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

I know profilers and debuggers are a boon for productivity, but anecdotally I've found they're seldom used. How often do you use debuggers/profilers in your work? What's preventing you? conversely, what enables you to use them?

you are viewing a single comment's thread
view the rest of the comments
[–] TheTrueLinuxDev 2 points 1 year ago* (last edited 1 year ago) (1 children)

One of the thing I learn about in programming is that, if you have to use debuggers too often then maybe it's a good time to re-evaluate on how you develop a project.

  1. Did you misunderstand the pattern design?
  2. Were there something you don't understand?
  3. Maybe it's an indication that you need to document more and do some project designs before committing the implementation?
  4. Were the way you write code more prone to bugs?
  5. Are there any libraries or tools that can help you alleviate this?

By fixing your practice and making it less prone to bugs, you wouldn't have to resort to using debugger as often.

As for profilers, it really depends, but generally if you try to be conservative like applying lockless concurrency where possible and sometime resorting to mutex/semaphore if otherwise needed, you should generally be ok when dealing with concurrency situation. As for overall performance, the rule of thumb is that, the less code you run to do the work, the better. You can see what program would actually do when dealing with C language for instance, but you might have a harder time to make such evaluation on higher level languages, so the general wisdom is that the heavy computation operation should be deferred to low level language like C language and you should have high level language calls into that C function to handle those performance intensive operations.

[–] pinkpatrol@anarch.is 3 points 1 year ago (1 children)

That's an interesting point about depending too heavily on a debugger. I haven't run into anyone too dependent on it, but I could see that happening.

To me, debuggers offer a tighter dev loop when there's something you're stuck on. They also let you 'grok' a call stack in an unfamiliar codebase. "Did this function get called?" "What's in this variable?" etc.

[–] TheTrueLinuxDev 1 points 1 year ago* (last edited 1 year ago)

That I agree, I always see it as a critical necessity to always document everything when more than 1 developer work on the project. It like making a trade:

Spend time and effort debugging

Or

Spend time documenting and maintain it with the help of Chatgpt

With ChatGPT, it seems to reduce cost for documenting while same can't be said for debugging.