this post was submitted on 30 Sep 2023
374 points (90.1% liked)
Programmer Humor
32444 readers
1650 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Many debuggers (at least in the Java world, which is what I'm working with for a living) support more advanced features like only triggering the breakpoint if a certain condition is reached or only every X hits of the breakpoint.
Also, if you try and debug using print in the main game loop, wouldn't that write so much to console/log that it's effectively unreadable?
So first, visual studio had that too but the integration with unreal is hit or miss. You can't really do complex conditions.
Second, you lock it behind a conditional and it's much easier to read. Like if you want to ensure the force curve of your jump matches what the float curve you give to the designer is set to then printing out and spot checking a few is much better than using float compares that would be broken in the same way in certain platforms where floating point data is interpreted differently. So you are the data on Windows, it's different on Linux and this you can't just compare it because it matches just like it would in windows.
Third, if you really want you don't print to screen instead of log which if you give a key entry, it will just update it rather than spam your screen.
Overall even the most experienced engineers in the games industry uses printing of the values at times. Debuggers are of course still very preferred for most things.