Skip to main content
350 votes
Accepted

I changed one method signature and now have over 25,000 errors. What now?

25000 errors basically means "don't touch that". Change it back. Create a new class that has the desired interface and slowly move the consumers of the class to the new one. Depending on ...
Stephen's user avatar
  • 8,838
80 votes

I changed one method signature and now have over 25,000 errors. What now?

Divide and conquer with refactorings Often, breaking up the change that you need to do into smaller steps can help because you can then perform most of the smaller steps in a way that doesn't break ...
theDmi's user avatar
  • 898
76 votes
Accepted

How do you debug a binary format?

For ad-hoc checks, just use a standard hexdump and learn to eyeball it. If you want to tool up for a proper investigation, I usually write a separate decoder in something like Python - ideally this ...
Useless's user avatar
  • 12.6k
48 votes
Accepted

Split the calculation of return value and the return statement in one-line methods?

Introducing explaining variables is a well-known refactoring which can sometimes help to make complicated expressions better readable. However, in the shown case, the additional variable does not "...
Doc Brown's user avatar
  • 210k
46 votes
Accepted

I am spending more time installing software than coding. Why?

What am I doing wrong? You're trying to develop in an environment where you're also the sysadmin, devops and the local technical product owner for every pip package you use - and you're assuming that ...
Useless's user avatar
  • 12.6k
38 votes

Split the calculation of return value and the return statement in one-line methods?

Given the facts that: a) There is no impact on the final code as the compiler optimises the variable away. b) Having it separate enhances debugging capability. I've personally come to the ...
Dom's user avatar
  • 570
36 votes

I changed one method signature and now have over 25,000 errors. What now?

Clarify your task with your boss to help him to understand the problem and your needs as a professional software developer. If you are part of a team, look for the lead developer and ask him for ...
mmehl's user avatar
  • 469
36 votes
Accepted

Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?

I think you are misrepresenting the message of the "Modern C++ in Embedded Systems" video. The point is that there are people in the embedded world that write code and then test it by running the code ...
henje's user avatar
  • 454
35 votes

Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?

No, not at all ! Abstractions and good practices can of course reduce the risks of errors. For example: language abstractions let the compiler generate code, that you would have to write yourself ...
Christophe's user avatar
  • 78.6k
30 votes
Accepted

How to affect priorities to bugs to developers and treat them accordingly?

Generally you have two axes for bugs: gravity and frequency. So obviously something grave and frequent is of the highest priority. However, something that's serious but happens rarely should be ...
Neil's user avatar
  • 22.8k
29 votes

I changed one method signature and now have over 25,000 errors. What now?

Don't touch it. Don't commit anything. Instead, sit down on your chair and shout "Heeeeelp!!!!!" as loud as you can. Well, not exactly like that, but ask any of your senior colleagues for advice. ...
gnasher729's user avatar
29 votes

Code readability and debugging

is there a good balance between readable code and debuggable code Yes there is. As you wrote by yourself in a comment, example 2 is both - debuggable and readable*. The real drawback is not ...
Doc Brown's user avatar
  • 210k
26 votes

How does GDB pause an execution

It varies slightly with the architecture, but the important points apply nearly universally: Interrupt servicing causes the CPU state (including registers) to be saved to memory before running the ...
Ben Voigt's user avatar
  • 3,256
23 votes

I changed one method signature and now have over 25,000 errors. What now?

Entrenched APIs can't simply be changed. If you really need to change them, anootate and/or document them as deprecated (by whatever means the language allows) and document which API should be used ...
Kevin Krumwiede's user avatar
23 votes

How to affect priorities to bugs to developers and treat them accordingly?

This really boils down to what you consider to be more important. The P2 bug or the new feature? Usually an agile project management system will include some sort of prioritisation meeting where ...
Ewan's user avatar
  • 77.4k
22 votes

Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?

This question basically boils down to "can you write bug free code the first time every time?” The answer is always going to be no. Yes, there are practices that can help, you can isolate modules. ...
whatsisname's user avatar
  • 27.7k
22 votes
Accepted

How do AI developers for LLM fix bugs when the LLM misbehaves, given that they cannot control what the LLM learns from the data?

machine learning software behaviour is unpredictable since the developer cannot control what the software learns from the data. If you control the model, the data, the input, and the random, then the ...
candied_orange's user avatar
17 votes

How do AI developers for LLM fix bugs when the LLM misbehaves, given that they cannot control what the LLM learns from the data?

The answers so far have not mentioned reinforcement learning from human feedback (RLHF). I'm not an expert, but my understanding is that at least in the case of ChatGPT, this is the main way in which ...
N. Virgo's user avatar
  • 894
16 votes
Accepted

If you follow the rule of Zero, how will you debug the construction of an object?

After much debate, many lunches, posts on various forums, and head scratching, a colleague of mine came up with the following: In Visual Studio, go to Debug->New Breakpoint->Function Breakpoint and ...
Christopher Pisz's user avatar
16 votes

Split the calculation of return value and the return statement in one-line methods?

Often, introducing a variable just to name some result is very helpful when it makes the code more self documenting. In this case that's not a factor because the variable name is very similar to the ...
amon's user avatar
  • 135k
15 votes

How does GDB pause an execution

In addition to the great information by @BenVoigt, allow me to make some additions: A breakpoint is set by the debugger by replacing a machine code value (an instruction or part of an instruction) in ...
Erik Eidt's user avatar
  • 34.2k
14 votes
Accepted

Difficulties in reading code

I have more than 20 years of experience and I am profoundly lazy. I work in many platforms. The way I read and understand someone else's code is primarily with my fingers. Why yes I am the kid who ...
candied_orange's user avatar
13 votes

What is the difference between debugging and antibugging?

Firstly, antibugging isn't a commonly used term, a few people use it, but it won't be generally recognized. For those people that do use it, they mean practices to avoid writing bugs in the first ...
Winston Ewert's user avatar
13 votes

Code readability and debugging

IMO you're missing the actual solution: A dedicated, descriptive method. What you are encountering is an issue with 'Cognitive load', which you want to reduce. Lower cognitive load = Easier to ...
Martijn's user avatar
  • 697
12 votes

Code readability and debugging

Your second example changed the meaning of the code. Part 2 and 3 of the “if” are executed even if part 1 is true, which can be anywhere from harmless to inefficient to disastrous. Another answer ...
gnasher729's user avatar
11 votes

I changed one method signature and now have over 25,000 errors. What now?

Evaluate Evaluate whether this change is necessary, or whether you can add a new method and deprecate the other. Forward If changing is necessary; then a migration plan is necessary. The first ...
Matthieu M.'s user avatar
  • 15.1k
11 votes
Accepted

Advice for bugfixing object oriented code: why is data not set?

There are two ways to deal with object state: Have extremely sophisticated debugging skills so that you can find obscure bugs, or Manage your state in a better way so that obscure bugs do not happen ...
Robert Harvey's user avatar
11 votes
Accepted

Better conditional debugging pattern?

Use standard logging library In Python there is only one proper pattern: use standard logging module according to official HowTo. Or, for Python 3, this standard logging module and this HowTo. There ...
Frax's user avatar
  • 1,844
11 votes
Accepted

Is there a specific name for this kind of debugging?

Yes, there is a well-known term for this, it is called Post-mortem debugging (See Wikipedia, Debugging, Techniques). This is typically done using something like an automatically generated crash-...
Doc Brown's user avatar
  • 210k
11 votes

Should a bug fixer know the overall structure what the program does?

In order to fix a broken program you need to know both what the program actually does and also what it is supposed to do. The latter comes from some sort of specification, which might, itself, be ...
Buffy's user avatar
  • 213

Only top scored, non community-wiki answers of a minimum length are eligible