0
If a compiler can detect errors, then why can't it remove them...?
If the compiler knows that, "Semicolon is missing at line number 69", then why it can't simply put ' ; ', instead of giving us error...☹️
3 ответов
+ 5
IMO it would be way worse if it does that. If you want that functionality use an IDE. It is better than compilers editing your source code silently.
Also some compilers for example Go's compiler will automatically add a semicolon for you. This however can cause unexpected results e.g for loop braces can't start in a new line.
+ 2
That's what JavaScript does. However, most programming languages expect you to follow their rules, even if the compiler/interpreter "knows what you meant".