Yes, the problem is readability. You can get “better” code of you know the exact tooling and settings for compilation, as you can then better guess what optimisations and tricks were used (by the compiler) and you may be able to “undo” them. There are so many places where this will only let you make guesses. You write a loop in your code, the compiler removes the loop and replaced it with another construct that may be a bit faster to execute, but may be way harder to understand - or tedious to change if you need to edit it especially if it’s not a simple change (character can now run faster!) but needs new functionality that would completely break this optimisation (but it’d be trivial to add in the original code).
Also all context is removed. You won’t work with code like this:
(Both pseudocode, not bothered to make a real example that maybe even compiles)
Im inclined to answer with “Yesn’t”
Yes, the problem is readability. You can get “better” code of you know the exact tooling and settings for compilation, as you can then better guess what optimisations and tricks were used (by the compiler) and you may be able to “undo” them. There are so many places where this will only let you make guesses. You write a loop in your code, the compiler removes the loop and replaced it with another construct that may be a bit faster to execute, but may be way harder to understand - or tedious to change if you need to edit it especially if it’s not a simple change (character can now run faster!) but needs new functionality that would completely break this optimisation (but it’d be trivial to add in the original code).
Also all context is removed. You won’t work with code like this:
(Both pseudocode, not bothered to make a real example that maybe even compiles)
if keyPressed(MOVE_RIGHT){ player.speed = min(player.MAX_SPEED, player.speed + player.acceleration*frametime) } else{ player.speed = player.speed * player.MOVEMENT_DAMPENING * frametime }You’d get something like this:
int *fi93836290= 0x7363728 int *fi22425 = &fi93836290+0x23 fi22425 = fun7362782(0x63627)? fun42638(...) //and so on