2 ms·
> if the computer guessed at where to insert the " and got it wrong, especially if it didn't tell you what it had done, this could lead to some pretty weird sid
by hrktb 6y ago
> if the computer guessed at where to insert the " and got it wrong, especially if it didn't tell you what it had done, this could lead to some pretty weird side-effects in terms of program behaviour that might be harder to debug/fix.
As a lot of things, this is a matter of how often it gets it wrong.
For instance in ruby world, rubocop has an option to autofix. To your point, it makes it clear what it fixes so you can review. It’s also conservative enough to bail on anything that could have strong effects, like block endings.
That said in years using it I can’t remember any time I really regretted making it autofix stuff.
- mook 6y agoRubocop is a linter, so it tends to have an easier time: it only needs to process input that is already correct, though it might have style issues. It doesn't need to do anything that might change the meaning of your program. Inserting quotes will change the meaning of the program, so getting it right is much harder.