Content deleted Content added
Davide King (talk | contribs) fix double space |
grammar, style, added links |
||
Line 107:
is syntactically correct, but fails type checking since the right side, a string, cannot be assigned to a float variable. Compilation fails {{endash}} forcing this defect to be fixed before development progress can resume. With an interpreted language, a failure would not occur until later at runtime.
Some languages exclude features that easily lead to bugs, at the expense of slower performance {{endash}} the principle being that it is usually better to write simpler, slower correct code than complicated, buggy code. For example,
Some languages include features that add runtime overhead in order to prevent
=== Techniques ===
For example,
if (condition)
foo(); But this code always executes {{code|foo}}:
if (condition);
foo(); Using braces - even if they're not strictly required - reliably prevents this error:
if (condition) {
foo();
}
Enforcement of conventions may be manual (i.e. via [[code review]]) or via automated tools such as [[Lint_(software)|linters]].
=== Specification ===
|