Using events over isKeyPressed isn't a "reformatting", you're changing the underlying code. Formatting usually refers to code styling change that don't affect the semantics and usually also not the syntax.
The event that you're getting from the
pollEvent() call already carries all the necessary information, as such it's for one redundant to again ask the system/device what the keyboard state of a specific key is, in relation to an event. Meaning if the event is of type KeyPressed (
event.type == sf::Event::KeyPressed), then you know that a key has been pressed, you don't have to query again if the key is pressed.
In the worst case you might miss the key press, although you process the event, the key might have already been let go. Meaning you get a KeyPressed event that happened like 0.5ms ago, but then you ask the device again if at this moment right now the key is pressed, but you've let go in that time frame, thus the input isn't processed. Granted this is quite an edge case, but it does happen and can lead to frustrations for players/users.
And finally, real-time input checks are slightly more expensive, as you have to query device information, while the event has already gathered that information, and on some systems (e.g. macOS), you'll need additional permissions for the function to return anything at all.
The "new" recommendation is to use events whenever possible, but also never mix events and real-time checks for the same event occurrence.