5 ms·
Well the 2 aren't mutually exclusive. Throw a unique error code in there, as well as a description on how to fix it.
by Klathmon 10y ago
Well the 2 aren't mutually exclusive.
Throw a unique error code in there, as well as a description on how to fix it.
- Jtsummers 10y agoERROR 832A: Line 42, missing semicolon, you probably won't a semicolon here: foo(); ^ Or something of the like. If the compiler knows the error, it knows what things might be missing. In the case of limited options it could predict and continue parsing. Then, with a more complex error, that error code is actually useful for googling or reviewing the compiler documentation.
- seanmcdirmid 10y agoOr one could just apply semicolon inference and emit a warning, allowing the code to still run, at least.
- taeric 10y agoThat would probably be a step backwards. I'm all for a debug mode that can let bad code in a running environment. It should not pass a build, though.
- seanmcdirmid 10y agoDepends if you are compiling/executing the code continuously or not during development. Old-style batch programming environments are already plenty of steps backwards.
- taeric 10y agoFair. I actually loved the feature of Eclipse where bad code would pseudo compile. I just worry heavily about anything that emits warnings. Most warnings, it seems, either should have been failures, or needed more powerful tooling to know why it was ok.
- Retra 10y agoWarnings are basically errors that don't halt compilation. You shouldn't have any of either in production code.
- taeric 10y agoMy point, exactly. I don't want more things that don't halt compilation. If you have a special environment that can fake it, fine. But the general build run of compilation should fail much faster than it typically does.
- seanmcdirmid 10y agoSure. But most of the time you are writing/developing/debugging code, it is not running in production at the same time.